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.ApiKeyCreateResponse;
import com.conekta.model.ApiKeyRequest;
import com.conekta.model.ApiKeyResponse;
import com.conekta.model.ApiKeyUpdateRequest;
import com.conekta.model.DeleteApiKeysResponse;
import com.conekta.model.Error;
import com.conekta.model.GetApiKeysResponse;
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 ApiKeysApi {
private ApiClient apiClient;
public ApiKeysApi() {
this(Configuration.getDefaultApiClient());
}
public ApiKeysApi(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 Api Key
* Create a api key
* @param apiKeyRequest requested field for a api keys (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 ApiKeyCreateResponse
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
successful operation
* Content-Type - The format of the response body * Conekta-Media-Type -
401
authentication error
-
422
parameter validation error
-
500
internal server error
-
*/
public ApiKeyCreateResponse createApiKey(ApiKeyRequest apiKeyRequest, String acceptLanguage, String xChildCompanyId) throws ApiException {
return createApiKeyWithHttpInfo(apiKeyRequest, acceptLanguage, xChildCompanyId).getData();
}
/**
* Create Api Key
* Create a api key
* @param apiKeyRequest requested field for a api keys (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<ApiKeyCreateResponse>
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
successful operation
* Content-Type - The format of the response body * Conekta-Media-Type -
401
authentication error
-
422
parameter validation error
-
500
internal server error
-
*/
public ApiResponse createApiKeyWithHttpInfo(ApiKeyRequest apiKeyRequest, String acceptLanguage, String xChildCompanyId) throws ApiException {
// Check required parameters
if (apiKeyRequest == null) {
throw new ApiException(400, "Missing the required parameter 'apiKeyRequest' when calling createApiKey");
}
// 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("ApiKeysApi.createApiKey", "/api_keys", "POST", new ArrayList<>(), apiKeyRequest,
localVarHeaderParams, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType,
localVarAuthNames, localVarReturnType, false);
}
/**
* Delete Api Key
* Deletes a api key that corresponds to a api key ID
* @param id Identifier of the resource (required)
* @param acceptLanguage Use for knowing which language to use (optional, default to es)
* @return DeleteApiKeysResponse
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
successful
* Content-Type - The format of the response body * Conekta-Media-Type -
401
authentication error
-
404
not found entity
-
500
internal server error
-
*/
public DeleteApiKeysResponse deleteApiKey(String id, String acceptLanguage) throws ApiException {
return deleteApiKeyWithHttpInfo(id, acceptLanguage).getData();
}
/**
* Delete Api Key
* Deletes a api key that corresponds to a api key ID
* @param id Identifier of the resource (required)
* @param acceptLanguage Use for knowing which language to use (optional, default to es)
* @return ApiResponse<DeleteApiKeysResponse>
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
successful
* Content-Type - The format of the response body * Conekta-Media-Type -
401
authentication error
-
404
not found entity
-
500
internal server error
-
*/
public ApiResponse deleteApiKeyWithHttpInfo(String id, String acceptLanguage) throws ApiException {
// Check required parameters
if (id == null) {
throw new ApiException(400, "Missing the required parameter 'id' when calling deleteApiKey");
}
// Path parameters
String localVarPath = "/api_keys/{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("ApiKeysApi.deleteApiKey", localVarPath, "DELETE", new ArrayList<>(), null,
localVarHeaderParams, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType,
localVarAuthNames, localVarReturnType, false);
}
/**
* Get Api Key
* Gets a api key that corresponds to a api key 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 ApiKeyResponse
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
successful
* Content-Type - The format of the response body * Conekta-Media-Type -
401
authentication error
-
404
not found entity
-
500
internal server error
-
*/
public ApiKeyResponse getApiKey(String id, String acceptLanguage, String xChildCompanyId) throws ApiException {
return getApiKeyWithHttpInfo(id, acceptLanguage, xChildCompanyId).getData();
}
/**
* Get Api Key
* Gets a api key that corresponds to a api key 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<ApiKeyResponse>
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
successful
* Content-Type - The format of the response body * Conekta-Media-Type -
401
authentication error
-
404
not found entity
-
500
internal server error
-
*/
public ApiResponse getApiKeyWithHttpInfo(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 getApiKey");
}
// Path parameters
String localVarPath = "/api_keys/{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("ApiKeysApi.getApiKey", localVarPath, "GET", new ArrayList<>(), null,
localVarHeaderParams, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType,
localVarAuthNames, localVarReturnType, false);
}
/**
* Get list of Api Keys
* Consume the list of api keys you have
* @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 next next page (optional)
* @param previous previous page (optional)
* @param search General search, e.g. by id, description, prefix (optional)
* @return GetApiKeysResponse
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
successful
* Content-Type - The format of the response body * Conekta-Media-Type -
401
authentication error
-
500
internal server error
-
*/
public GetApiKeysResponse getApiKeys(String acceptLanguage, String xChildCompanyId, Integer limit, String next, String previous, String search) throws ApiException {
return getApiKeysWithHttpInfo(acceptLanguage, xChildCompanyId, limit, next, previous, search).getData();
}
/**
* Get list of Api Keys
* Consume the list of api keys you have
* @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 next next page (optional)
* @param previous previous page (optional)
* @param search General search, e.g. by id, description, prefix (optional)
* @return ApiResponse<GetApiKeysResponse>
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
successful
* Content-Type - The format of the response body * Conekta-Media-Type -
401
authentication error
-
500
internal server error
-
*/
public ApiResponse getApiKeysWithHttpInfo(String acceptLanguage, String xChildCompanyId, Integer limit, String next, String previous, String search) throws ApiException {
// Query parameters
List localVarQueryParams = new ArrayList<>(
apiClient.parameterToPairs("", "limit", limit)
);
localVarQueryParams.addAll(apiClient.parameterToPairs("", "next", next));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "previous", previous));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "search", search));
// 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("ApiKeysApi.getApiKeys", "/api_keys", "GET", localVarQueryParams, null,
localVarHeaderParams, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType,
localVarAuthNames, localVarReturnType, false);
}
/**
* Update Api Key
* Update an existing api key
* @param id Identifier of the resource (required)
* @param acceptLanguage Use for knowing which language to use (optional, default to es)
* @param apiKeyUpdateRequest (optional)
* @return ApiKeyResponse
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
successful operation
-
404
not found entity
-
401
authentication error
-
500
internal server error
-
*/
public ApiKeyResponse updateApiKey(String id, String acceptLanguage, ApiKeyUpdateRequest apiKeyUpdateRequest) throws ApiException {
return updateApiKeyWithHttpInfo(id, acceptLanguage, apiKeyUpdateRequest).getData();
}
/**
* Update Api Key
* Update an existing api key
* @param id Identifier of the resource (required)
* @param acceptLanguage Use for knowing which language to use (optional, default to es)
* @param apiKeyUpdateRequest (optional)
* @return ApiResponse<ApiKeyResponse>
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
successful operation
-
404
not found entity
-
401
authentication error
-
500
internal server error
-
*/
public ApiResponse updateApiKeyWithHttpInfo(String id, String acceptLanguage, ApiKeyUpdateRequest apiKeyUpdateRequest) throws ApiException {
// Check required parameters
if (id == null) {
throw new ApiException(400, "Missing the required parameter 'id' when calling updateApiKey");
}
// Path parameters
String localVarPath = "/api_keys/{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("application/json");
String[] localVarAuthNames = new String[] {"bearerAuth"};
GenericType localVarReturnType = new GenericType() {};
return apiClient.invokeAPI("ApiKeysApi.updateApiKey", localVarPath, "PUT", new ArrayList<>(), apiKeyUpdateRequest,
localVarHeaderParams, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType,
localVarAuthNames, localVarReturnType, false);
}
}