Skip to content

metglobal/hotelspro-java-client

Repository files navigation

swagger-java-client

Requirements

Building the API client library requires Maven to be installed.

Installation

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

mvn install

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

mvn deploy

Refer to the official documentation for more information.

Maven users

Add this dependency to your project's POM:

<dependency>
    <groupId>io.swagger</groupId>
    <artifactId>swagger-java-client</artifactId>
    <version>1.0.0</version>
    <scope>compile</scope>
</dependency>

Gradle users

Add this dependency to your project's build file:

compile "io.swagger:swagger-java-client:1.0.0"

Others

At first generate the JAR by executing:

mvn package

Then manually install the following JARs:

  • target/swagger-java-client-1.0.0.jar
  • target/lib/*.jar

Getting Started

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

import hotelspro_client.*;
import hotelspro_client.auth.*;
import hotelspro_client.model.*;
import hotelspro_client.api.DefaultApi;

import java.io.File;
import java.util.*;

public class DefaultApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        
        // Configure HTTP basic authorization: basicAuth
        HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
        basicAuth.setUsername("YOUR USERNAME");
        basicAuth.setPassword("YOUR PASSWORD");

        DefaultApi apiInstance = new DefaultApi();
        String productCode = "productCode_example"; // String | product code that returned in Search(or Hotel Availability) Response
        try {
            AvailabilityResponse result = apiInstance.availabilityProductCodeGet(productCode);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling DefaultApi#availabilityProductCodeGet");
            e.printStackTrace();
        }
    }
}

Documentation for API Endpoints

All URIs are relative to https://localhost/api/v2

Class Method HTTP request Description
DefaultApi availabilityProductCodeGet GET /availability/{product_code} Availability with Product Code
DefaultApi bookProvisionCodePost POST /book/{provision_code} Book with Provision Code
DefaultApi bookingsBookingCodeGet GET /bookings/{booking_code} Get Booking Detail
DefaultApi bookingsGet GET /bookings/ Get Booking List
DefaultApi cancelBookingCodePost POST /cancel/{booking_code} Cancel Booking with Booking Code
DefaultApi hotelAvailabilityGet GET /hotel-availability/ Hotel Availability with Hotel Code and Search Code
DefaultApi provisionProductCodePost POST /provision/{product_code} Provision with Product Code
DefaultApi searchPost POST /search/ Search with Hotel Code(Hotel Code List) or Destination Code or Geolocation

Documentation for Models

Documentation for Authorization

Authentication schemes defined for the API:

basicAuth

  • Type: HTTP basic authentication

Recommendation

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

Author

[email protected]

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages