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.ShippingOrderResponse;
import com.conekta.model.ShippingRequest;
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 ShippingsApi {
private ApiClient apiClient;
public ShippingsApi() {
this(Configuration.getDefaultApiClient());
}
public ShippingsApi(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 Shipping
* Create new shipping for an existing orden
* @param id Identifier of the resource (required)
* @param shippingRequest requested field for a shipping (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 ShippingOrderResponse
* @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 ShippingOrderResponse ordersCreateShipping(String id, ShippingRequest shippingRequest, String acceptLanguage, String xChildCompanyId) throws ApiException {
return ordersCreateShippingWithHttpInfo(id, shippingRequest, acceptLanguage, xChildCompanyId).getData();
}
/**
* Create Shipping
* Create new shipping for an existing orden
* @param id Identifier of the resource (required)
* @param shippingRequest requested field for a shipping (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<ShippingOrderResponse>
* @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 ordersCreateShippingWithHttpInfo(String id, ShippingRequest shippingRequest, String acceptLanguage, String xChildCompanyId) throws ApiException {
// Check required parameters
if (id == null) {
throw new ApiException(400, "Missing the required parameter 'id' when calling ordersCreateShipping");
}
if (shippingRequest == null) {
throw new ApiException(400, "Missing the required parameter 'shippingRequest' when calling ordersCreateShipping");
}
// Path parameters
String localVarPath = "/orders/{id}/shipping_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("ShippingsApi.ordersCreateShipping", localVarPath, "POST", new ArrayList<>(), shippingRequest,
localVarHeaderParams, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType,
localVarAuthNames, localVarReturnType, false);
}
/**
* Delete Shipping
* Delete shipping
* @param id Identifier of the resource (required)
* @param shippingId 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 ShippingOrderResponse
* @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
-
428
Precondition Required
-
500
internal server error
-
*/
public ShippingOrderResponse ordersDeleteShipping(String id, String shippingId, String acceptLanguage, String xChildCompanyId) throws ApiException {
return ordersDeleteShippingWithHttpInfo(id, shippingId, acceptLanguage, xChildCompanyId).getData();
}
/**
* Delete Shipping
* Delete shipping
* @param id Identifier of the resource (required)
* @param shippingId 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<ShippingOrderResponse>
* @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
-
428
Precondition Required
-
500
internal server error
-
*/
public ApiResponse ordersDeleteShippingWithHttpInfo(String id, String shippingId, String acceptLanguage, String xChildCompanyId) throws ApiException {
// Check required parameters
if (id == null) {
throw new ApiException(400, "Missing the required parameter 'id' when calling ordersDeleteShipping");
}
if (shippingId == null) {
throw new ApiException(400, "Missing the required parameter 'shippingId' when calling ordersDeleteShipping");
}
// Path parameters
String localVarPath = "/orders/{id}/shipping_lines/{shipping_id}"
.replaceAll("\\{id}", apiClient.escapeString(id))
.replaceAll("\\{shipping_id}", apiClient.escapeString(shippingId));
// 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("ShippingsApi.ordersDeleteShipping", localVarPath, "DELETE", new ArrayList<>(), null,
localVarHeaderParams, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType,
localVarAuthNames, localVarReturnType, false);
}
/**
* Update Shipping
* Update existing shipping for an existing orden
* @param id Identifier of the resource (required)
* @param shippingId identifier (required)
* @param shippingRequest requested field for a shipping (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 ShippingOrderResponse
* @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 ShippingOrderResponse ordersUpdateShipping(String id, String shippingId, ShippingRequest shippingRequest, String acceptLanguage, String xChildCompanyId) throws ApiException {
return ordersUpdateShippingWithHttpInfo(id, shippingId, shippingRequest, acceptLanguage, xChildCompanyId).getData();
}
/**
* Update Shipping
* Update existing shipping for an existing orden
* @param id Identifier of the resource (required)
* @param shippingId identifier (required)
* @param shippingRequest requested field for a shipping (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<ShippingOrderResponse>
* @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 ordersUpdateShippingWithHttpInfo(String id, String shippingId, ShippingRequest shippingRequest, String acceptLanguage, String xChildCompanyId) throws ApiException {
// Check required parameters
if (id == null) {
throw new ApiException(400, "Missing the required parameter 'id' when calling ordersUpdateShipping");
}
if (shippingId == null) {
throw new ApiException(400, "Missing the required parameter 'shippingId' when calling ordersUpdateShipping");
}
if (shippingRequest == null) {
throw new ApiException(400, "Missing the required parameter 'shippingRequest' when calling ordersUpdateShipping");
}
// Path parameters
String localVarPath = "/orders/{id}/shipping_lines/{shipping_id}"
.replaceAll("\\{id}", apiClient.escapeString(id))
.replaceAll("\\{shipping_id}", apiClient.escapeString(shippingId));
// 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("ShippingsApi.ordersUpdateShipping", localVarPath, "PUT", new ArrayList<>(), shippingRequest,
localVarHeaderParams, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType,
localVarAuthNames, localVarReturnType, false);
}
}