Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
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.GetPlansResponse;
import com.conekta.model.PlanRequest;
import com.conekta.model.PlanResponse;
import com.conekta.model.PlanUpdateRequest;
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 PlansApi {
private ApiClient apiClient;
public PlansApi() {
this(Configuration.getDefaultApiClient());
}
public PlansApi(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 Plan
* Create a new plan for an existing order
* @param planRequest requested field for plan (required)
* @param acceptLanguage Use for knowing which language to use (optional, default to es)
* @param xChildCompanyId In the case of a holding company, the company id of the child company to which will process the request. (optional)
* @return PlanResponse
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
successful
* Date - The date and time that the response was sent * Content-Type - The format of the response body * Content-Length - The length of the response body in bytes * Connection - The type of connection used to transfer the response * Conekta-Media-Type -
422
parameter validation error
-
401
authentication error
-
500
internal server error
-
*/
public PlanResponse createPlan(PlanRequest planRequest, String acceptLanguage, String xChildCompanyId) throws ApiException {
return createPlanWithHttpInfo(planRequest, acceptLanguage, xChildCompanyId).getData();
}
/**
* Create Plan
* Create a new plan for an existing order
* @param planRequest requested field for plan (required)
* @param acceptLanguage Use for knowing which language to use (optional, default to es)
* @param xChildCompanyId In the case of a holding company, the company id of the child company to which will process the request. (optional)
* @return ApiResponse<PlanResponse>
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
successful
* Date - The date and time that the response was sent * Content-Type - The format of the response body * Content-Length - The length of the response body in bytes * Connection - The type of connection used to transfer the response * Conekta-Media-Type -
422
parameter validation error
-
401
authentication error
-
500
internal server error
-
*/
public ApiResponse createPlanWithHttpInfo(PlanRequest planRequest, String acceptLanguage, String xChildCompanyId) throws ApiException {
// Check required parameters
if (planRequest == null) {
throw new ApiException(400, "Missing the required parameter 'planRequest' when calling createPlan");
}
// Header parameters
Map localVarHeaderParams = new LinkedHashMap<>();
if (acceptLanguage != null) {
localVarHeaderParams.put("Accept-Language", apiClient.parameterToString(acceptLanguage));
}
if (xChildCompanyId != null) {
localVarHeaderParams.put("X-Child-Company-Id", apiClient.parameterToString(xChildCompanyId));
}
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("PlansApi.createPlan", "/plans", "POST", new ArrayList<>(), planRequest,
localVarHeaderParams, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType,
localVarAuthNames, localVarReturnType, false);
}
/**
* Delete Plan
*
* @param id Identifier of the resource (required)
* @param acceptLanguage Use for knowing which language to use (optional, default to es)
* @return PlanResponse
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
successful
* Date - The date and time that the response was sent * Content-Type - The format of the response body * Content-Length - The length of the response body in bytes * Connection - The type of connection used to transfer the response * Conekta-Media-Type -
422
parameter validation error
-
401
authentication error
-
404
not found entity
-
500
internal server error
-
*/
public PlanResponse deletePlan(String id, String acceptLanguage) throws ApiException {
return deletePlanWithHttpInfo(id, acceptLanguage).getData();
}
/**
* Delete Plan
*
* @param id Identifier of the resource (required)
* @param acceptLanguage Use for knowing which language to use (optional, default to es)
* @return ApiResponse<PlanResponse>
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
successful
* Date - The date and time that the response was sent * Content-Type - The format of the response body * Content-Length - The length of the response body in bytes * Connection - The type of connection used to transfer the response * Conekta-Media-Type -
422
parameter validation error
-
401
authentication error
-
404
not found entity
-
500
internal server error
-
*/
public ApiResponse deletePlanWithHttpInfo(String id, String acceptLanguage) throws ApiException {
// Check required parameters
if (id == null) {
throw new ApiException(400, "Missing the required parameter 'id' when calling deletePlan");
}
// Path parameters
String localVarPath = "/plans/{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("PlansApi.deletePlan", localVarPath, "DELETE", new ArrayList<>(), null,
localVarHeaderParams, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType,
localVarAuthNames, localVarReturnType, false);
}
/**
* Get Plan
*
* @param id Identifier of the resource (required)
* @param acceptLanguage Use for knowing which language to use (optional, default to es)
* @param xChildCompanyId In the case of a holding company, the company id of the child company to which will process the request. (optional)
* @return PlanResponse
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
successful
* Date - The date and time that the response was sent * Content-Type - The format of the response body * Content-Length - The length of the response body in bytes * Connection - The type of connection used to transfer the response * Conekta-Media-Type -
422
parameter validation error
-
401
authentication error
-
404
not found entity
-
500
internal server error
-
*/
public PlanResponse getPlan(String id, String acceptLanguage, String xChildCompanyId) throws ApiException {
return getPlanWithHttpInfo(id, acceptLanguage, xChildCompanyId).getData();
}
/**
* Get Plan
*
* @param id Identifier of the resource (required)
* @param acceptLanguage Use for knowing which language to use (optional, default to es)
* @param xChildCompanyId In the case of a holding company, the company id of the child company to which will process the request. (optional)
* @return ApiResponse<PlanResponse>
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
successful
* Date - The date and time that the response was sent * Content-Type - The format of the response body * Content-Length - The length of the response body in bytes * Connection - The type of connection used to transfer the response * Conekta-Media-Type -
422
parameter validation error
-
401
authentication error
-
404
not found entity
-
500
internal server error
-
*/
public ApiResponse getPlanWithHttpInfo(String id, String acceptLanguage, String xChildCompanyId) throws ApiException {
// Check required parameters
if (id == null) {
throw new ApiException(400, "Missing the required parameter 'id' when calling getPlan");
}
// Path parameters
String localVarPath = "/plans/{id}"
.replaceAll("\\{id}", apiClient.escapeString(id));
// Header parameters
Map localVarHeaderParams = new LinkedHashMap<>();
if (acceptLanguage != null) {
localVarHeaderParams.put("Accept-Language", apiClient.parameterToString(acceptLanguage));
}
if (xChildCompanyId != null) {
localVarHeaderParams.put("X-Child-Company-Id", apiClient.parameterToString(xChildCompanyId));
}
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("PlansApi.getPlan", localVarPath, "GET", new ArrayList<>(), null,
localVarHeaderParams, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType,
localVarAuthNames, localVarReturnType, false);
}
/**
* Get A List of Plans
*
* @param acceptLanguage Use for knowing which language to use (optional, default to es)
* @param xChildCompanyId In the case of a holding company, the company id of the child company to which will process the request. (optional)
* @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 GetPlansResponse
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
successful
* Date - The date and time that the response was sent * Content-Type - The format of the response body * Content-Length - The length of the response body in bytes * Connection - The type of connection used to transfer the response * Conekta-Media-Type -
422
parameter validation error
-
401
authentication error
-
500
internal server error
-
*/
public GetPlansResponse getPlans(String acceptLanguage, String xChildCompanyId, Integer limit, String search, String next, String previous) throws ApiException {
return getPlansWithHttpInfo(acceptLanguage, xChildCompanyId, limit, search, next, previous).getData();
}
/**
* Get A List of Plans
*
* @param acceptLanguage Use for knowing which language to use (optional, default to es)
* @param xChildCompanyId In the case of a holding company, the company id of the child company to which will process the request. (optional)
* @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<GetPlansResponse>
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
successful
* Date - The date and time that the response was sent * Content-Type - The format of the response body * Content-Length - The length of the response body in bytes * Connection - The type of connection used to transfer the response * Conekta-Media-Type -
422
parameter validation error
-
401
authentication error
-
500
internal server error
-
*/
public ApiResponse getPlansWithHttpInfo(String acceptLanguage, String xChildCompanyId, 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));
}
if (xChildCompanyId != null) {
localVarHeaderParams.put("X-Child-Company-Id", apiClient.parameterToString(xChildCompanyId));
}
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("PlansApi.getPlans", "/plans", "GET", localVarQueryParams, null,
localVarHeaderParams, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType,
localVarAuthNames, localVarReturnType, false);
}
/**
* Update Plan
*
* @param id Identifier of the resource (required)
* @param planUpdateRequest requested field for plan (required)
* @param acceptLanguage Use for knowing which language to use (optional, default to es)
* @param xChildCompanyId In the case of a holding company, the company id of the child company to which will process the request. (optional)
* @return PlanResponse
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
successful
* Date - The date and time that the response was sent * Content-Type - The format of the response body * Content-Length - The length of the response body in bytes * Connection - The type of connection used to transfer the response * Conekta-Media-Type -
422
parameter validation error
-
401
authentication error
-
404
not found entity
-
500
internal server error
-
*/
public PlanResponse updatePlan(String id, PlanUpdateRequest planUpdateRequest, String acceptLanguage, String xChildCompanyId) throws ApiException {
return updatePlanWithHttpInfo(id, planUpdateRequest, acceptLanguage, xChildCompanyId).getData();
}
/**
* Update Plan
*
* @param id Identifier of the resource (required)
* @param planUpdateRequest requested field for plan (required)
* @param acceptLanguage Use for knowing which language to use (optional, default to es)
* @param xChildCompanyId In the case of a holding company, the company id of the child company to which will process the request. (optional)
* @return ApiResponse<PlanResponse>
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
successful
* Date - The date and time that the response was sent * Content-Type - The format of the response body * Content-Length - The length of the response body in bytes * Connection - The type of connection used to transfer the response * Conekta-Media-Type -
422
parameter validation error
-
401
authentication error
-
404
not found entity
-
500
internal server error
-
*/
public ApiResponse updatePlanWithHttpInfo(String id, PlanUpdateRequest planUpdateRequest, String acceptLanguage, String xChildCompanyId) throws ApiException {
// Check required parameters
if (id == null) {
throw new ApiException(400, "Missing the required parameter 'id' when calling updatePlan");
}
if (planUpdateRequest == null) {
throw new ApiException(400, "Missing the required parameter 'planUpdateRequest' when calling updatePlan");
}
// Path parameters
String localVarPath = "/plans/{id}"
.replaceAll("\\{id}", apiClient.escapeString(id));
// Header parameters
Map localVarHeaderParams = new LinkedHashMap<>();
if (acceptLanguage != null) {
localVarHeaderParams.put("Accept-Language", apiClient.parameterToString(acceptLanguage));
}
if (xChildCompanyId != null) {
localVarHeaderParams.put("X-Child-Company-Id", apiClient.parameterToString(xChildCompanyId));
}
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("PlansApi.updatePlan", localVarPath, "PUT", new ArrayList<>(), planUpdateRequest,
localVarHeaderParams, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType,
localVarAuthNames, localVarReturnType, false);
}
}