com.amadeus.shopping.SeatMaps Maven / Gradle / Ivy
package com.amadeus.shopping;
import com.amadeus.Amadeus;
import com.amadeus.Params;
import com.amadeus.Response;
import com.amadeus.exceptions.ResponseException;
import com.amadeus.resources.Resource;
import com.amadeus.resources.SeatMap;
import com.google.gson.JsonObject;
/**
*
* A namespaced client for the
* /v1/shopping/seatmaps
endpoints.
*
*
*
* Access via the Amadeus client object.
*
*
*
* Amadeus amadeus = Amadeus.builder(API_KEY, API_SECRET).build();
* amadeus.shopping.seatMaps;
*/
public class SeatMaps {
private Amadeus client;
private static final String SEATMAP_URL = "/v1/shopping/seatmaps";
/**
* Constructor.
*
* @hide
*/
public SeatMaps(Amadeus client) {
this.client = client;
}
/**
*
* The SeatMap API allows you to retrieve the seat map of one or several
* flights based on the flight-orderId returned by the Flight Create Orders API.
*
*
*
* amadeus.shopping.seatMaps.get(params);
*
* @param params the parameters to send to the API
* @return an API resource
* @throws ResponseException when an exception occurs
*/
public SeatMap[] get(Params params) throws ResponseException {
Response response = client.get(SEATMAP_URL, params);
return (SeatMap[]) Resource.fromArray(response, SeatMap[].class);
}
/**
* Convenience method for calling get
without any parameters.
* @see SeatMaps#get()
*/
public SeatMap[] get() throws ResponseException {
return get(null);
}
/**
*
* The SeatMap API allows you to retrieve the seat map of one or several
* Take the body of a flight offer search or flight offer price and pass
* it in to this method to get a seatmap.
*
*
*
* amadeus.shopping.seatMaps.post(body);
*
* @param body the parameters to send to the API as a JSonObject
* @return an API resource
* @throws ResponseException when an exception occurs
*/
public SeatMap[] post(JsonObject body) throws ResponseException {
Response response = client.post(SEATMAP_URL, body);
return (SeatMap[]) Resource.fromArray(response, SeatMap[].class);
}
/**
*
* The SeatMap API allows you to retrieve the seat map of one or several
* Take the body of a flight offer search or flight offer price and pass
* it in to this method to get a seatmap.
*
*
*
* amadeus.shopping.seatMaps.post(body);
*
* @param body the parameters to send to the API as a String
* @return an API resource
* @throws ResponseException when an exception occurs
*/
public SeatMap[] post(String body) throws ResponseException {
Response response = client.post(SEATMAP_URL, body);
return (SeatMap[]) Resource.fromArray(response, SeatMap[].class);
}
/**
* Convenience method for calling post
without any parameters.
*
* @see SeatMaps#post()
*/
public SeatMap[] post() throws ResponseException {
return post((String) null);
}
}