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.DiscountLinesResponse;
import com.conekta.model.Error;
import com.conekta.model.GetOrderDiscountLinesResponse;
import com.conekta.model.OrderDiscountLinesRequest;
import com.conekta.model.UpdateOrderDiscountLinesRequest;
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 DiscountsApi {
private ApiClient apiClient;
public DiscountsApi() {
this(Configuration.getDefaultApiClient());
}
public DiscountsApi(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 Discount
* Create discount lines for an existing orden
* @param id Identifier of the resource (required)
* @param orderDiscountLinesRequest requested field for a discount lines (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 DiscountLinesResponse
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
successful
-
401
authentication error
-
404
not found entity
-
500
internal server error
-
*/
public DiscountLinesResponse ordersCreateDiscountLine(String id, OrderDiscountLinesRequest orderDiscountLinesRequest, String acceptLanguage, String xChildCompanyId) throws ApiException {
return ordersCreateDiscountLineWithHttpInfo(id, orderDiscountLinesRequest, acceptLanguage, xChildCompanyId).getData();
}
/**
* Create Discount
* Create discount lines for an existing orden
* @param id Identifier of the resource (required)
* @param orderDiscountLinesRequest requested field for a discount lines (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<DiscountLinesResponse>
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
successful
-
401
authentication error
-
404
not found entity
-
500
internal server error
-
*/
public ApiResponse ordersCreateDiscountLineWithHttpInfo(String id, OrderDiscountLinesRequest orderDiscountLinesRequest, String acceptLanguage, String xChildCompanyId) throws ApiException {
// Check required parameters
if (id == null) {
throw new ApiException(400, "Missing the required parameter 'id' when calling ordersCreateDiscountLine");
}
if (orderDiscountLinesRequest == null) {
throw new ApiException(400, "Missing the required parameter 'orderDiscountLinesRequest' when calling ordersCreateDiscountLine");
}
// Path parameters
String localVarPath = "/orders/{id}/discount_lines"
.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("DiscountsApi.ordersCreateDiscountLine", localVarPath, "POST", new ArrayList<>(), orderDiscountLinesRequest,
localVarHeaderParams, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType,
localVarAuthNames, localVarReturnType, false);
}
/**
* Delete Discount
* Delete an existing discount lines for an existing orden
* @param id Identifier of the resource (required)
* @param discountLinesId discount line id identifier (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 DiscountLinesResponse
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
successful
-
401
authentication error
-
404
not found entity
-
422
parameter validation error
-
500
internal server error
-
*/
public DiscountLinesResponse ordersDeleteDiscountLines(String id, String discountLinesId, String acceptLanguage, String xChildCompanyId) throws ApiException {
return ordersDeleteDiscountLinesWithHttpInfo(id, discountLinesId, acceptLanguage, xChildCompanyId).getData();
}
/**
* Delete Discount
* Delete an existing discount lines for an existing orden
* @param id Identifier of the resource (required)
* @param discountLinesId discount line id identifier (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<DiscountLinesResponse>
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
successful
-
401
authentication error
-
404
not found entity
-
422
parameter validation error
-
500
internal server error
-
*/
public ApiResponse ordersDeleteDiscountLinesWithHttpInfo(String id, String discountLinesId, String acceptLanguage, String xChildCompanyId) throws ApiException {
// Check required parameters
if (id == null) {
throw new ApiException(400, "Missing the required parameter 'id' when calling ordersDeleteDiscountLines");
}
if (discountLinesId == null) {
throw new ApiException(400, "Missing the required parameter 'discountLinesId' when calling ordersDeleteDiscountLines");
}
// Path parameters
String localVarPath = "/orders/{id}/discount_lines/{discount_lines_id}"
.replaceAll("\\{id}", apiClient.escapeString(id))
.replaceAll("\\{discount_lines_id}", apiClient.escapeString(discountLinesId));
// 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("DiscountsApi.ordersDeleteDiscountLines", localVarPath, "DELETE", new ArrayList<>(), null,
localVarHeaderParams, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType,
localVarAuthNames, localVarReturnType, false);
}
/**
* Get Discount
* Get an existing discount lines for an existing orden
* @param id Identifier of the resource (required)
* @param discountLinesId discount line id identifier (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 DiscountLinesResponse
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
successful
-
401
authentication error
-
404
not found entity
-
422
parameter validation error
-
500
internal server error
-
*/
public DiscountLinesResponse ordersGetDiscountLine(String id, String discountLinesId, String acceptLanguage, String xChildCompanyId) throws ApiException {
return ordersGetDiscountLineWithHttpInfo(id, discountLinesId, acceptLanguage, xChildCompanyId).getData();
}
/**
* Get Discount
* Get an existing discount lines for an existing orden
* @param id Identifier of the resource (required)
* @param discountLinesId discount line id identifier (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<DiscountLinesResponse>
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
successful
-
401
authentication error
-
404
not found entity
-
422
parameter validation error
-
500
internal server error
-
*/
public ApiResponse ordersGetDiscountLineWithHttpInfo(String id, String discountLinesId, String acceptLanguage, String xChildCompanyId) throws ApiException {
// Check required parameters
if (id == null) {
throw new ApiException(400, "Missing the required parameter 'id' when calling ordersGetDiscountLine");
}
if (discountLinesId == null) {
throw new ApiException(400, "Missing the required parameter 'discountLinesId' when calling ordersGetDiscountLine");
}
// Path parameters
String localVarPath = "/orders/{id}/discount_lines/{discount_lines_id}"
.replaceAll("\\{id}", apiClient.escapeString(id))
.replaceAll("\\{discount_lines_id}", apiClient.escapeString(discountLinesId));
// 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("DiscountsApi.ordersGetDiscountLine", localVarPath, "GET", new ArrayList<>(), null,
localVarHeaderParams, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType,
localVarAuthNames, localVarReturnType, false);
}
/**
* Get a List of Discount
* Get discount lines for an existing orden
* @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)
* @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 GetOrderDiscountLinesResponse
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
successful
-
401
authentication error
-
500
internal server error
-
*/
public GetOrderDiscountLinesResponse ordersGetDiscountLines(String id, String acceptLanguage, String xChildCompanyId, Integer limit, String search, String next, String previous) throws ApiException {
return ordersGetDiscountLinesWithHttpInfo(id, acceptLanguage, xChildCompanyId, limit, search, next, previous).getData();
}
/**
* Get a List of Discount
* Get discount lines for an existing orden
* @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)
* @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<GetOrderDiscountLinesResponse>
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
successful
-
401
authentication error
-
500
internal server error
-
*/
public ApiResponse ordersGetDiscountLinesWithHttpInfo(String id, String acceptLanguage, String xChildCompanyId, Integer limit, String search, String next, String previous) throws ApiException {
// Check required parameters
if (id == null) {
throw new ApiException(400, "Missing the required parameter 'id' when calling ordersGetDiscountLines");
}
// Path parameters
String localVarPath = "/orders/{id}/discount_lines"
.replaceAll("\\{id}", apiClient.escapeString(id));
// 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("DiscountsApi.ordersGetDiscountLines", localVarPath, "GET", localVarQueryParams, null,
localVarHeaderParams, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType,
localVarAuthNames, localVarReturnType, false);
}
/**
* Update Discount
* Update an existing discount lines for an existing orden
* @param id Identifier of the resource (required)
* @param discountLinesId discount line id identifier (required)
* @param updateOrderDiscountLinesRequest requested field for a discount lines (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 DiscountLinesResponse
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
successful
-
401
authentication error
-
404
not found entity
-
422
parameter validation error
-
500
internal server error
-
*/
public DiscountLinesResponse ordersUpdateDiscountLines(String id, String discountLinesId, UpdateOrderDiscountLinesRequest updateOrderDiscountLinesRequest, String acceptLanguage, String xChildCompanyId) throws ApiException {
return ordersUpdateDiscountLinesWithHttpInfo(id, discountLinesId, updateOrderDiscountLinesRequest, acceptLanguage, xChildCompanyId).getData();
}
/**
* Update Discount
* Update an existing discount lines for an existing orden
* @param id Identifier of the resource (required)
* @param discountLinesId discount line id identifier (required)
* @param updateOrderDiscountLinesRequest requested field for a discount lines (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<DiscountLinesResponse>
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
successful
-
401
authentication error
-
404
not found entity
-
422
parameter validation error
-
500
internal server error
-
*/
public ApiResponse ordersUpdateDiscountLinesWithHttpInfo(String id, String discountLinesId, UpdateOrderDiscountLinesRequest updateOrderDiscountLinesRequest, String acceptLanguage, String xChildCompanyId) throws ApiException {
// Check required parameters
if (id == null) {
throw new ApiException(400, "Missing the required parameter 'id' when calling ordersUpdateDiscountLines");
}
if (discountLinesId == null) {
throw new ApiException(400, "Missing the required parameter 'discountLinesId' when calling ordersUpdateDiscountLines");
}
if (updateOrderDiscountLinesRequest == null) {
throw new ApiException(400, "Missing the required parameter 'updateOrderDiscountLinesRequest' when calling ordersUpdateDiscountLines");
}
// Path parameters
String localVarPath = "/orders/{id}/discount_lines/{discount_lines_id}"
.replaceAll("\\{id}", apiClient.escapeString(id))
.replaceAll("\\{discount_lines_id}", apiClient.escapeString(discountLinesId));
// 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("DiscountsApi.ordersUpdateDiscountLines", localVarPath, "PUT", new ArrayList<>(), updateOrderDiscountLinesRequest,
localVarHeaderParams, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType,
localVarAuthNames, localVarReturnType, false);
}
}