dev.vality.swag.payments.api.ContractsApi Maven / Gradle / Ivy
package dev.vality.swag.payments.api;
import dev.vality.swag.payments.ApiClient;
import dev.vality.swag.payments.model.Contract;
import dev.vality.swag.payments.model.ContractAdjustment;
import dev.vality.swag.payments.model.DefaultLogicError;
import dev.vality.swag.payments.model.GeneralError;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.web.client.RestClientException;
import org.springframework.web.client.HttpClientErrorException;
import org.springframework.web.util.UriComponentsBuilder;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.core.io.FileSystemResource;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2022-08-22T08:18:24.176Z")
@Component("dev.vality.swag.payments.api.ContractsApi")
public class ContractsApi {
private ApiClient apiClient;
public ContractsApi() {
this(new ApiClient());
}
@Autowired
public ContractsApi(ApiClient apiClient) {
this.apiClient = apiClient;
}
public ApiClient getApiClient() {
return apiClient;
}
public void setApiClient(ApiClient apiClient) {
this.apiClient = apiClient;
}
/**
*
* Получить данные поправки к договору по её идентификатору
* 200 - Данные поправки к договору
*
400 - Неверные данные
*
401 - Ошибка авторизации
*
404 - Заданный ресурс не найден
* @param xRequestID Уникальный идентификатор запроса к системе
* @param contractID Идентификатор договора
* @param adjustmentID Идентификатор поправки к договору
* @param xRequestDeadline Максимальное время обработки запроса
* @return ContractAdjustment
* @throws RestClientException if an error occurs while attempting to invoke the API
*/
public ContractAdjustment getContractAdjustmentByID(String xRequestID, String contractID, String adjustmentID, String xRequestDeadline) throws RestClientException {
Object postBody = null;
// verify the required parameter 'xRequestID' is set
if (xRequestID == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'xRequestID' when calling getContractAdjustmentByID");
}
// verify the required parameter 'contractID' is set
if (contractID == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'contractID' when calling getContractAdjustmentByID");
}
// verify the required parameter 'adjustmentID' is set
if (adjustmentID == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'adjustmentID' when calling getContractAdjustmentByID");
}
// create path and map variables
final Map uriVariables = new HashMap();
uriVariables.put("contractID", contractID);
uriVariables.put("adjustmentID", adjustmentID);
String path = UriComponentsBuilder.fromPath("/processing/contracts/{contractID}/adjustments/{adjustmentID}").buildAndExpand(uriVariables).toUriString();
final MultiValueMap queryParams = new LinkedMultiValueMap();
final HttpHeaders headerParams = new HttpHeaders();
final MultiValueMap formParams = new LinkedMultiValueMap();
if (xRequestID != null)
headerParams.add("X-Request-ID", apiClient.parameterToString(xRequestID));
if (xRequestDeadline != null)
headerParams.add("X-Request-Deadline", apiClient.parameterToString(xRequestDeadline));
final String[] accepts = {
"application/json; charset=utf-8"
};
final List accept = apiClient.selectHeaderAccept(accepts);
final String[] contentTypes = {
"application/json; charset=utf-8"
};
final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);
String[] authNames = new String[] { "bearer" };
ParameterizedTypeReference returnType = new ParameterizedTypeReference() {};
return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
}
/**
*
* Получить данные поправки к договору по её идентификатору
* 200 - Данные поправки к договору
*
400 - Неверные данные
*
401 - Ошибка авторизации
*
404 - Заданный ресурс не найден
* @param xRequestID Уникальный идентификатор запроса к системе
* @param contractID Идентификатор договора
* @param adjustmentID Идентификатор поправки к договору
* @param partyID Уникальный в рамках системы идентификатор участника.
* @param xRequestDeadline Максимальное время обработки запроса
* @return ContractAdjustment
* @throws RestClientException if an error occurs while attempting to invoke the API
*/
public ContractAdjustment getContractAdjustmentByIDForParty(String xRequestID, String contractID, String adjustmentID, String partyID, String xRequestDeadline) throws RestClientException {
Object postBody = null;
// verify the required parameter 'xRequestID' is set
if (xRequestID == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'xRequestID' when calling getContractAdjustmentByIDForParty");
}
// verify the required parameter 'contractID' is set
if (contractID == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'contractID' when calling getContractAdjustmentByIDForParty");
}
// verify the required parameter 'adjustmentID' is set
if (adjustmentID == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'adjustmentID' when calling getContractAdjustmentByIDForParty");
}
// verify the required parameter 'partyID' is set
if (partyID == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'partyID' when calling getContractAdjustmentByIDForParty");
}
// create path and map variables
final Map uriVariables = new HashMap();
uriVariables.put("contractID", contractID);
uriVariables.put("adjustmentID", adjustmentID);
uriVariables.put("partyID", partyID);
String path = UriComponentsBuilder.fromPath("/processing/parties/{partyID}/contracts/{contractID}/adjustments/{adjustmentID}").buildAndExpand(uriVariables).toUriString();
final MultiValueMap queryParams = new LinkedMultiValueMap();
final HttpHeaders headerParams = new HttpHeaders();
final MultiValueMap formParams = new LinkedMultiValueMap();
if (xRequestID != null)
headerParams.add("X-Request-ID", apiClient.parameterToString(xRequestID));
if (xRequestDeadline != null)
headerParams.add("X-Request-Deadline", apiClient.parameterToString(xRequestDeadline));
final String[] accepts = {
"application/json; charset=utf-8"
};
final List accept = apiClient.selectHeaderAccept(accepts);
final String[] contentTypes = {
"application/json; charset=utf-8"
};
final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);
String[] authNames = new String[] { "bearer" };
ParameterizedTypeReference returnType = new ParameterizedTypeReference() {};
return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
}
/**
*
* Получить данные всех поправок к указанному договору
* 200 - Набор поправок к договору
*
400 - Неверные данные
*
401 - Ошибка авторизации
*
404 - Заданный ресурс не найден
* @param xRequestID Уникальный идентификатор запроса к системе
* @param contractID Идентификатор договора
* @param xRequestDeadline Максимальное время обработки запроса
* @return List<ContractAdjustment>
* @throws RestClientException if an error occurs while attempting to invoke the API
*/
public List getContractAdjustments(String xRequestID, String contractID, String xRequestDeadline) throws RestClientException {
Object postBody = null;
// verify the required parameter 'xRequestID' is set
if (xRequestID == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'xRequestID' when calling getContractAdjustments");
}
// verify the required parameter 'contractID' is set
if (contractID == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'contractID' when calling getContractAdjustments");
}
// create path and map variables
final Map uriVariables = new HashMap();
uriVariables.put("contractID", contractID);
String path = UriComponentsBuilder.fromPath("/processing/contracts/{contractID}/adjustments").buildAndExpand(uriVariables).toUriString();
final MultiValueMap queryParams = new LinkedMultiValueMap();
final HttpHeaders headerParams = new HttpHeaders();
final MultiValueMap formParams = new LinkedMultiValueMap();
if (xRequestID != null)
headerParams.add("X-Request-ID", apiClient.parameterToString(xRequestID));
if (xRequestDeadline != null)
headerParams.add("X-Request-Deadline", apiClient.parameterToString(xRequestDeadline));
final String[] accepts = {
"application/json; charset=utf-8"
};
final List accept = apiClient.selectHeaderAccept(accepts);
final String[] contentTypes = {
"application/json; charset=utf-8"
};
final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);
String[] authNames = new String[] { "bearer" };
ParameterizedTypeReference> returnType = new ParameterizedTypeReference>() {};
return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
}
/**
*
* Получить данные всех поправок к указанному договору
* 200 - Набор поправок к договору
*
400 - Неверные данные
*
401 - Ошибка авторизации
*
404 - Заданный ресурс не найден
* @param xRequestID Уникальный идентификатор запроса к системе
* @param contractID Идентификатор договора
* @param partyID Уникальный в рамках системы идентификатор участника.
* @param xRequestDeadline Максимальное время обработки запроса
* @return List<ContractAdjustment>
* @throws RestClientException if an error occurs while attempting to invoke the API
*/
public List getContractAdjustmentsForParty(String xRequestID, String contractID, String partyID, String xRequestDeadline) throws RestClientException {
Object postBody = null;
// verify the required parameter 'xRequestID' is set
if (xRequestID == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'xRequestID' when calling getContractAdjustmentsForParty");
}
// verify the required parameter 'contractID' is set
if (contractID == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'contractID' when calling getContractAdjustmentsForParty");
}
// verify the required parameter 'partyID' is set
if (partyID == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'partyID' when calling getContractAdjustmentsForParty");
}
// create path and map variables
final Map uriVariables = new HashMap();
uriVariables.put("contractID", contractID);
uriVariables.put("partyID", partyID);
String path = UriComponentsBuilder.fromPath("/processing/parties/{partyID}/contracts/{contractID}/adjustments").buildAndExpand(uriVariables).toUriString();
final MultiValueMap queryParams = new LinkedMultiValueMap();
final HttpHeaders headerParams = new HttpHeaders();
final MultiValueMap formParams = new LinkedMultiValueMap();
if (xRequestID != null)
headerParams.add("X-Request-ID", apiClient.parameterToString(xRequestID));
if (xRequestDeadline != null)
headerParams.add("X-Request-Deadline", apiClient.parameterToString(xRequestDeadline));
final String[] accepts = {
"application/json; charset=utf-8"
};
final List accept = apiClient.selectHeaderAccept(accepts);
final String[] contentTypes = {
"application/json; charset=utf-8"
};
final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);
String[] authNames = new String[] { "bearer" };
ParameterizedTypeReference> returnType = new ParameterizedTypeReference>() {};
return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
}
/**
*
* Получить данные договора по его ID
* 200 - Contract found
*
400 - Неверные данные
*
401 - Ошибка авторизации
*
404 - Заданный ресурс не найден
* @param xRequestID Уникальный идентификатор запроса к системе
* @param contractID Идентификатор договора
* @param xRequestDeadline Максимальное время обработки запроса
* @return Contract
* @throws RestClientException if an error occurs while attempting to invoke the API
*/
public Contract getContractByID(String xRequestID, String contractID, String xRequestDeadline) throws RestClientException {
Object postBody = null;
// verify the required parameter 'xRequestID' is set
if (xRequestID == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'xRequestID' when calling getContractByID");
}
// verify the required parameter 'contractID' is set
if (contractID == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'contractID' when calling getContractByID");
}
// create path and map variables
final Map uriVariables = new HashMap();
uriVariables.put("contractID", contractID);
String path = UriComponentsBuilder.fromPath("/processing/contracts/{contractID}").buildAndExpand(uriVariables).toUriString();
final MultiValueMap queryParams = new LinkedMultiValueMap();
final HttpHeaders headerParams = new HttpHeaders();
final MultiValueMap formParams = new LinkedMultiValueMap();
if (xRequestID != null)
headerParams.add("X-Request-ID", apiClient.parameterToString(xRequestID));
if (xRequestDeadline != null)
headerParams.add("X-Request-Deadline", apiClient.parameterToString(xRequestDeadline));
final String[] accepts = {
"application/json; charset=utf-8"
};
final List accept = apiClient.selectHeaderAccept(accepts);
final String[] contentTypes = {
"application/json; charset=utf-8"
};
final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);
String[] authNames = new String[] { "bearer" };
ParameterizedTypeReference returnType = new ParameterizedTypeReference() {};
return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
}
/**
*
* Получить данные договора по его ID
* 200 - Contract found
*
400 - Неверные данные
*
401 - Ошибка авторизации
*
404 - Заданный ресурс не найден
* @param xRequestID Уникальный идентификатор запроса к системе
* @param contractID Идентификатор договора
* @param partyID Уникальный в рамках системы идентификатор участника.
* @param xRequestDeadline Максимальное время обработки запроса
* @return Contract
* @throws RestClientException if an error occurs while attempting to invoke the API
*/
public Contract getContractByIDForParty(String xRequestID, String contractID, String partyID, String xRequestDeadline) throws RestClientException {
Object postBody = null;
// verify the required parameter 'xRequestID' is set
if (xRequestID == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'xRequestID' when calling getContractByIDForParty");
}
// verify the required parameter 'contractID' is set
if (contractID == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'contractID' when calling getContractByIDForParty");
}
// verify the required parameter 'partyID' is set
if (partyID == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'partyID' when calling getContractByIDForParty");
}
// create path and map variables
final Map uriVariables = new HashMap();
uriVariables.put("contractID", contractID);
uriVariables.put("partyID", partyID);
String path = UriComponentsBuilder.fromPath("/processing/parties/{partyID}/contracts/{contractID}").buildAndExpand(uriVariables).toUriString();
final MultiValueMap queryParams = new LinkedMultiValueMap();
final HttpHeaders headerParams = new HttpHeaders();
final MultiValueMap formParams = new LinkedMultiValueMap();
if (xRequestID != null)
headerParams.add("X-Request-ID", apiClient.parameterToString(xRequestID));
if (xRequestDeadline != null)
headerParams.add("X-Request-Deadline", apiClient.parameterToString(xRequestDeadline));
final String[] accepts = {
"application/json; charset=utf-8"
};
final List accept = apiClient.selectHeaderAccept(accepts);
final String[] contentTypes = {
"application/json; charset=utf-8"
};
final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);
String[] authNames = new String[] { "bearer" };
ParameterizedTypeReference returnType = new ParameterizedTypeReference() {};
return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
}
/**
*
* Получить данные всех договоров участника
* 200 - List of contracts
*
400 - Неверные данные
*
401 - Ошибка авторизации
* @param xRequestID Уникальный идентификатор запроса к системе
* @param xRequestDeadline Максимальное время обработки запроса
* @return List<Contract>
* @throws RestClientException if an error occurs while attempting to invoke the API
*/
public List getContracts(String xRequestID, String xRequestDeadline) throws RestClientException {
Object postBody = null;
// verify the required parameter 'xRequestID' is set
if (xRequestID == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'xRequestID' when calling getContracts");
}
String path = UriComponentsBuilder.fromPath("/processing/contracts").build().toUriString();
final MultiValueMap queryParams = new LinkedMultiValueMap();
final HttpHeaders headerParams = new HttpHeaders();
final MultiValueMap formParams = new LinkedMultiValueMap();
if (xRequestID != null)
headerParams.add("X-Request-ID", apiClient.parameterToString(xRequestID));
if (xRequestDeadline != null)
headerParams.add("X-Request-Deadline", apiClient.parameterToString(xRequestDeadline));
final String[] accepts = {
"application/json; charset=utf-8"
};
final List accept = apiClient.selectHeaderAccept(accepts);
final String[] contentTypes = {
"application/json; charset=utf-8"
};
final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);
String[] authNames = new String[] { "bearer" };
ParameterizedTypeReference> returnType = new ParameterizedTypeReference>() {};
return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
}
/**
*
* Получить данные всех договоров участника
* 200 - List of contracts
*
400 - Неверные данные
*
401 - Ошибка авторизации
*
404 - Заданный ресурс не найден
* @param xRequestID Уникальный идентификатор запроса к системе
* @param partyID Уникальный в рамках системы идентификатор участника.
* @param xRequestDeadline Максимальное время обработки запроса
* @return List<Contract>
* @throws RestClientException if an error occurs while attempting to invoke the API
*/
public List getContractsForParty(String xRequestID, String partyID, String xRequestDeadline) throws RestClientException {
Object postBody = null;
// verify the required parameter 'xRequestID' is set
if (xRequestID == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'xRequestID' when calling getContractsForParty");
}
// verify the required parameter 'partyID' is set
if (partyID == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'partyID' when calling getContractsForParty");
}
// create path and map variables
final Map uriVariables = new HashMap();
uriVariables.put("partyID", partyID);
String path = UriComponentsBuilder.fromPath("/processing/parties/{partyID}/contracts").buildAndExpand(uriVariables).toUriString();
final MultiValueMap queryParams = new LinkedMultiValueMap();
final HttpHeaders headerParams = new HttpHeaders();
final MultiValueMap formParams = new LinkedMultiValueMap();
if (xRequestID != null)
headerParams.add("X-Request-ID", apiClient.parameterToString(xRequestID));
if (xRequestDeadline != null)
headerParams.add("X-Request-Deadline", apiClient.parameterToString(xRequestDeadline));
final String[] accepts = {
"application/json; charset=utf-8"
};
final List accept = apiClient.selectHeaderAccept(accepts);
final String[] contentTypes = {
"application/json; charset=utf-8"
};
final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);
String[] authNames = new String[] { "bearer" };
ParameterizedTypeReference> returnType = new ParameterizedTypeReference>() {};
return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
}
}