com.conekta.PayoutOrdersApi Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ct-conekta-java Show documentation
Show all versions of ct-conekta-java Show documentation
This is a java library that allows interaction with https://api.conekta.io API.
The newest version!
package com.conekta;
import com.conekta.ApiException;
import com.conekta.ApiClient;
import com.conekta.ApiResponse;
import com.conekta.Configuration;
import com.conekta.Pair;
import javax.ws.rs.core.GenericType;
import com.conekta.model.Error;
import com.conekta.model.PayoutOrder;
import com.conekta.model.PayoutOrderResponse;
import com.conekta.model.PayoutOrdersResponse;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.5.0")
public class PayoutOrdersApi {
private ApiClient apiClient;
public PayoutOrdersApi() {
this(Configuration.getDefaultApiClient());
}
public PayoutOrdersApi(ApiClient apiClient) {
this.apiClient = apiClient;
}
/**
* Get the API client
*
* @return API client
*/
public ApiClient getApiClient() {
return apiClient;
}
/**
* Set the API client
*
* @param apiClient an instance of API client
*/
public void setApiClient(ApiClient apiClient) {
this.apiClient = apiClient;
}
/**
* Create payout order
* Create a new payout order.
* @param payoutOrder requested field for payout order (required)
* @param acceptLanguage Use for knowing which language to use (optional, default to es)
* @return PayoutOrderResponse
* @throws ApiException if fails to make API call
* @http.response.details
Status Code Description Response Headers
200 successful operation -
422 parameter validation error -
401 authentication error -
402 payment required error -
404 not found entity -
500 internal server error -
*/
public PayoutOrderResponse createPayoutOrder(PayoutOrder payoutOrder, String acceptLanguage) throws ApiException {
return createPayoutOrderWithHttpInfo(payoutOrder, acceptLanguage).getData();
}
/**
* Create payout order
* Create a new payout order.
* @param payoutOrder requested field for payout order (required)
* @param acceptLanguage Use for knowing which language to use (optional, default to es)
* @return ApiResponse<PayoutOrderResponse>
* @throws ApiException if fails to make API call
* @http.response.details
Status Code Description Response Headers
200 successful operation -
422 parameter validation error -
401 authentication error -
402 payment required error -
404 not found entity -
500 internal server error -
*/
public ApiResponse createPayoutOrderWithHttpInfo(PayoutOrder payoutOrder, String acceptLanguage) throws ApiException {
// Check required parameters
if (payoutOrder == null) {
throw new ApiException(400, "Missing the required parameter 'payoutOrder' when calling createPayoutOrder");
}
// Header parameters
Map localVarHeaderParams = new LinkedHashMap<>();
if (acceptLanguage != null) {
localVarHeaderParams.put("Accept-Language", apiClient.parameterToString(acceptLanguage));
}
String localVarAccept = apiClient.selectHeaderAccept("application/vnd.conekta-v2.1.0+json");
String localVarContentType = apiClient.selectHeaderContentType("application/json");
String[] localVarAuthNames = new String[] {"bearerAuth"};
GenericType localVarReturnType = new GenericType() {};
return apiClient.invokeAPI("PayoutOrdersApi.createPayoutOrder", "/payout_orders", "POST", new ArrayList<>(), payoutOrder,
localVarHeaderParams, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType,
localVarAuthNames, localVarReturnType, false);
}
/**
* Get Payout Order
* Gets a payout Order resource that corresponds to a payout order ID.
* @param id Identifier of the resource (required)
* @param acceptLanguage Use for knowing which language to use (optional, default to es)
* @return PayoutOrderResponse
* @throws ApiException if fails to make API call
* @http.response.details
Status Code Description Response Headers
200 successful operation -
401 authentication error -
404 not found entity -
500 internal server error -
*/
public PayoutOrderResponse getPayoutOrderById(String id, String acceptLanguage) throws ApiException {
return getPayoutOrderByIdWithHttpInfo(id, acceptLanguage).getData();
}
/**
* Get Payout Order
* Gets a payout Order resource that corresponds to a payout order ID.
* @param id Identifier of the resource (required)
* @param acceptLanguage Use for knowing which language to use (optional, default to es)
* @return ApiResponse<PayoutOrderResponse>
* @throws ApiException if fails to make API call
* @http.response.details
Status Code Description Response Headers
200 successful operation -
401 authentication error -
404 not found entity -
500 internal server error -
*/
public ApiResponse getPayoutOrderByIdWithHttpInfo(String id, String acceptLanguage) throws ApiException {
// Check required parameters
if (id == null) {
throw new ApiException(400, "Missing the required parameter 'id' when calling getPayoutOrderById");
}
// Path parameters
String localVarPath = "/payout_orders/{id}"
.replaceAll("\\{id}", apiClient.escapeString(id));
// Header parameters
Map localVarHeaderParams = new LinkedHashMap<>();
if (acceptLanguage != null) {
localVarHeaderParams.put("Accept-Language", apiClient.parameterToString(acceptLanguage));
}
String localVarAccept = apiClient.selectHeaderAccept("application/vnd.conekta-v2.1.0+json");
String localVarContentType = apiClient.selectHeaderContentType();
String[] localVarAuthNames = new String[] {"bearerAuth"};
GenericType localVarReturnType = new GenericType() {};
return apiClient.invokeAPI("PayoutOrdersApi.getPayoutOrderById", localVarPath, "GET", new ArrayList<>(), null,
localVarHeaderParams, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType,
localVarAuthNames, localVarReturnType, false);
}
/**
* Get a list of Payout Orders
* Get Payout order details in the form of a list
* @param acceptLanguage Use for knowing which language to use (optional, default to es)
* @param limit The numbers of items to return, the maximum value is 250 (optional, default to 20)
* @param search General order search, e.g. by mail, reference etc. (optional)
* @param next next page (optional)
* @param previous previous page (optional)
* @return PayoutOrdersResponse
* @throws ApiException if fails to make API call
* @http.response.details
Status Code Description Response Headers
200 successful operation -
401 authentication error -
500 internal server error -
*/
public PayoutOrdersResponse getPayoutOrders(String acceptLanguage, Integer limit, String search, String next, String previous) throws ApiException {
return getPayoutOrdersWithHttpInfo(acceptLanguage, limit, search, next, previous).getData();
}
/**
* Get a list of Payout Orders
* Get Payout order details in the form of a list
* @param acceptLanguage Use for knowing which language to use (optional, default to es)
* @param limit The numbers of items to return, the maximum value is 250 (optional, default to 20)
* @param search General order search, e.g. by mail, reference etc. (optional)
* @param next next page (optional)
* @param previous previous page (optional)
* @return ApiResponse<PayoutOrdersResponse>
* @throws ApiException if fails to make API call
* @http.response.details
Status Code Description Response Headers
200 successful operation -
401 authentication error -
500 internal server error -
*/
public ApiResponse getPayoutOrdersWithHttpInfo(String acceptLanguage, Integer limit, String search, String next, String previous) throws ApiException {
// Query parameters
List localVarQueryParams = new ArrayList<>(
apiClient.parameterToPairs("", "limit", limit)
);
localVarQueryParams.addAll(apiClient.parameterToPairs("", "search", search));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "next", next));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "previous", previous));
// Header parameters
Map localVarHeaderParams = new LinkedHashMap<>();
if (acceptLanguage != null) {
localVarHeaderParams.put("Accept-Language", apiClient.parameterToString(acceptLanguage));
}
String localVarAccept = apiClient.selectHeaderAccept("application/vnd.conekta-v2.1.0+json");
String localVarContentType = apiClient.selectHeaderContentType();
String[] localVarAuthNames = new String[] {"bearerAuth"};
GenericType localVarReturnType = new GenericType() {};
return apiClient.invokeAPI("PayoutOrdersApi.getPayoutOrders", "/payout_orders", "GET", localVarQueryParams, null,
localVarHeaderParams, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType,
localVarAuthNames, localVarReturnType, false);
}
}