Skip to content

Commit

Permalink
feat: synchronize generated sources from OAS file
Browse files Browse the repository at this point in the history
  • Loading branch information
JPPortier committed Nov 21, 2023
1 parent 498830c commit aeb7a3a
Show file tree
Hide file tree
Showing 8 changed files with 149 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import com.fasterxml.jackson.core.type.TypeReference;
import com.sinch.sdk.core.exceptions.ApiException;
import com.sinch.sdk.core.exceptions.ApiExceptionBuilder;
import com.sinch.sdk.core.http.AuthManager;
import com.sinch.sdk.core.http.HttpClient;
import com.sinch.sdk.core.http.HttpMapper;
import com.sinch.sdk.core.http.HttpMethod;
Expand All @@ -41,12 +42,17 @@ public class ActiveNumberApi {
private static final Logger LOGGER = Logger.getLogger(ActiveNumberApi.class.getName());
private HttpClient httpClient;
private ServerConfiguration serverConfiguration;
private Map<String, AuthManager> authManagersByOasSecuritySchemes;
private HttpMapper mapper;

public ActiveNumberApi(
HttpClient httpClient, ServerConfiguration serverConfiguration, HttpMapper mapper) {
HttpClient httpClient,
ServerConfiguration serverConfiguration,
Map<String, AuthManager> authManagersByOasSecuritySchemes,
HttpMapper mapper) {
this.httpClient = httpClient;
this.serverConfiguration = serverConfiguration;
this.authManagersByOasSecuritySchemes = authManagersByOasSecuritySchemes;
this.mapper = mapper;
}

Expand Down Expand Up @@ -75,7 +81,9 @@ public ActiveNumberDto numberServiceGetActiveNumber(String projectId, String pho
+ phoneNumber);

HttpRequest httpRequest = numberServiceGetActiveNumberRequestBuilder(projectId, phoneNumber);
HttpResponse response = httpClient.invokeAPI(this.serverConfiguration, httpRequest);
HttpResponse response =
httpClient.invokeAPI(
this.serverConfiguration, this.authManagersByOasSecuritySchemes, httpRequest);

if (HttpStatus.isSuccessfulStatus(response.getCode())) {
TypeReference<ActiveNumberDto> localVarReturnType = new TypeReference<ActiveNumberDto>() {};
Expand Down Expand Up @@ -212,7 +220,9 @@ public ActiveNumbersResponseDto numberServiceListActiveNumbers(
pageSize,
pageToken,
orderBy);
HttpResponse response = httpClient.invokeAPI(this.serverConfiguration, httpRequest);
HttpResponse response =
httpClient.invokeAPI(
this.serverConfiguration, this.authManagersByOasSecuritySchemes, httpRequest);

if (HttpStatus.isSuccessfulStatus(response.getCode())) {
TypeReference<ActiveNumbersResponseDto> localVarReturnType =
Expand Down Expand Up @@ -356,7 +366,9 @@ public ActiveNumberDto numberServiceReleaseNumber(String projectId, String phone
+ phoneNumber);

HttpRequest httpRequest = numberServiceReleaseNumberRequestBuilder(projectId, phoneNumber);
HttpResponse response = httpClient.invokeAPI(this.serverConfiguration, httpRequest);
HttpResponse response =
httpClient.invokeAPI(
this.serverConfiguration, this.authManagersByOasSecuritySchemes, httpRequest);

if (HttpStatus.isSuccessfulStatus(response.getCode())) {
TypeReference<ActiveNumberDto> localVarReturnType = new TypeReference<ActiveNumberDto>() {};
Expand Down Expand Up @@ -451,7 +463,9 @@ public ActiveNumberDto numberServiceUpdateActiveNumber(
HttpRequest httpRequest =
numberServiceUpdateActiveNumberRequestBuilder(
projectId, phoneNumber, activeNumberRequestDto);
HttpResponse response = httpClient.invokeAPI(this.serverConfiguration, httpRequest);
HttpResponse response =
httpClient.invokeAPI(
this.serverConfiguration, this.authManagersByOasSecuritySchemes, httpRequest);

if (HttpStatus.isSuccessfulStatus(response.getCode())) {
TypeReference<ActiveNumberDto> localVarReturnType = new TypeReference<ActiveNumberDto>() {};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import com.fasterxml.jackson.core.type.TypeReference;
import com.sinch.sdk.core.exceptions.ApiException;
import com.sinch.sdk.core.exceptions.ApiExceptionBuilder;
import com.sinch.sdk.core.http.AuthManager;
import com.sinch.sdk.core.http.HttpClient;
import com.sinch.sdk.core.http.HttpMapper;
import com.sinch.sdk.core.http.HttpMethod;
Expand Down Expand Up @@ -43,12 +44,17 @@ public class AvailableNumberApi {
private static final Logger LOGGER = Logger.getLogger(AvailableNumberApi.class.getName());
private HttpClient httpClient;
private ServerConfiguration serverConfiguration;
private Map<String, AuthManager> authManagersByOasSecuritySchemes;
private HttpMapper mapper;

public AvailableNumberApi(
HttpClient httpClient, ServerConfiguration serverConfiguration, HttpMapper mapper) {
HttpClient httpClient,
ServerConfiguration serverConfiguration,
Map<String, AuthManager> authManagersByOasSecuritySchemes,
HttpMapper mapper) {
this.httpClient = httpClient;
this.serverConfiguration = serverConfiguration;
this.authManagersByOasSecuritySchemes = authManagersByOasSecuritySchemes;
this.mapper = mapper;
}

Expand Down Expand Up @@ -79,7 +85,9 @@ public AvailableNumberDto numberServiceGetAvailableNumber(String projectId, Stri
+ phoneNumber);

HttpRequest httpRequest = numberServiceGetAvailableNumberRequestBuilder(projectId, phoneNumber);
HttpResponse response = httpClient.invokeAPI(this.serverConfiguration, httpRequest);
HttpResponse response =
httpClient.invokeAPI(
this.serverConfiguration, this.authManagersByOasSecuritySchemes, httpRequest);

if (HttpStatus.isSuccessfulStatus(response.getCode())) {
TypeReference<AvailableNumberDto> localVarReturnType =
Expand Down Expand Up @@ -208,7 +216,9 @@ public AvailableNumbersResponseDto numberServiceListAvailableNumbers(
numberPatternSearchPattern,
capabilities,
size);
HttpResponse response = httpClient.invokeAPI(this.serverConfiguration, httpRequest);
HttpResponse response =
httpClient.invokeAPI(
this.serverConfiguration, this.authManagersByOasSecuritySchemes, httpRequest);

if (HttpStatus.isSuccessfulStatus(response.getCode())) {
TypeReference<AvailableNumbersResponseDto> localVarReturnType =
Expand Down Expand Up @@ -343,7 +353,9 @@ public ActiveNumberDto numberServiceRentAnyNumber(

HttpRequest httpRequest =
numberServiceRentAnyNumberRequestBuilder(projectId, rentAnyNumberRequestDto);
HttpResponse response = httpClient.invokeAPI(this.serverConfiguration, httpRequest);
HttpResponse response =
httpClient.invokeAPI(
this.serverConfiguration, this.authManagersByOasSecuritySchemes, httpRequest);

if (HttpStatus.isSuccessfulStatus(response.getCode())) {
TypeReference<ActiveNumberDto> localVarReturnType = new TypeReference<ActiveNumberDto>() {};
Expand Down Expand Up @@ -434,7 +446,9 @@ public ActiveNumberDto numberServiceRentNumber(

HttpRequest httpRequest =
numberServiceRentNumberRequestBuilder(projectId, phoneNumber, rentNumberRequestDto);
HttpResponse response = httpClient.invokeAPI(this.serverConfiguration, httpRequest);
HttpResponse response =
httpClient.invokeAPI(
this.serverConfiguration, this.authManagersByOasSecuritySchemes, httpRequest);

if (HttpStatus.isSuccessfulStatus(response.getCode())) {
TypeReference<ActiveNumberDto> localVarReturnType = new TypeReference<ActiveNumberDto>() {};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import com.fasterxml.jackson.core.type.TypeReference;
import com.sinch.sdk.core.exceptions.ApiException;
import com.sinch.sdk.core.exceptions.ApiExceptionBuilder;
import com.sinch.sdk.core.http.AuthManager;
import com.sinch.sdk.core.http.HttpClient;
import com.sinch.sdk.core.http.HttpMapper;
import com.sinch.sdk.core.http.HttpMethod;
Expand All @@ -39,12 +40,17 @@ public class AvailableRegionsApi {
private static final Logger LOGGER = Logger.getLogger(AvailableRegionsApi.class.getName());
private HttpClient httpClient;
private ServerConfiguration serverConfiguration;
private Map<String, AuthManager> authManagersByOasSecuritySchemes;
private HttpMapper mapper;

public AvailableRegionsApi(
HttpClient httpClient, ServerConfiguration serverConfiguration, HttpMapper mapper) {
HttpClient httpClient,
ServerConfiguration serverConfiguration,
Map<String, AuthManager> authManagersByOasSecuritySchemes,
HttpMapper mapper) {
this.httpClient = httpClient;
this.serverConfiguration = serverConfiguration;
this.authManagersByOasSecuritySchemes = authManagersByOasSecuritySchemes;
this.mapper = mapper;
}

Expand Down Expand Up @@ -75,7 +81,9 @@ public ListAvailableRegionsResponseDto numberServiceListAvailableRegions(
+ types);

HttpRequest httpRequest = numberServiceListAvailableRegionsRequestBuilder(projectId, types);
HttpResponse response = httpClient.invokeAPI(this.serverConfiguration, httpRequest);
HttpResponse response =
httpClient.invokeAPI(
this.serverConfiguration, this.authManagersByOasSecuritySchemes, httpRequest);

if (HttpStatus.isSuccessfulStatus(response.getCode())) {
TypeReference<ListAvailableRegionsResponseDto> localVarReturnType =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import com.fasterxml.jackson.core.type.TypeReference;
import com.sinch.sdk.core.exceptions.ApiException;
import com.sinch.sdk.core.exceptions.ApiExceptionBuilder;
import com.sinch.sdk.core.http.AuthManager;
import com.sinch.sdk.core.http.HttpClient;
import com.sinch.sdk.core.http.HttpMapper;
import com.sinch.sdk.core.http.HttpMethod;
Expand All @@ -40,12 +41,17 @@ public class CallbackConfigurationApi {
private static final Logger LOGGER = Logger.getLogger(CallbackConfigurationApi.class.getName());
private HttpClient httpClient;
private ServerConfiguration serverConfiguration;
private Map<String, AuthManager> authManagersByOasSecuritySchemes;
private HttpMapper mapper;

public CallbackConfigurationApi(
HttpClient httpClient, ServerConfiguration serverConfiguration, HttpMapper mapper) {
HttpClient httpClient,
ServerConfiguration serverConfiguration,
Map<String, AuthManager> authManagersByOasSecuritySchemes,
HttpMapper mapper) {
this.httpClient = httpClient;
this.serverConfiguration = serverConfiguration;
this.authManagersByOasSecuritySchemes = authManagersByOasSecuritySchemes;
this.mapper = mapper;
}

Expand All @@ -63,7 +69,9 @@ public CallbackConfigurationDto getCallbackConfiguration(String projectId) throw
LOGGER.finest("[getCallbackConfiguration] " + "projectId: " + projectId);

HttpRequest httpRequest = getCallbackConfigurationRequestBuilder(projectId);
HttpResponse response = httpClient.invokeAPI(this.serverConfiguration, httpRequest);
HttpResponse response =
httpClient.invokeAPI(
this.serverConfiguration, this.authManagersByOasSecuritySchemes, httpRequest);

if (HttpStatus.isSuccessfulStatus(response.getCode())) {
TypeReference<CallbackConfigurationDto> localVarReturnType =
Expand Down Expand Up @@ -138,7 +146,9 @@ public CallbackConfigurationDto updateCallbackConfiguration(

HttpRequest httpRequest =
updateCallbackConfigurationRequestBuilder(projectId, callbackConfigurationUpdateDto);
HttpResponse response = httpClient.invokeAPI(this.serverConfiguration, httpRequest);
HttpResponse response =
httpClient.invokeAPI(
this.serverConfiguration, this.authManagersByOasSecuritySchemes, httpRequest);

if (HttpStatus.isSuccessfulStatus(response.getCode())) {
TypeReference<CallbackConfigurationDto> localVarReturnType =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import com.fasterxml.jackson.core.type.TypeReference;
import com.sinch.sdk.core.exceptions.ApiException;
import com.sinch.sdk.core.exceptions.ApiExceptionBuilder;
import com.sinch.sdk.core.http.AuthManager;
import com.sinch.sdk.core.http.HttpClient;
import com.sinch.sdk.core.http.HttpMapper;
import com.sinch.sdk.core.http.HttpMethod;
Expand Down Expand Up @@ -44,12 +45,17 @@ public class BatchesApi {
private static final Logger LOGGER = Logger.getLogger(BatchesApi.class.getName());
private HttpClient httpClient;
private ServerConfiguration serverConfiguration;
private Map<String, AuthManager> authManagersByOasSecuritySchemes;
private HttpMapper mapper;

public BatchesApi(
HttpClient httpClient, ServerConfiguration serverConfiguration, HttpMapper mapper) {
HttpClient httpClient,
ServerConfiguration serverConfiguration,
Map<String, AuthManager> authManagersByOasSecuritySchemes,
HttpMapper mapper) {
this.httpClient = httpClient;
this.serverConfiguration = serverConfiguration;
this.authManagersByOasSecuritySchemes = authManagersByOasSecuritySchemes;
this.mapper = mapper;
}

Expand All @@ -74,7 +80,9 @@ public SendSMS201ResponseDto cancelBatchMessage(String servicePlanId, String bat
"[cancelBatchMessage] " + "servicePlanId: " + servicePlanId + ", " + "batchId: " + batchId);

HttpRequest httpRequest = cancelBatchMessageRequestBuilder(servicePlanId, batchId);
HttpResponse response = httpClient.invokeAPI(this.serverConfiguration, httpRequest);
HttpResponse response =
httpClient.invokeAPI(
this.serverConfiguration, this.authManagersByOasSecuritySchemes, httpRequest);

if (HttpStatus.isSuccessfulStatus(response.getCode())) {
TypeReference<SendSMS201ResponseDto> localVarReturnType =
Expand Down Expand Up @@ -167,7 +175,9 @@ public void deliveryFeedback(

HttpRequest httpRequest =
deliveryFeedbackRequestBuilder(servicePlanId, batchId, apiDeliveryFeedbackDto);
HttpResponse response = httpClient.invokeAPI(this.serverConfiguration, httpRequest);
HttpResponse response =
httpClient.invokeAPI(
this.serverConfiguration, this.authManagersByOasSecuritySchemes, httpRequest);

if (HttpStatus.isSuccessfulStatus(response.getCode())) {
return;
Expand Down Expand Up @@ -267,7 +277,9 @@ public DryRun200ResponseDto dryRun(

HttpRequest httpRequest =
dryRunRequestBuilder(servicePlanId, perRecipient, numberOfRecipients, sendSMSRequestDto);
HttpResponse response = httpClient.invokeAPI(this.serverConfiguration, httpRequest);
HttpResponse response =
httpClient.invokeAPI(
this.serverConfiguration, this.authManagersByOasSecuritySchemes, httpRequest);

if (HttpStatus.isSuccessfulStatus(response.getCode())) {
TypeReference<DryRun200ResponseDto> localVarReturnType =
Expand Down Expand Up @@ -354,7 +366,9 @@ public SendSMS201ResponseDto getBatchMessage(String servicePlanId, String batchI
"[getBatchMessage] " + "servicePlanId: " + servicePlanId + ", " + "batchId: " + batchId);

HttpRequest httpRequest = getBatchMessageRequestBuilder(servicePlanId, batchId);
HttpResponse response = httpClient.invokeAPI(this.serverConfiguration, httpRequest);
HttpResponse response =
httpClient.invokeAPI(
this.serverConfiguration, this.authManagersByOasSecuritySchemes, httpRequest);

if (HttpStatus.isSuccessfulStatus(response.getCode())) {
TypeReference<SendSMS201ResponseDto> localVarReturnType =
Expand Down Expand Up @@ -469,7 +483,9 @@ public ApiBatchListDto listBatches(
HttpRequest httpRequest =
listBatchesRequestBuilder(
servicePlanId, page, pageSize, from, startDate, endDate, clientReference);
HttpResponse response = httpClient.invokeAPI(this.serverConfiguration, httpRequest);
HttpResponse response =
httpClient.invokeAPI(
this.serverConfiguration, this.authManagersByOasSecuritySchemes, httpRequest);

if (HttpStatus.isSuccessfulStatus(response.getCode())) {
TypeReference<ApiBatchListDto> localVarReturnType = new TypeReference<ApiBatchListDto>() {};
Expand Down Expand Up @@ -584,7 +600,9 @@ public SendSMS201ResponseDto replaceBatch(
+ sendSMSRequestDto);

HttpRequest httpRequest = replaceBatchRequestBuilder(servicePlanId, batchId, sendSMSRequestDto);
HttpResponse response = httpClient.invokeAPI(this.serverConfiguration, httpRequest);
HttpResponse response =
httpClient.invokeAPI(
this.serverConfiguration, this.authManagersByOasSecuritySchemes, httpRequest);

if (HttpStatus.isSuccessfulStatus(response.getCode())) {
TypeReference<SendSMS201ResponseDto> localVarReturnType =
Expand Down Expand Up @@ -670,7 +688,9 @@ public SendSMS201ResponseDto sendSMS(String servicePlanId, SendSMSRequestDto sen
+ sendSMSRequestDto);

HttpRequest httpRequest = sendSMSRequestBuilder(servicePlanId, sendSMSRequestDto);
HttpResponse response = httpClient.invokeAPI(this.serverConfiguration, httpRequest);
HttpResponse response =
httpClient.invokeAPI(
this.serverConfiguration, this.authManagersByOasSecuritySchemes, httpRequest);

if (HttpStatus.isSuccessfulStatus(response.getCode())) {
TypeReference<SendSMS201ResponseDto> localVarReturnType =
Expand Down Expand Up @@ -751,7 +771,9 @@ public SendSMS201ResponseDto updateBatchMessage(

HttpRequest httpRequest =
updateBatchMessageRequestBuilder(servicePlanId, batchId, updateBatchMessageRequestDto);
HttpResponse response = httpClient.invokeAPI(this.serverConfiguration, httpRequest);
HttpResponse response =
httpClient.invokeAPI(
this.serverConfiguration, this.authManagersByOasSecuritySchemes, httpRequest);

if (HttpStatus.isSuccessfulStatus(response.getCode())) {
TypeReference<SendSMS201ResponseDto> localVarReturnType =
Expand Down
Loading

0 comments on commit aeb7a3a

Please sign in to comment.