Skip to content

LODGEA/lodgea-java

Repository files navigation

lodgea

lodgea-java

  • API version: 1.2.0
    • Build date: 2023-02-07T12:22:24.387616647Z[Etc/UTC]

LODGEA SDK for java. Check out https://docs.lodgea.io for more information.

Automatically generated by the OpenAPI Generator

Requirements

Building the API client library requires:

  1. Java 1.7+
  2. Maven (3.8.3+)/Gradle (7.2+)

Installation

To install the API client library to your local Maven repository, simply execute:

mvn clean install

To deploy it to a remote Maven repository instead, configure the settings of the repository and execute:

mvn clean deploy

Refer to the OSSRH Guide for more information.

Maven users

Add this dependency to your project's POM:

<dependency>
  <groupId>com.lodgea</groupId>
  <artifactId>lodgea</artifactId>
  <version>1.2.0</version>
  <scope>compile</scope>
</dependency>

Gradle users

Add this dependency to your project's build file:

  repositories {
    mavenCentral()     // Needed if the 'lodgea' jar has been published to maven central.
    mavenLocal()       // Needed if the 'lodgea' jar has been published to the local maven repo.
  }

  dependencies {
     implementation "com.lodgea:lodgea:1.2.0"
  }

Others

At first generate the JAR by executing:

mvn clean package

Then manually install the following JARs:

  • target/lodgea-1.2.0.jar
  • target/lib/*.jar

Getting Started

Please follow the installation instruction and execute the following Java code:

// Import classes:
import com.lodgea.ApiClient;
import com.lodgea.ApiException;
import com.lodgea.Configuration;
import com.lodgea.auth.*;
import com.lodgea.models.*;
import com.lodgea.controllers.DefaultApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.eu.lodgea.io/v1");
    
    // Configure API key authorization: ApiKeyAuth
    ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth");
    ApiKeyAuth.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //ApiKeyAuth.setApiKeyPrefix("Token");

    DefaultApi apiInstance = new DefaultApi(defaultClient);
    InlineObject1 inlineObject1 = new InlineObject1(); // InlineObject1 | 
    try {
      InlineResponse2001 result = apiInstance.availabilitySearchPost(inlineObject1);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling DefaultApi#availabilitySearchPost");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Documentation for API Endpoints

All URIs are relative to https://api.eu.lodgea.io/v1

Class Method HTTP request Description
DefaultApi availabilitySearchPost POST /availability/search Search for availability
DefaultApi locationSearchPost POST /location/search Search for location
DefaultApi propertiesGet GET /properties List (filtered) properties
DefaultApi propertiesPropertyIdAvailabilityGet GET /properties/{propertyId}/availability Get a properties availability
DefaultApi propertiesPropertyIdGet GET /properties/{propertyId} Get a properties details

Documentation for Models

Documentation for Authorization

Authentication schemes defined for the API:

ApiKeyAuth

  • Type: API key
  • API key parameter name: apiKey
  • Location: HTTP header

Recommendation

It's recommended to create an instance of ApiClient per thread in a multithreaded environment to avoid any potential issues.

Author

[email protected]