From ce06243c8cca59063c768ca1fd0e2ffc95e2d1fd Mon Sep 17 00:00:00 2001 From: Jean-Pierre Portier Date: Tue, 21 Nov 2023 16:40:25 +0100 Subject: [PATCH] feat: synchronize generated sources from OAS file --- .../adapters/api/v1/ActiveNumberApi.java | 24 ++++++++--- .../adapters/api/v1/AvailableNumberApi.java | 24 ++++++++--- .../adapters/api/v1/AvailableRegionsApi.java | 12 +++++- .../api/v1/CallbackConfigurationApi.java | 16 ++++++-- .../sms/adapters/api/v1/BatchesApi.java | 40 ++++++++++++++----- .../adapters/api/v1/DeliveryReportsApi.java | 20 ++++++++-- .../sms/adapters/api/v1/GroupsApi.java | 36 +++++++++++++---- .../sms/adapters/api/v1/InboundsApi.java | 16 ++++++-- 8 files changed, 149 insertions(+), 39 deletions(-) diff --git a/openapi-contracts/src/main/com/sinch/sdk/domains/numbers/adapters/api/v1/ActiveNumberApi.java b/openapi-contracts/src/main/com/sinch/sdk/domains/numbers/adapters/api/v1/ActiveNumberApi.java index a381369e..b4495ea2 100644 --- a/openapi-contracts/src/main/com/sinch/sdk/domains/numbers/adapters/api/v1/ActiveNumberApi.java +++ b/openapi-contracts/src/main/com/sinch/sdk/domains/numbers/adapters/api/v1/ActiveNumberApi.java @@ -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; @@ -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 authManagersByOasSecuritySchemes; private HttpMapper mapper; public ActiveNumberApi( - HttpClient httpClient, ServerConfiguration serverConfiguration, HttpMapper mapper) { + HttpClient httpClient, + ServerConfiguration serverConfiguration, + Map authManagersByOasSecuritySchemes, + HttpMapper mapper) { this.httpClient = httpClient; this.serverConfiguration = serverConfiguration; + this.authManagersByOasSecuritySchemes = authManagersByOasSecuritySchemes; this.mapper = mapper; } @@ -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 localVarReturnType = new TypeReference() {}; @@ -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 localVarReturnType = @@ -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 localVarReturnType = new TypeReference() {}; @@ -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 localVarReturnType = new TypeReference() {}; diff --git a/openapi-contracts/src/main/com/sinch/sdk/domains/numbers/adapters/api/v1/AvailableNumberApi.java b/openapi-contracts/src/main/com/sinch/sdk/domains/numbers/adapters/api/v1/AvailableNumberApi.java index 5e726f75..40674927 100644 --- a/openapi-contracts/src/main/com/sinch/sdk/domains/numbers/adapters/api/v1/AvailableNumberApi.java +++ b/openapi-contracts/src/main/com/sinch/sdk/domains/numbers/adapters/api/v1/AvailableNumberApi.java @@ -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; @@ -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 authManagersByOasSecuritySchemes; private HttpMapper mapper; public AvailableNumberApi( - HttpClient httpClient, ServerConfiguration serverConfiguration, HttpMapper mapper) { + HttpClient httpClient, + ServerConfiguration serverConfiguration, + Map authManagersByOasSecuritySchemes, + HttpMapper mapper) { this.httpClient = httpClient; this.serverConfiguration = serverConfiguration; + this.authManagersByOasSecuritySchemes = authManagersByOasSecuritySchemes; this.mapper = mapper; } @@ -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 localVarReturnType = @@ -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 localVarReturnType = @@ -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 localVarReturnType = new TypeReference() {}; @@ -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 localVarReturnType = new TypeReference() {}; diff --git a/openapi-contracts/src/main/com/sinch/sdk/domains/numbers/adapters/api/v1/AvailableRegionsApi.java b/openapi-contracts/src/main/com/sinch/sdk/domains/numbers/adapters/api/v1/AvailableRegionsApi.java index 8fe90f51..6ce73532 100644 --- a/openapi-contracts/src/main/com/sinch/sdk/domains/numbers/adapters/api/v1/AvailableRegionsApi.java +++ b/openapi-contracts/src/main/com/sinch/sdk/domains/numbers/adapters/api/v1/AvailableRegionsApi.java @@ -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; @@ -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 authManagersByOasSecuritySchemes; private HttpMapper mapper; public AvailableRegionsApi( - HttpClient httpClient, ServerConfiguration serverConfiguration, HttpMapper mapper) { + HttpClient httpClient, + ServerConfiguration serverConfiguration, + Map authManagersByOasSecuritySchemes, + HttpMapper mapper) { this.httpClient = httpClient; this.serverConfiguration = serverConfiguration; + this.authManagersByOasSecuritySchemes = authManagersByOasSecuritySchemes; this.mapper = mapper; } @@ -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 localVarReturnType = diff --git a/openapi-contracts/src/main/com/sinch/sdk/domains/numbers/adapters/api/v1/CallbackConfigurationApi.java b/openapi-contracts/src/main/com/sinch/sdk/domains/numbers/adapters/api/v1/CallbackConfigurationApi.java index c5e6af56..120d64dc 100644 --- a/openapi-contracts/src/main/com/sinch/sdk/domains/numbers/adapters/api/v1/CallbackConfigurationApi.java +++ b/openapi-contracts/src/main/com/sinch/sdk/domains/numbers/adapters/api/v1/CallbackConfigurationApi.java @@ -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; @@ -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 authManagersByOasSecuritySchemes; private HttpMapper mapper; public CallbackConfigurationApi( - HttpClient httpClient, ServerConfiguration serverConfiguration, HttpMapper mapper) { + HttpClient httpClient, + ServerConfiguration serverConfiguration, + Map authManagersByOasSecuritySchemes, + HttpMapper mapper) { this.httpClient = httpClient; this.serverConfiguration = serverConfiguration; + this.authManagersByOasSecuritySchemes = authManagersByOasSecuritySchemes; this.mapper = mapper; } @@ -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 localVarReturnType = @@ -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 localVarReturnType = diff --git a/openapi-contracts/src/main/com/sinch/sdk/domains/sms/adapters/api/v1/BatchesApi.java b/openapi-contracts/src/main/com/sinch/sdk/domains/sms/adapters/api/v1/BatchesApi.java index d8fed58f..266bdc50 100644 --- a/openapi-contracts/src/main/com/sinch/sdk/domains/sms/adapters/api/v1/BatchesApi.java +++ b/openapi-contracts/src/main/com/sinch/sdk/domains/sms/adapters/api/v1/BatchesApi.java @@ -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; @@ -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 authManagersByOasSecuritySchemes; private HttpMapper mapper; public BatchesApi( - HttpClient httpClient, ServerConfiguration serverConfiguration, HttpMapper mapper) { + HttpClient httpClient, + ServerConfiguration serverConfiguration, + Map authManagersByOasSecuritySchemes, + HttpMapper mapper) { this.httpClient = httpClient; this.serverConfiguration = serverConfiguration; + this.authManagersByOasSecuritySchemes = authManagersByOasSecuritySchemes; this.mapper = mapper; } @@ -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 localVarReturnType = @@ -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; @@ -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 localVarReturnType = @@ -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 localVarReturnType = @@ -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 localVarReturnType = new TypeReference() {}; @@ -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 localVarReturnType = @@ -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 localVarReturnType = @@ -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 localVarReturnType = diff --git a/openapi-contracts/src/main/com/sinch/sdk/domains/sms/adapters/api/v1/DeliveryReportsApi.java b/openapi-contracts/src/main/com/sinch/sdk/domains/sms/adapters/api/v1/DeliveryReportsApi.java index 050f5334..df92a507 100644 --- a/openapi-contracts/src/main/com/sinch/sdk/domains/sms/adapters/api/v1/DeliveryReportsApi.java +++ b/openapi-contracts/src/main/com/sinch/sdk/domains/sms/adapters/api/v1/DeliveryReportsApi.java @@ -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; @@ -41,12 +42,17 @@ public class DeliveryReportsApi { private static final Logger LOGGER = Logger.getLogger(DeliveryReportsApi.class.getName()); private HttpClient httpClient; private ServerConfiguration serverConfiguration; + private Map authManagersByOasSecuritySchemes; private HttpMapper mapper; public DeliveryReportsApi( - HttpClient httpClient, ServerConfiguration serverConfiguration, HttpMapper mapper) { + HttpClient httpClient, + ServerConfiguration serverConfiguration, + Map authManagersByOasSecuritySchemes, + HttpMapper mapper) { this.httpClient = httpClient; this.serverConfiguration = serverConfiguration; + this.authManagersByOasSecuritySchemes = authManagersByOasSecuritySchemes; this.mapper = mapper; } @@ -91,7 +97,9 @@ public DeliveryReportDto getDeliveryReportByBatchId( HttpRequest httpRequest = getDeliveryReportByBatchIdRequestBuilder(servicePlanId, batchId, type, status, code); - HttpResponse response = httpClient.invokeAPI(this.serverConfiguration, httpRequest); + HttpResponse response = + httpClient.invokeAPI( + this.serverConfiguration, this.authManagersByOasSecuritySchemes, httpRequest); if (HttpStatus.isSuccessfulStatus(response.getCode())) { TypeReference localVarReturnType = @@ -192,7 +200,9 @@ public RecipientDeliveryReportDto getDeliveryReportByPhoneNumber( HttpRequest httpRequest = getDeliveryReportByPhoneNumberRequestBuilder(servicePlanId, batchId, recipientMsisdn); - HttpResponse response = httpClient.invokeAPI(this.serverConfiguration, httpRequest); + HttpResponse response = + httpClient.invokeAPI( + this.serverConfiguration, this.authManagersByOasSecuritySchemes, httpRequest); if (HttpStatus.isSuccessfulStatus(response.getCode())) { TypeReference localVarReturnType = @@ -321,7 +331,9 @@ public DeliveryReportListDto getDeliveryReports( HttpRequest httpRequest = getDeliveryReportsRequestBuilder( servicePlanId, page, pageSize, startDate, endDate, status, code, clientReference); - HttpResponse response = httpClient.invokeAPI(this.serverConfiguration, httpRequest); + HttpResponse response = + httpClient.invokeAPI( + this.serverConfiguration, this.authManagersByOasSecuritySchemes, httpRequest); if (HttpStatus.isSuccessfulStatus(response.getCode())) { TypeReference localVarReturnType = diff --git a/openapi-contracts/src/main/com/sinch/sdk/domains/sms/adapters/api/v1/GroupsApi.java b/openapi-contracts/src/main/com/sinch/sdk/domains/sms/adapters/api/v1/GroupsApi.java index bd3546e6..d258a8ae 100644 --- a/openapi-contracts/src/main/com/sinch/sdk/domains/sms/adapters/api/v1/GroupsApi.java +++ b/openapi-contracts/src/main/com/sinch/sdk/domains/sms/adapters/api/v1/GroupsApi.java @@ -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; @@ -43,12 +44,17 @@ public class GroupsApi { private static final Logger LOGGER = Logger.getLogger(GroupsApi.class.getName()); private HttpClient httpClient; private ServerConfiguration serverConfiguration; + private Map authManagersByOasSecuritySchemes; private HttpMapper mapper; public GroupsApi( - HttpClient httpClient, ServerConfiguration serverConfiguration, HttpMapper mapper) { + HttpClient httpClient, + ServerConfiguration serverConfiguration, + Map authManagersByOasSecuritySchemes, + HttpMapper mapper) { this.httpClient = httpClient; this.serverConfiguration = serverConfiguration; + this.authManagersByOasSecuritySchemes = authManagersByOasSecuritySchemes; this.mapper = mapper; } @@ -75,7 +81,9 @@ public CreateGroupResponseDto createGroup(String servicePlanId, GroupObjectDto g + groupObjectDto); HttpRequest httpRequest = createGroupRequestBuilder(servicePlanId, groupObjectDto); - HttpResponse response = httpClient.invokeAPI(this.serverConfiguration, httpRequest); + HttpResponse response = + httpClient.invokeAPI( + this.serverConfiguration, this.authManagersByOasSecuritySchemes, httpRequest); if (HttpStatus.isSuccessfulStatus(response.getCode())) { TypeReference localVarReturnType = @@ -140,7 +148,9 @@ public void deleteGroup(String servicePlanId, String groupId) throws ApiExceptio "[deleteGroup] " + "servicePlanId: " + servicePlanId + ", " + "groupId: " + groupId); HttpRequest httpRequest = deleteGroupRequestBuilder(servicePlanId, groupId); - HttpResponse response = httpClient.invokeAPI(this.serverConfiguration, httpRequest); + HttpResponse response = + httpClient.invokeAPI( + this.serverConfiguration, this.authManagersByOasSecuritySchemes, httpRequest); if (HttpStatus.isSuccessfulStatus(response.getCode())) { return; @@ -213,7 +223,9 @@ public List getMembers(String servicePlanId, String groupId) throws ApiE "[getMembers] " + "servicePlanId: " + servicePlanId + ", " + "groupId: " + groupId); HttpRequest httpRequest = getMembersRequestBuilder(servicePlanId, groupId); - HttpResponse response = httpClient.invokeAPI(this.serverConfiguration, httpRequest); + HttpResponse response = + httpClient.invokeAPI( + this.serverConfiguration, this.authManagersByOasSecuritySchemes, httpRequest); if (HttpStatus.isSuccessfulStatus(response.getCode())) { TypeReference> localVarReturnType = new TypeReference>() {}; @@ -297,7 +309,9 @@ public ApiGroupListDto listGroups(String servicePlanId, Integer page, Integer pa + pageSize); HttpRequest httpRequest = listGroupsRequestBuilder(servicePlanId, page, pageSize); - HttpResponse response = httpClient.invokeAPI(this.serverConfiguration, httpRequest); + HttpResponse response = + httpClient.invokeAPI( + this.serverConfiguration, this.authManagersByOasSecuritySchemes, httpRequest); if (HttpStatus.isSuccessfulStatus(response.getCode())) { TypeReference localVarReturnType = new TypeReference() {}; @@ -385,7 +399,9 @@ public CreateGroupResponseDto replaceGroup( HttpRequest httpRequest = replaceGroupRequestBuilder(servicePlanId, groupId, replaceGroupRequestDto); - HttpResponse response = httpClient.invokeAPI(this.serverConfiguration, httpRequest); + HttpResponse response = + httpClient.invokeAPI( + this.serverConfiguration, this.authManagersByOasSecuritySchemes, httpRequest); if (HttpStatus.isSuccessfulStatus(response.getCode())) { TypeReference localVarReturnType = @@ -461,7 +477,9 @@ public CreateGroupResponseDto retrieveGroup(String servicePlanId, String groupId "[retrieveGroup] " + "servicePlanId: " + servicePlanId + ", " + "groupId: " + groupId); HttpRequest httpRequest = retrieveGroupRequestBuilder(servicePlanId, groupId); - HttpResponse response = httpClient.invokeAPI(this.serverConfiguration, httpRequest); + HttpResponse response = + httpClient.invokeAPI( + this.serverConfiguration, this.authManagersByOasSecuritySchemes, httpRequest); if (HttpStatus.isSuccessfulStatus(response.getCode())) { TypeReference localVarReturnType = @@ -557,7 +575,9 @@ public CreateGroupResponseDto updateGroup( HttpRequest httpRequest = updateGroupRequestBuilder(servicePlanId, groupId, updateGroupRequestDto); - HttpResponse response = httpClient.invokeAPI(this.serverConfiguration, httpRequest); + HttpResponse response = + httpClient.invokeAPI( + this.serverConfiguration, this.authManagersByOasSecuritySchemes, httpRequest); if (HttpStatus.isSuccessfulStatus(response.getCode())) { TypeReference localVarReturnType = diff --git a/openapi-contracts/src/main/com/sinch/sdk/domains/sms/adapters/api/v1/InboundsApi.java b/openapi-contracts/src/main/com/sinch/sdk/domains/sms/adapters/api/v1/InboundsApi.java index a79ded82..9b150ba7 100644 --- a/openapi-contracts/src/main/com/sinch/sdk/domains/sms/adapters/api/v1/InboundsApi.java +++ b/openapi-contracts/src/main/com/sinch/sdk/domains/sms/adapters/api/v1/InboundsApi.java @@ -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; @@ -40,12 +41,17 @@ public class InboundsApi { private static final Logger LOGGER = Logger.getLogger(InboundsApi.class.getName()); private HttpClient httpClient; private ServerConfiguration serverConfiguration; + private Map authManagersByOasSecuritySchemes; private HttpMapper mapper; public InboundsApi( - HttpClient httpClient, ServerConfiguration serverConfiguration, HttpMapper mapper) { + HttpClient httpClient, + ServerConfiguration serverConfiguration, + Map authManagersByOasSecuritySchemes, + HttpMapper mapper) { this.httpClient = httpClient; this.serverConfiguration = serverConfiguration; + this.authManagersByOasSecuritySchemes = authManagersByOasSecuritySchemes; this.mapper = mapper; } @@ -114,7 +120,9 @@ public ApiInboundListDto listInboundMessages( HttpRequest httpRequest = listInboundMessagesRequestBuilder( servicePlanId, page, pageSize, to, 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 localVarReturnType = @@ -225,7 +233,9 @@ public InboundDto retrieveInboundMessage(String servicePlanId, String inboundId) + inboundId); HttpRequest httpRequest = retrieveInboundMessageRequestBuilder(servicePlanId, inboundId); - HttpResponse response = httpClient.invokeAPI(this.serverConfiguration, httpRequest); + HttpResponse response = + httpClient.invokeAPI( + this.serverConfiguration, this.authManagersByOasSecuritySchemes, httpRequest); if (HttpStatus.isSuccessfulStatus(response.getCode())) { TypeReference localVarReturnType = new TypeReference() {};