com.amadeus.Amadeus Maven / Gradle / Ivy
package com.amadeus;
import java.util.Map;
import lombok.NonNull;
/**
*
* The Amadeus API client. To initialize, use the builder as follows:
*
*
*
* Amadeus amadeus =
* Amadeus.builder("REPLACE_BY_YOUR_API_KEY", "REPLACE_BY_YOUR_API_SECRET").build();
*
*
*
* Or pass in environment variables directly:
*
*
*
* Amadeus.builder(System.getenv()).build();
*
*/
public class Amadeus extends HTTPClient {
/**
* The API version.
*/
public static final String VERSION = "6.4.1";
/**
*
* A namespaced client for the /v2/reference-data
endpoints.
*
*/
public ReferenceData referenceData;
/**
*
* A namespaced client for the /v1/travel
endpoints.
*
*/
public Travel travel;
/**
*
* A namespaced client for the /v1/shopping
endpoints.
*
*/
public Shopping shopping;
/**
*
* A namespaced client for the /v2/e-reputation
endpoints.
*
*/
public EReputation ereputation;
/**
*
* A namespaced client for the /v1/airport
endpoints.
*
*/
public Airport airport;
/**
*
* A namespaced client for the /v1/booking
endpoints.
*
*/
public Booking booking;
/**
*
* A namespaced client for the /v2/media
endpoints.
*
*/
public Media media;
/**
*
* A namespaced client for the /v1/safety
endpoints.
*
*/
public Safety safety;
/**
*
* A namespaced client for the /v2/schedule
endpoints.
*
*/
public Schedule schedule;
/**
*
* A namespaced client for the /v1/analytics
endpoints.
*
*/
public Analytics analytics;
/**
*
* A namespaced client for the /v1/duty-of-care
endpoints.
*
*/
public DutyOfCare dutyOfCare;
/**
*
* A namespaced client for the /v1/location
endpoints.
*
*/
public Location location;
/**
*
* A namespaced client for the /v1/airline
endpoints.
*
*/
public Airline airline;
protected Amadeus(Configuration configuration) {
super(configuration);
this.referenceData = new ReferenceData(this);
this.travel = new Travel(this);
this.shopping = new Shopping(this);
this.ereputation = new EReputation(this);
this.airport = new Airport(this);
this.booking = new Booking(this);
this.media = new Media(this);
this.safety = new Safety(this);
this.schedule = new Schedule(this);
this.analytics = new Analytics(this);
this.dutyOfCare = new DutyOfCare(this);
this.location = new Location(this);
this.airline = new Airline(this);
}
/**
* Creates a builder object that can be used to build an Amadeus com.amadeus.client.
*
*
* Amadeus amadeus = Amadeus.builder("CLIENT_ID", "CLIENT_SECRET").build();
*
*
* @param clientId Your API com.amadeus.client credential ID
* @param clientSecret Your API com.amadeus.client credential secret
* @return a Configuration object
*/
public static Configuration builder(@NonNull String clientId, @NonNull String clientSecret) {
return new Configuration(clientId, clientSecret);
}
/**
* Creates a builder object initialized with the environment variables that can be used to build
* an Amadeus API com.amadeus.client.
*
*
* Amadeus amadeus = Amadeus.builder(System.getenv()).build();
*
*
* @param environment The system environment
* @return a Configuration object
*/
public static Configuration builder(Map environment) {
String clientId = environment.get("AMADEUS_CLIENT_ID");
String clientSecret = environment.get("AMADEUS_CLIENT_SECRET");
Configuration configuration = Amadeus.builder(clientId, clientSecret);
configuration.parseEnvironment(environment);
return configuration;
}
}