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.SubscriptionEventsResponse;
import com.conekta.model.SubscriptionRequest;
import com.conekta.model.SubscriptionResponse;
import com.conekta.model.SubscriptionUpdateRequest;
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 SubscriptionsApi {
private ApiClient apiClient;
public SubscriptionsApi() {
this(Configuration.getDefaultApiClient());
}
public SubscriptionsApi(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;
}
/**
* Cancel Subscription
* You can cancel the subscription to stop the plans that your customers consume
* @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 SubscriptionResponse
* @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 -
401
authentication error
-
404
not found entity
-
500
internal server error
-
*/
public SubscriptionResponse cancelSubscription(String id, String acceptLanguage, String xChildCompanyId) throws ApiException {
return cancelSubscriptionWithHttpInfo(id, acceptLanguage, xChildCompanyId).getData();
}
/**
* Cancel Subscription
* You can cancel the subscription to stop the plans that your customers consume
* @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<SubscriptionResponse>
* @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 -
401
authentication error
-
404
not found entity
-
500
internal server error
-
*/
public ApiResponse cancelSubscriptionWithHttpInfo(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 cancelSubscription");
}
// Path parameters
String localVarPath = "/customers/{id}/subscription/cancel"
.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("SubscriptionsApi.cancelSubscription", localVarPath, "POST", new ArrayList<>(), null,
localVarHeaderParams, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType,
localVarAuthNames, localVarReturnType, false);
}
/**
* Create Subscription
* You can create the subscription to include the plans that your customers consume
* @param id Identifier of the resource (required)
* @param subscriptionRequest requested field for subscriptions (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 SubscriptionResponse
* @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 SubscriptionResponse createSubscription(String id, SubscriptionRequest subscriptionRequest, String acceptLanguage, String xChildCompanyId) throws ApiException {
return createSubscriptionWithHttpInfo(id, subscriptionRequest, acceptLanguage, xChildCompanyId).getData();
}
/**
* Create Subscription
* You can create the subscription to include the plans that your customers consume
* @param id Identifier of the resource (required)
* @param subscriptionRequest requested field for subscriptions (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<SubscriptionResponse>
* @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 createSubscriptionWithHttpInfo(String id, SubscriptionRequest subscriptionRequest, String acceptLanguage, String xChildCompanyId) throws ApiException {
// Check required parameters
if (id == null) {
throw new ApiException(400, "Missing the required parameter 'id' when calling createSubscription");
}
if (subscriptionRequest == null) {
throw new ApiException(400, "Missing the required parameter 'subscriptionRequest' when calling createSubscription");
}
// Path parameters
String localVarPath = "/customers/{id}/subscription"
.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("SubscriptionsApi.createSubscription", localVarPath, "POST", new ArrayList<>(), subscriptionRequest,
localVarHeaderParams, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType,
localVarAuthNames, localVarReturnType, false);
}
/**
* Get Events By Subscription
* You can get the events of the subscription(s) of a client, with the customer id
* @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 SubscriptionEventsResponse
* @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 -
401
authentication error
-
402
payment required error
-
404
not found entity
-
422
parameter validation error
-
500
internal server error
-
*/
public SubscriptionEventsResponse getAllEventsFromSubscription(String id, String acceptLanguage, String xChildCompanyId) throws ApiException {
return getAllEventsFromSubscriptionWithHttpInfo(id, acceptLanguage, xChildCompanyId).getData();
}
/**
* Get Events By Subscription
* You can get the events of the subscription(s) of a client, with the customer id
* @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<SubscriptionEventsResponse>
* @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 -
401
authentication error
-
402
payment required error
-
404
not found entity
-
422
parameter validation error
-
500
internal server error
-
*/
public ApiResponse getAllEventsFromSubscriptionWithHttpInfo(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 getAllEventsFromSubscription");
}
// Path parameters
String localVarPath = "/customers/{id}/subscription/events"
.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("SubscriptionsApi.getAllEventsFromSubscription", localVarPath, "GET", new ArrayList<>(), null,
localVarHeaderParams, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType,
localVarAuthNames, localVarReturnType, false);
}
/**
* Get Subscription
*
* @param id Identifier of the resource (required)
* @param acceptLanguage Use for knowing which language to use (optional, default to es)
* @return SubscriptionResponse
* @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 -
401
authentication error
-
404
not found entity
-
500
internal server error
-
*/
public SubscriptionResponse getSubscription(String id, String acceptLanguage) throws ApiException {
return getSubscriptionWithHttpInfo(id, acceptLanguage).getData();
}
/**
* Get Subscription
*
* @param id Identifier of the resource (required)
* @param acceptLanguage Use for knowing which language to use (optional, default to es)
* @return ApiResponse<SubscriptionResponse>
* @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 -
401
authentication error
-
404
not found entity
-
500
internal server error
-
*/
public ApiResponse getSubscriptionWithHttpInfo(String id, String acceptLanguage) throws ApiException {
// Check required parameters
if (id == null) {
throw new ApiException(400, "Missing the required parameter 'id' when calling getSubscription");
}
// Path parameters
String localVarPath = "/customers/{id}/subscription"
.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("SubscriptionsApi.getSubscription", localVarPath, "GET", new ArrayList<>(), null,
localVarHeaderParams, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType,
localVarAuthNames, localVarReturnType, false);
}
/**
* Pause Subscription
* You can pause the subscription to stop the plans that your customers consume
* @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 SubscriptionResponse
* @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 -
401
authentication error
-
402
payment required error
-
404
not found entity
-
500
internal server error
-
*/
public SubscriptionResponse pauseSubscription(String id, String acceptLanguage, String xChildCompanyId) throws ApiException {
return pauseSubscriptionWithHttpInfo(id, acceptLanguage, xChildCompanyId).getData();
}
/**
* Pause Subscription
* You can pause the subscription to stop the plans that your customers consume
* @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<SubscriptionResponse>
* @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 -
401
authentication error
-
402
payment required error
-
404
not found entity
-
500
internal server error
-
*/
public ApiResponse pauseSubscriptionWithHttpInfo(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 pauseSubscription");
}
// Path parameters
String localVarPath = "/customers/{id}/subscription/pause"
.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("SubscriptionsApi.pauseSubscription", localVarPath, "POST", new ArrayList<>(), null,
localVarHeaderParams, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType,
localVarAuthNames, localVarReturnType, false);
}
/**
* Resume Subscription
* You can resume the subscription to start the plans that your customers consume
* @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 SubscriptionResponse
* @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 -
401
authentication error
-
402
payment required error
-
404
not found entity
-
422
parameter validation error
-
500
internal server error
-
*/
public SubscriptionResponse resumeSubscription(String id, String acceptLanguage, String xChildCompanyId) throws ApiException {
return resumeSubscriptionWithHttpInfo(id, acceptLanguage, xChildCompanyId).getData();
}
/**
* Resume Subscription
* You can resume the subscription to start the plans that your customers consume
* @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<SubscriptionResponse>
* @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 -
401
authentication error
-
402
payment required error
-
404
not found entity
-
422
parameter validation error
-
500
internal server error
-
*/
public ApiResponse resumeSubscriptionWithHttpInfo(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 resumeSubscription");
}
// Path parameters
String localVarPath = "/customers/{id}/subscription/resume"
.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("SubscriptionsApi.resumeSubscription", localVarPath, "POST", new ArrayList<>(), null,
localVarHeaderParams, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType,
localVarAuthNames, localVarReturnType, false);
}
/**
* Update Subscription
* You can modify the subscription to change the plans that your customers consume
* @param id Identifier of the resource (required)
* @param subscriptionUpdateRequest requested field for update a subscription (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 SubscriptionResponse
* @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 SubscriptionResponse updateSubscription(String id, SubscriptionUpdateRequest subscriptionUpdateRequest, String acceptLanguage, String xChildCompanyId) throws ApiException {
return updateSubscriptionWithHttpInfo(id, subscriptionUpdateRequest, acceptLanguage, xChildCompanyId).getData();
}
/**
* Update Subscription
* You can modify the subscription to change the plans that your customers consume
* @param id Identifier of the resource (required)
* @param subscriptionUpdateRequest requested field for update a subscription (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<SubscriptionResponse>
* @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 updateSubscriptionWithHttpInfo(String id, SubscriptionUpdateRequest subscriptionUpdateRequest, String acceptLanguage, String xChildCompanyId) throws ApiException {
// Check required parameters
if (id == null) {
throw new ApiException(400, "Missing the required parameter 'id' when calling updateSubscription");
}
if (subscriptionUpdateRequest == null) {
throw new ApiException(400, "Missing the required parameter 'subscriptionUpdateRequest' when calling updateSubscription");
}
// Path parameters
String localVarPath = "/customers/{id}/subscription"
.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("SubscriptionsApi.updateSubscription", localVarPath, "PUT", new ArrayList<>(), subscriptionUpdateRequest,
localVarHeaderParams, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType,
localVarAuthNames, localVarReturnType, false);
}
}