com.amadeus.ordering.transferOrders.transfers.Cancellation Maven / Gradle / Ivy
package com.amadeus.ordering.transferOrders.transfers;
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.TransferCancellation;
import com.google.gson.JsonObject;
/**
*
* A namespaced client for the
* /v1/ordering/transfer-orders/{orderId}/transfers/cancellation
endpoints.
*
*
*
* Access via the Amadeus client object.
*
*
*
* Amadeus amadeus = Amadeus.builder(API_KEY, API_SECRET).build();
* amadeus.ordering.transferOrder(orderId).transfers.cancellation;
*/
public class Cancellation {
private Amadeus client;
private String orderId;
/**
* Constructor.
*
* @hide
*/
public Cancellation(Amadeus client, String orderId) {
this.client = client;
this.orderId = orderId;
}
/**
*
* The Amadeus Transfer Management API allows cancel private transfers.
*
*
*
* amadeus.ordering.transferOrder(orderId).transfers.cancellation.post(params);
*
* @param params URL parameters
* @return an API resource
* @throws ResponseException when an exception occurs
*/
public TransferCancellation post(Params params) throws ResponseException {
String path = String.format("/v1/ordering/transfer-orders/%s/transfers/cancellation", orderId);
Response response = client.post(path, params);
return (TransferCancellation) Resource.fromObject(response, TransferCancellation.class);
}
}