dev.vality.swag.payments.api.PaymentInstitutionsApi Maven / Gradle / Ivy
package dev.vality.swag.payments.api;
import dev.vality.swag.payments.ApiClient;
import dev.vality.swag.payments.model.DefaultLogicError;
import dev.vality.swag.payments.model.GeneralError;
import dev.vality.swag.payments.model.PaymentInstitution;
import dev.vality.swag.payments.model.PaymentTerms;
import dev.vality.swag.payments.model.ServiceProvider;
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.PaymentInstitutionsApi")
public class PaymentInstitutionsApi {
private ApiClient apiClient;
public PaymentInstitutionsApi() {
this(new ApiClient());
}
@Autowired
public PaymentInstitutionsApi(ApiClient apiClient) {
this.apiClient = apiClient;
}
public ApiClient getApiClient() {
return apiClient;
}
public void setApiClient(ApiClient apiClient) {
this.apiClient = apiClient;
}
/**
*
* Получить данные платёжной организации по ее ID
* 200 - Payment institution found
*
400 - Неверные данные
*
401 - Ошибка авторизации
*
404 - Заданный ресурс не найден
* @param xRequestID Уникальный идентификатор запроса к системе
* @param paymentInstitutionID Payment institution reference
* @param xRequestDeadline Максимальное время обработки запроса
* @return PaymentInstitution
* @throws RestClientException if an error occurs while attempting to invoke the API
*/
public PaymentInstitution getPaymentInstitutionByRef(String xRequestID, Integer paymentInstitutionID, 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 getPaymentInstitutionByRef");
}
// verify the required parameter 'paymentInstitutionID' is set
if (paymentInstitutionID == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'paymentInstitutionID' when calling getPaymentInstitutionByRef");
}
// create path and map variables
final Map uriVariables = new HashMap();
uriVariables.put("paymentInstitutionID", paymentInstitutionID);
String path = UriComponentsBuilder.fromPath("/processing/payment-institutions/{paymentInstitutionID}").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 - Payment institution terms calculated
*
400 - Неверные данные
*
401 - Ошибка авторизации
*
404 - Заданный ресурс не найден
* @param xRequestID Уникальный идентификатор запроса к системе
* @param paymentInstitutionID Payment institution reference
* @param xRequestDeadline Максимальное время обработки запроса
* @return PaymentTerms
* @throws RestClientException if an error occurs while attempting to invoke the API
*/
public PaymentTerms getPaymentInstitutionPaymentTerms(String xRequestID, Integer paymentInstitutionID, 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 getPaymentInstitutionPaymentTerms");
}
// verify the required parameter 'paymentInstitutionID' is set
if (paymentInstitutionID == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'paymentInstitutionID' when calling getPaymentInstitutionPaymentTerms");
}
// create path and map variables
final Map uriVariables = new HashMap();
uriVariables.put("paymentInstitutionID", paymentInstitutionID);
String path = UriComponentsBuilder.fromPath("/processing/payment-institutions/{paymentInstitutionID}/terms/payments").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);
}
/**
*
* Получить cпособы вывода средств для платёжной организации
* 200 - Способ вывода средств
*
400 - Неверные данные
*
401 - Ошибка авторизации
*
404 - Заданный ресурс не найден
* @param xRequestID Уникальный идентификатор запроса к системе
* @param paymentInstitutionID Payment institution reference
* @param xRequestDeadline Максимальное время обработки запроса
* @param currency Валюта, символьный код согласно [ISO 4217](http://www.iso.org/iso/home/standards/currency_codes.htm).
* @return List<String>
* @throws RestClientException if an error occurs while attempting to invoke the API
*/
public List getPaymentInstitutionPayoutMethods(String xRequestID, Integer paymentInstitutionID, String xRequestDeadline, String currency) 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 getPaymentInstitutionPayoutMethods");
}
// verify the required parameter 'paymentInstitutionID' is set
if (paymentInstitutionID == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'paymentInstitutionID' when calling getPaymentInstitutionPayoutMethods");
}
// create path and map variables
final Map uriVariables = new HashMap();
uriVariables.put("paymentInstitutionID", paymentInstitutionID);
String path = UriComponentsBuilder.fromPath("/processing/payment-institutions/{paymentInstitutionID}/terms/payouts/methods").buildAndExpand(uriVariables).toUriString();
final MultiValueMap queryParams = new LinkedMultiValueMap();
final HttpHeaders headerParams = new HttpHeaders();
final MultiValueMap formParams = new LinkedMultiValueMap();
queryParams.putAll(apiClient.parameterToMultiValueMap(null, "currency", currency));
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 paymentInstitutionID Payment institution reference
* @param xRequestDeadline Максимальное время обработки запроса
* @param currency Валюта, символьный код согласно [ISO 4217](http://www.iso.org/iso/home/standards/currency_codes.htm).
* @param payoutMethod Способ вывода средств
* @return List<Integer>
* @throws RestClientException if an error occurs while attempting to invoke the API
*/
public List getPaymentInstitutionPayoutSchedules(String xRequestID, Integer paymentInstitutionID, String xRequestDeadline, String currency, String payoutMethod) 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 getPaymentInstitutionPayoutSchedules");
}
// verify the required parameter 'paymentInstitutionID' is set
if (paymentInstitutionID == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'paymentInstitutionID' when calling getPaymentInstitutionPayoutSchedules");
}
// create path and map variables
final Map uriVariables = new HashMap();
uriVariables.put("paymentInstitutionID", paymentInstitutionID);
String path = UriComponentsBuilder.fromPath("/processing/payment-institutions/{paymentInstitutionID}/terms/payouts/schedules").buildAndExpand(uriVariables).toUriString();
final MultiValueMap queryParams = new LinkedMultiValueMap();
final HttpHeaders headerParams = new HttpHeaders();
final MultiValueMap formParams = new LinkedMultiValueMap();
queryParams.putAll(apiClient.parameterToMultiValueMap(null, "currency", currency));
queryParams.putAll(apiClient.parameterToMultiValueMap(null, "payoutMethod", payoutMethod));
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 payment institutions
*
400 - Неверные данные
*
401 - Ошибка авторизации
* @param xRequestID Уникальный идентификатор запроса к системе
* @param xRequestDeadline Максимальное время обработки запроса
* @param residence Резиденция, alpha-3 код по стандарту [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1)
* @param realm Режим рабочего окружения платежной организации
* @return List<PaymentInstitution>
* @throws RestClientException if an error occurs while attempting to invoke the API
*/
public List getPaymentInstitutions(String xRequestID, String xRequestDeadline, String residence, String realm) 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 getPaymentInstitutions");
}
String path = UriComponentsBuilder.fromPath("/processing/payment-institutions").build().toUriString();
final MultiValueMap queryParams = new LinkedMultiValueMap();
final HttpHeaders headerParams = new HttpHeaders();
final MultiValueMap formParams = new LinkedMultiValueMap();
queryParams.putAll(apiClient.parameterToMultiValueMap(null, "residence", residence));
queryParams.putAll(apiClient.parameterToMultiValueMap(null, "realm", realm));
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 - Провайдер платёжных сервисов найден
*
400 - Неверные данные
*
404 - Заданный ресурс не найден
* @param xRequestID Уникальный идентификатор запроса к системе
* @param serviceProviderID Идентификатор провайдера платёжных сервисов в системе
* @param xRequestDeadline Максимальное время обработки запроса
* @return ServiceProvider
* @throws RestClientException if an error occurs while attempting to invoke the API
*/
public ServiceProvider getServiceProviderByID(String xRequestID, String serviceProviderID, 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 getServiceProviderByID");
}
// verify the required parameter 'serviceProviderID' is set
if (serviceProviderID == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'serviceProviderID' when calling getServiceProviderByID");
}
// create path and map variables
final Map uriVariables = new HashMap();
uriVariables.put("serviceProviderID", serviceProviderID);
String path = UriComponentsBuilder.fromPath("/processing/service-providers/{serviceProviderID}").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);
}
}