diff --git a/MIGRATION-GUIDE.md b/MIGRATION-GUIDE.md
index 5cd3343cf..3cff52eed 100644
--- a/MIGRATION-GUIDE.md
+++ b/MIGRATION-GUIDE.md
@@ -241,6 +241,20 @@ Use the new versioned API under `sms().v1()` to get access to [SMSService](https
### [`Voice`](https://www.javadoc.io/doc/com.sinch.sdk/sinch-sdk-java/2.0.0/com/sinch/sdk/domains/voice/package-summary.html)
+- `Applications.listNumbers()` is returning a `[OwnedNumbersListResponse](https://www.javadoc.io/doc/com.sinch.sdk/sinch-sdk-java/2.0.0/com/sinch/sdk/domains/voice/models/v1/application/response/OwnedNumbersListResponse.html)` instead of a list of `OwnedNumbersResponse`. The new response still contains the list of assigned numbers but support the pagination of the results by iterator.
+
+#### Replacement APIs
+
+Use the new versioned API under `voice().v1()` to get access to [VoiceService](https://www.javadoc.io/doc/com.sinch.sdk/sinch-sdk-java/2.0.0/com/sinch/sdk/domains/voice/api/v1/VoiceService.html): [`sinchClient.voice().v1()`](https://www.javadoc.io/doc/com.sinch.sdk/sinch-sdk-java/2.0.0./com/sinch/sdk/domains/voice/VoiceService.html#v1())
+
+| Old interface | New Equivalent in `voice().v1()` |
+|----------------|--------------------------------------------------------------------------------------------------------------------------------------------------|
+| applications() | [v1().applications()](https://www.javadoc.io/doc/com.sinch.sdk/sinch-sdk-java/2.0.0/com/sinch/sdk/domains/voice/api/v1/ApplicationsService.html) |
+| callouts() | [v1().callouts()](https://www.javadoc.io/doc/com.sinch.sdk/sinch-sdk-java/2.0.0/com/sinch/sdk/domains/voice/api/v1/CalloutsService.html) |
+| calls() | [v1().calls()](https://www.javadoc.io/doc/com.sinch.sdk/sinch-sdk-java/2.0.0/com/sinch/sdk/domains/voice/api/v1/CallsService.html) |
+| conferences() | [v1().conferences()](https://www.javadoc.io/doc/com.sinch.sdk/sinch-sdk-java/2.0.0/com/sinch/sdk/domains/voice/api/v1/ConferencesService.html) |
+| webhooks() | [v1().webhooks()](https://www.javadoc.io/doc/com.sinch.sdk/sinch-sdk-java/2.0.0/com/sinch/sdk/domains/voice/api/v1/WebHooksService.html) |
+
#### Replacement models
| Old const | New const |
@@ -261,17 +275,17 @@ Use the new versioned API under `sms().v1()` to get access to [SMSService](https
| models/DestinationUser | [com.sinch.sdk.domains.voice.models.v1.destination.DestinationMxp](https://www.javadoc.io/doc/com.sinch.sdk/sinch-sdk-java/2.0.0/com/sinch/sdk/domains/voice/models/v1/destination/DestinationMxp.html) |
##### Applications
-| Old class | New class |
-|------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-| models/ApplicationAssignedNumber | [com.sinch.sdk.domains.voice.models.v1.applications.response](https://www.javadoc.io/doc/com.sinch.sdk/sinch-sdk-java/2.0.0/com/sinch/sdk/domains/voice/models/v1/applications/response/OwnedNumberInformation.html) |
-| models/response/AssignedNumbers | [com.sinch.sdk.domains.voice.models.v1.applications.response.OwnedNumbersResponse](https://www.javadoc.io/doc/com.sinch.sdk/sinch-sdk-java/2.0.0/com/sinch/sdk/domains/voice/models/v1/applications/response/OwnedNumbersResponse.html) |
-| models/CallbackUrls | [com.sinch.sdk.domains.voice.models.v1.applications.Callbacks](https://www.javadoc.io/doc/com.sinch.sdk/sinch-sdk-java/2.0.0/com/sinch/sdk/domains/voice/models/v1/applications/Callbacks.html) |
-| models/ApplicationURL | [com.sinch.sdk.domains.voice.models.v1.applications.CallbacksUrl](https://www.javadoc.io/doc/com.sinch.sdk/sinch-sdk-java/2.0.0/com/sinch/sdk/domains/voice/models/v1/applications/CallbacksUrl.html) |
-| models/NumberInformation | [com.sinch.sdk.domains.voice.models.v1.applications.response.QueryNumberInformation](https://www.javadoc.io/doc/com.sinch.sdk/sinch-sdk-java/2.0.0/com/sinch/sdk/domains/voice/models/v1/applications/response/QueryNumberInformation.html) |
-| models/response/QueryNumber | [com.sinch.sdk.domains.voice.models.v1.applications.response.QueryNumberResponse](https://www.javadoc.io/doc/com.sinch.sdk/sinch-sdk-java/2.0.0/com/sinch/sdk/domains/voice/models/v1/applications/response/QueryNumberResponse.html) |
-| models/requests/ApplicationsAssignNumbersRequestParameters | [com.sinch.sdk.domains.voice.models.v1.applications.request.UpdateNumbersRequest](https://www.javadoc.io/doc/com.sinch.sdk/sinch-sdk-java/2.0.0/com/sinch/sdk/domains/voice/models/v1/applications/request/UpdateNumbersRequest.html) |
-| models/NumberType | N/A |
-| models/CapabilityType | [com.sinch.sdk.domains.voice.models.v1.applications.Capability](https://www.javadoc.io/doc/com.sinch.sdk/sinch-sdk-java/2.0.0/com/sinch/sdk/domains/voice/models/v1/applications/Capability.html) |
+| Old class | New class |
+|------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| models/ApplicationAssignedNumber | [com.sinch.sdk.domains.voice.models.v1.applications.response](https://www.javadoc.io/doc/com.sinch.sdk/sinch-sdk-java/2.0.0/com/sinch/sdk/domains/voice/models/v1/applications/response/OwnedNumberInformation.html) |
+| models/response/AssignedNumbers | [com.sinch.sdk.domains.voice.models.v1.applications.response.OwnedNumbersListResponse](https://www.javadoc.io/doc/com.sinch.sdk/sinch-sdk-java/2.0.0/com/sinch/sdk/domains/voice/models/v1/applications/response/OwnedNumbersListResponse.html) |
+| models/CallbackUrls | [com.sinch.sdk.domains.voice.models.v1.applications.Callbacks](https://www.javadoc.io/doc/com.sinch.sdk/sinch-sdk-java/2.0.0/com/sinch/sdk/domains/voice/models/v1/applications/Callbacks.html) |
+| models/ApplicationURL | [com.sinch.sdk.domains.voice.models.v1.applications.CallbacksUrl](https://www.javadoc.io/doc/com.sinch.sdk/sinch-sdk-java/2.0.0/com/sinch/sdk/domains/voice/models/v1/applications/CallbacksUrl.html) |
+| models/NumberInformation | [com.sinch.sdk.domains.voice.models.v1.applications.response.QueryNumberInformation](https://www.javadoc.io/doc/com.sinch.sdk/sinch-sdk-java/2.0.0/com/sinch/sdk/domains/voice/models/v1/applications/response/QueryNumberInformation.html) |
+| models/response/QueryNumber | [com.sinch.sdk.domains.voice.models.v1.applications.response.QueryNumberResponse](https://www.javadoc.io/doc/com.sinch.sdk/sinch-sdk-java/2.0.0/com/sinch/sdk/domains/voice/models/v1/applications/response/QueryNumberResponse.html) |
+| models/requests/ApplicationsAssignNumbersRequestParameters | [com.sinch.sdk.domains.voice.models.v1.applications.request.UpdateNumbersRequest](https://www.javadoc.io/doc/com.sinch.sdk/sinch-sdk-java/2.0.0/com/sinch/sdk/domains/voice/models/v1/applications/request/UpdateNumbersRequest.html) |
+| models/NumberType | N/A |
+| models/CapabilityType | [com.sinch.sdk.domains.voice.models.v1.applications.Capability](https://www.javadoc.io/doc/com.sinch.sdk/sinch-sdk-java/2.0.0/com/sinch/sdk/domains/voice/models/v1/applications/Capability.html) |
##### Callouts
| Old class | New class |
@@ -353,21 +367,22 @@ Use the new versioned API under `sms().v1()` to get access to [SMSService](https
| models/webhooks/PromptInputEvent | [com.sinch.sdk.domains.voice.models.v1.webhooks.PromptInputEvent](https://www.javadoc.io/doc/com.sinch.sdk/sinch-sdk-java/2.0.0/com/sinch/sdk/domains/voice/models/v1/webhooks/PromptInputEvent.html) |
| models/webhooks/WebhooksEvent | [com.sinch.sdk.domains.voice.models.v1.webhooks.VoiceWebhookEvent](https://www.javadoc.io/doc/com.sinch.sdk/sinch-sdk-java/2.0.0/com/sinch/sdk/domains/voice/models/v1/webhooks/VoiceWebhookEvent.html) |
+### [`Verification`](https://www.javadoc.io/doc/com.sinch.sdk/sinch-sdk-java/2.0.0/com/sinch/sdk/domains/verification/package-summary.html)
#### Replacement APIs
-Use the new versioned API under `voice().v1()` to get access to [VoiceService](https://www.javadoc.io/doc/com.sinch.sdk/sinch-sdk-java/2.0.0/com/sinch/sdk/domains/voice/api/v1/VoiceService.html): [`sinchClient.voice().v1()`](https://www.javadoc.io/doc/com.sinch.sdk/sinch-sdk-java/2.0.0./com/sinch/sdk/domains/voice/VoiceService.html#v1())
-
-| Old interface | New Equivalent in `voice().v1()` |
-|----------------|--------------------------------------------------------------------------------------------------------------------------------------------------|
-| applications() | [v1().applications()](https://www.javadoc.io/doc/com.sinch.sdk/sinch-sdk-java/2.0.0/com/sinch/sdk/domains/voice/api/v1/ApplicationsService.html) |
-| callouts() | [v1().callouts()](https://www.javadoc.io/doc/com.sinch.sdk/sinch-sdk-java/2.0.0/com/sinch/sdk/domains/voice/api/v1/CalloutsService.html) |
-| calls() | [v1().calls()](https://www.javadoc.io/doc/com.sinch.sdk/sinch-sdk-java/2.0.0/com/sinch/sdk/domains/voice/api/v1/CallsService.html) |
-| conferences() | [v1().conferences()](https://www.javadoc.io/doc/com.sinch.sdk/sinch-sdk-java/2.0.0/com/sinch/sdk/domains/voice/api/v1/ConferencesService.html) |
-| webhooks() | [v1().webhooks()](https://www.javadoc.io/doc/com.sinch.sdk/sinch-sdk-java/2.0.0/com/sinch/sdk/domains/voice/api/v1/WebHooksService.html) |
-
+Use the new versioned API under `verification().v1()` to get access to [VerificationService](https://www.javadoc.io/doc/com.sinch.sdk/sinch-sdk-java/2.0.0/com/sinch/sdk/domains/verification/api/v1/VerificationService.html): [`sinchClient.verification().v1()`](https://www.javadoc.io/doc/com.sinch.sdk/sinch-sdk-java/2.0.0/com/sinch/sdk/domains/verification/VerificationService.html#v1())
-### [`Verification`](https://www.javadoc.io/doc/com.sinch.sdk/sinch-sdk-java/2.0.0/com/sinch/sdk/domains/verification/package-summary.html)
+| Old interface | New Equivalent in `verification().v1()` |
+|---------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| verifications() `start` related APIs | [v1().verificationStart()](https://www.javadoc.io/doc/com.sinch.sdk/sinch-sdk-java/2.0.0/com/sinch/sdk/domains/verification/api/v1/VerificationStartService.html) |
+| verifications() `report` related APIs | [v1().verificationReport()](https://www.javadoc.io/doc/com.sinch.sdk/sinch-sdk-java/2.0.0/com/sinch/sdk/domains/verification/api/v1/VerificationReportService.html) |
+| verificationStatus() | [v1().verificationStatus()](https://www.javadoc.io/doc/com.sinch.sdk/sinch-sdk-java/2.0.0/com/sinch/sdk/domains/verification/api/v1/VerificationStatusService.html) |
+| webhooks() | [v1().webhooks()](https://www.javadoc.io/doc/com.sinch.sdk/sinch-sdk-java/2.0.0/com/sinch/sdk/domains/verification/api/v1/WebHooksService.html) |
+| VerificationStartService | [VerificationsStartService](https://www.javadoc.io/doc/com.sinch.sdk/sinch-sdk-java/2.0.0/com/sinch/sdk/domains/verification/api/v1/VerificationsStartService.html) |
+| VerificationReportService | [VerificationsReportService](https://www.javadoc.io/doc/com.sinch.sdk/sinch-sdk-java/2.0.0/com/sinch/sdk/domains/verification/api/v1/VerificationsReportService.html) |
+| VerificationStatusService | [VerificationsStatusService](https://www.javadoc.io/doc/com.sinch.sdk/sinch-sdk-java/2.0.0/com/sinch/sdk/domains/verification/api/v1/VerificationsStatusService.html) |
+| WebHooksService | [WebhooksService](https://www.javadoc.io/doc/com.sinch.sdk/sinch-sdk-java/2.0.0/com/sinch/sdk/domains/verification/api/v1/WebhookService.html) |
#### Replacement APIs
diff --git a/client/src/main/com/sinch/sdk/domains/voice/api/v1/ApplicationsService.java b/client/src/main/com/sinch/sdk/domains/voice/api/v1/ApplicationsService.java
deleted file mode 100644
index 356604b3b..000000000
--- a/client/src/main/com/sinch/sdk/domains/voice/api/v1/ApplicationsService.java
+++ /dev/null
@@ -1,68 +0,0 @@
-package com.sinch.sdk.domains.voice.api.v1;
-
-import com.sinch.sdk.domains.voice.models.v1.applications.Callbacks;
-import com.sinch.sdk.domains.voice.models.v1.applications.request.UnAssignNumberRequest;
-import com.sinch.sdk.domains.voice.models.v1.applications.request.UpdateNumbersRequest;
-import com.sinch.sdk.domains.voice.models.v1.applications.response.OwnedNumbersResponse;
-import com.sinch.sdk.domains.voice.models.v1.applications.response.QueryNumberResponse;
-
-/**
- * You can use the API to manage features of applications in your project.
- *
- * @since 1.4
- */
-public interface ApplicationsService {
-
- /**
- * Get information about your numbers.
- *
- *
It returns a list of numbers that you own, as well as their capability (Voice or SMS). For
- * the ones that are assigned to an app, it returns the application key of the app.
- *
- * @return Your numbers
- * @since 1.4
- */
- OwnedNumbersResponse listNumbers();
-
- /**
- * Returns any callback URLs configured for the specified application
- *
- * @param applicationKey The unique identifying key of the application
- * @return Assigned callback to application
- * @since 1.4
- */
- Callbacks getCallbackUrls(String applicationKey);
-
- /**
- * Update the configured callback URLs for the specified application.
- *
- * @param applicationKey The unique identifying key of the application
- * @param parameters Callbacks settings
- * @since 1.4
- */
- void updateCallbackUrls(String applicationKey, Callbacks parameters);
-
- /**
- * Returns information about the requested number
- *
- * @param number The phone number you want to query
- * @return Number information
- */
- QueryNumberResponse queryNumber(String number);
-
- /**
- * Update or assign a list of numbers to an application.
- *
- * @param parameters Request parameters
- * @since 1.4
- */
- void assignNumbers(UpdateNumbersRequest parameters);
-
- /**
- * Un-assign a number from an application.
- *
- * @param parameters Request parameters
- * @since 1.4
- */
- public void unassignNumber(UnAssignNumberRequest parameters);
-}
diff --git a/client/src/main/com/sinch/sdk/domains/voice/api/v1/CallsService.java b/client/src/main/com/sinch/sdk/domains/voice/api/v1/CallsService.java
deleted file mode 100644
index 70cd10e55..000000000
--- a/client/src/main/com/sinch/sdk/domains/voice/api/v1/CallsService.java
+++ /dev/null
@@ -1,58 +0,0 @@
-package com.sinch.sdk.domains.voice.api.v1;
-
-import com.sinch.sdk.domains.voice.models.v1.calls.request.CallLeg;
-import com.sinch.sdk.domains.voice.models.v1.calls.response.CallInformation;
-import com.sinch.sdk.domains.voice.models.v1.svaml.SvamlControl;
-
-/**
- * Using the Calls service, you can manage on-going calls or retrieve information about a call.
- *
- * @see https://developers.sinch.com/docs/voice/api-reference/voice/tag/Calls
- * @since 1.4
- */
-public interface CallsService {
-
- /**
- * You can retrieve information about an ongoing or completed call using a call ID. You can find
- * the call ID of an ongoing call by viewing the response object from a callout request. You can
- * find the call ID of a completed call by looking at your call logs in your Sinch Dashboard.
- *
- *
Note: You can only use this method for calls that terminate to PSTN or SIP networks from an
- * In-app call.
- *
- * @param callId The unique identifier of the call. This value is generated by the system
- * @return Information about the call
- * @since 1.4
- */
- CallInformation get(String callId);
-
- /**
- * This method is used to manage ongoing, connected calls. This method uses SVAML in the request
- * body to perform various tasks related to the call. For more information about SVAML, see the
- * Callback API documentation.
- *
- *
Note: You can only use this method for calls that terminate to PSTN or SIP networks from an
- * In-app call.
- *
- * @param callId The unique identifier of the call. This value is generated by the system
- * @param parameters Tasks to be used related to this call
- * @since 1.4
- */
- void update(String callId, SvamlControl parameters);
-
- /**
- * This method is used to manage ongoing, connected calls. This method is only used when using the
- * PlayFiles and Say instructions in the request body. This method uses SVAML in the request body
- * to perform various tasks related to the call. For more information about SVAML, see the
- * Callback API documentation.
- *
- *
Assign a number or a list of numbers to an application.
+ *
+ * @param updateNumbersRequest (optional)
+ * @throws ApiException if fails to make API call
+ */
+ void assignNumbers(UpdateNumbersRequest updateNumbersRequest) throws ApiException;
+
+ /**
+ * Get Callback URLs
+ *
+ *
Returns any callback URLs configured for the specified application.
+ *
+ * @param applicationkey The unique identifying key of the application. (required)
+ * @return Callbacks
+ * @throws ApiException if fails to make API call
+ */
+ Callbacks getCallbackUrls(String applicationkey) throws ApiException;
+
+ /**
+ * Get Numbers
+ *
+ *
Get information about your numbers. It returns a list of numbers that you own, as well as
+ * their capability (voice or SMS). For the ones that are assigned to an app, it returns the
+ * application key of the app.
+ *
+ * @return OwnedNumbersListResponse
+ * @throws ApiException if fails to make API call
+ */
+ OwnedNumbersListResponse listNumbers() throws ApiException;
+
+ /**
+ * Un-assign number
+ *
+ *
Un-assign a number from an application.
+ *
+ * @param unAssignNumberRequest (optional)
+ * @throws ApiException if fails to make API call
+ */
+ void unassignNumber(UnAssignNumberRequest unAssignNumberRequest) throws ApiException;
+
+ /**
+ * Update Callbacks
+ *
+ *
Update the configured callback URLs for the specified application.
+ *
+ * @param applicationkey The unique identifying key of the application. (required)
+ * @param callbacks (optional)
+ * @throws ApiException if fails to make API call
+ */
+ void updateCallbackUrls(String applicationkey, Callbacks callbacks) throws ApiException;
+}
diff --git a/client/src/main/com/sinch/sdk/domains/voice/api/v1/CalloutsService.java b/openapi-contracts/src/main/com/sinch/sdk/domains/voice/api/v1/CalloutsService.java
similarity index 87%
rename from client/src/main/com/sinch/sdk/domains/voice/api/v1/CalloutsService.java
rename to openapi-contracts/src/main/com/sinch/sdk/domains/voice/api/v1/CalloutsService.java
index 12a71528f..ae6880aa9 100644
--- a/client/src/main/com/sinch/sdk/domains/voice/api/v1/CalloutsService.java
+++ b/openapi-contracts/src/main/com/sinch/sdk/domains/voice/api/v1/CalloutsService.java
@@ -1,3 +1,13 @@
+/*
+ * Voice API | Sinch
+ *
+ * OpenAPI document version: 1.0.1
+ * Contact: support@sinch.com
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * Do not edit the class manually.
+ */
+
package com.sinch.sdk.domains.voice.api.v1;
import com.sinch.sdk.domains.voice.models.v1.callouts.request.CalloutRequest;
@@ -5,13 +15,7 @@
import com.sinch.sdk.domains.voice.models.v1.callouts.request.CalloutRequestCustom;
import com.sinch.sdk.domains.voice.models.v1.callouts.request.CalloutRequestTTS;
-/**
- * A callout is a call made to a phone number or app using the API.
- *
- * @see https://developers.sinch.com/docs/voice/api-reference/voice/tag/Callouts
- * @since 1.4
- */
+/** Callouts Service */
public interface CalloutsService {
/**
diff --git a/openapi-contracts/src/main/com/sinch/sdk/domains/voice/api/v1/CallsService.java b/openapi-contracts/src/main/com/sinch/sdk/domains/voice/api/v1/CallsService.java
new file mode 100644
index 000000000..6aa50ceb5
--- /dev/null
+++ b/openapi-contracts/src/main/com/sinch/sdk/domains/voice/api/v1/CallsService.java
@@ -0,0 +1,77 @@
+/*
+ * Voice API | Sinch
+ *
+ * OpenAPI document version: 1.0.1
+ * Contact: support@sinch.com
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * Do not edit the class manually.
+ */
+
+package com.sinch.sdk.domains.voice.api.v1;
+
+import com.sinch.sdk.core.exceptions.ApiException;
+import com.sinch.sdk.domains.voice.models.v1.calls.request.CallLeg;
+import com.sinch.sdk.domains.voice.models.v1.calls.response.CallInformation;
+import com.sinch.sdk.domains.voice.models.v1.svaml.SvamlControl;
+
+/** Calls Service */
+public interface CallsService {
+
+ /**
+ * Get information about a call
+ *
+ *
You can retrieve information about an ongoing or completed call using a call ID. You can
+ * find the call ID of an ongoing call by viewing the response object from a callout request. You
+ * can find the call ID of a completed call by looking at your call logs in your Sinch
+ * [Dashboard](https://dashboard.sinch.com/voice/logs). Note: You can only use this method for
+ * calls that terminate to PSTN or SIP networks from an In-app call.
+ *
+ * @param callId The unique identifier of the call. This value is generated by the system.
+ * (required)
+ * @return CallInformation
+ * @throws ApiException if fails to make API call
+ */
+ CallInformation get(String callId) throws ApiException;
+
+ /**
+ * Manage Call with `callLeg`
+ *
+ *
This method is used to manage ongoing, connected calls. This method is only used when using
+ * the `PlayFiles` and `Say` instructions in the request body. This method
+ * uses SVAML in the request body to perform various tasks related to the call. For more
+ * information about SVAML, see the [Callback
+ * API](https://developers.sinch.com/docs/voice/api-reference/svaml/) documentation. Note: You can
+ * only use this method for calls that originate from or terminate to PSTN or SIP networks.
+ *
+ * @param callId The unique identifier of the call. This value is generated by the system.
+ * (required)
+ * @param callLeg Specifies which part of the call will be managed. This option is used only by
+ * the `PlayFiles` and `Say` instructions to indicate which channel the
+ * sound will be played on. Valid options are `caller`, `callee` or
+ * `both`. If not specified, the default value is
+ * `caller`.<br><Warning>The `callLeg` identifier is ignored
+ * for calls that are part of a conference and calls initiated using the Callout
+ * API.</Warning> (required)
+ * @param svamlControl (optional)
+ * @throws ApiException if fails to make API call
+ */
+ void manageWithCallLeg(String callId, CallLeg callLeg, SvamlControl svamlControl)
+ throws ApiException;
+
+ /**
+ * Update a call in progress
+ *
+ *
This method is used to manage ongoing, connected calls. This method uses SVAML in the
+ * request body to perform various tasks related to the call. For more information about SVAML,
+ * see the [Callback API](https://developers.sinch.com/docs/voice/api-reference/svaml/)
+ * documentation. This method can only be used for calls that originate from or terminate to PSTN
+ * or SIP networks.
+ *
+ * @param callId The unique identifier of the call. This value is generated by the system.
+ * (required)
+ * @param svamlControl (optional)
+ * @throws ApiException if fails to make API call
+ */
+ void update(String callId, SvamlControl svamlControl) throws ApiException;
+}
diff --git a/openapi-contracts/src/main/com/sinch/sdk/domains/voice/api/v1/ConferencesService.java b/openapi-contracts/src/main/com/sinch/sdk/domains/voice/api/v1/ConferencesService.java
new file mode 100644
index 000000000..8c940b1df
--- /dev/null
+++ b/openapi-contracts/src/main/com/sinch/sdk/domains/voice/api/v1/ConferencesService.java
@@ -0,0 +1,77 @@
+/*
+ * Voice API | Sinch
+ *
+ * OpenAPI document version: 1.0.1
+ * Contact: support@sinch.com
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * Do not edit the class manually.
+ */
+
+package com.sinch.sdk.domains.voice.api.v1;
+
+import com.sinch.sdk.core.exceptions.ApiException;
+import com.sinch.sdk.domains.voice.models.v1.callouts.request.CalloutRequestConference;
+import com.sinch.sdk.domains.voice.models.v1.conferences.request.ManageConferenceParticipantRequest;
+import com.sinch.sdk.domains.voice.models.v1.conferences.response.GetConferenceInfoResponse;
+
+/** Conferences Service */
+public interface ConferencesService {
+
+ /**
+ * Get Conference Info
+ *
+ *
Returns information about a conference that matches the provided conference ID.
+ *
+ * @param conferenceId The unique identifier of the conference. The user sets this value.
+ * (required)
+ * @return GetConferenceInfoResponse
+ * @throws ApiException if fails to make API call
+ */
+ GetConferenceInfoResponse get(String conferenceId) throws ApiException;
+
+ /**
+ * Kick Conference All
+ *
+ *
Removes all participants from a conference.
+ *
+ * @param conferenceId The unique identifier of the conference. The user sets this value.
+ * (required)
+ * @throws ApiException if fails to make API call
+ */
+ void kickAll(String conferenceId) throws ApiException;
+
+ /**
+ * Kick Conference Participant
+ *
+ *
Remove a specified conference participant from a specified conference.
+ *
+ * @param conferenceId The unique identifier of the conference. The user sets this value.
+ * (required)
+ * @param callId The unique identifier of the call. This value is generated by the system.
+ * (required)
+ * @throws ApiException if fails to make API call
+ */
+ void kickParticipant(String conferenceId, String callId) throws ApiException;
+
+ /**
+ * Manage Conference Participant
+ *
+ *
Manages conference participant in a specified conference: * mute / unmute * put on hold /
+ * resume.
+ *
+ * @param conferenceId The unique identifier of the conference. The user sets this value.
+ * (required)
+ * @param callId The unique identifier of the call. This value is generated by the system.
+ * (required)
+ * @param manageConferenceParticipantRequest (optional)
+ * @throws ApiException if fails to make API call
+ */
+ void manageParticipant(
+ String conferenceId,
+ String callId,
+ ManageConferenceParticipantRequest manageConferenceParticipantRequest)
+ throws ApiException;
+
+ String call(CalloutRequestConference parameters);
+}
diff --git a/openapi-contracts/src/main/com/sinch/sdk/domains/voice/api/v1/internal/ApplicationsApi.java b/openapi-contracts/src/main/com/sinch/sdk/domains/voice/api/v1/adapters/ApplicationsServiceImpl.java
similarity index 58%
rename from openapi-contracts/src/main/com/sinch/sdk/domains/voice/api/v1/internal/ApplicationsApi.java
rename to openapi-contracts/src/main/com/sinch/sdk/domains/voice/api/v1/adapters/ApplicationsServiceImpl.java
index f4857d39e..deb9b5c78 100644
--- a/openapi-contracts/src/main/com/sinch/sdk/domains/voice/api/v1/internal/ApplicationsApi.java
+++ b/openapi-contracts/src/main/com/sinch/sdk/domains/voice/api/v1/adapters/ApplicationsServiceImpl.java
@@ -8,7 +8,7 @@
* Do not edit the class manually.
*/
-package com.sinch.sdk.domains.voice.api.v1.internal;
+package com.sinch.sdk.domains.voice.api.v1.adapters;
import com.fasterxml.jackson.core.type.TypeReference;
import com.sinch.sdk.core.exceptions.ApiException;
@@ -23,11 +23,12 @@
import com.sinch.sdk.core.http.URLParameter;
import com.sinch.sdk.core.http.URLPathUtils;
import com.sinch.sdk.core.models.ServerConfiguration;
+import com.sinch.sdk.core.models.pagination.Page;
import com.sinch.sdk.domains.voice.models.v1.applications.Callbacks;
import com.sinch.sdk.domains.voice.models.v1.applications.request.UnAssignNumberRequest;
import com.sinch.sdk.domains.voice.models.v1.applications.request.UpdateNumbersRequest;
-import com.sinch.sdk.domains.voice.models.v1.applications.response.OwnedNumbersResponse;
-import com.sinch.sdk.domains.voice.models.v1.applications.response.QueryNumberResponse;
+import com.sinch.sdk.domains.voice.models.v1.applications.response.OwnedNumbersListResponse;
+import com.sinch.sdk.domains.voice.models.v1.applications.response.internal.OwnedNumbersListResponseInternal;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
@@ -36,15 +37,16 @@
import java.util.Map;
import java.util.logging.Logger;
-public class ApplicationsApi {
+public class ApplicationsServiceImpl
+ implements com.sinch.sdk.domains.voice.api.v1.ApplicationsService {
- private static final Logger LOGGER = Logger.getLogger(ApplicationsApi.class.getName());
- private HttpClient httpClient;
- private ServerConfiguration serverConfiguration;
- private Map authManagersByOasSecuritySchemes;
- private HttpMapper mapper;
+ private static final Logger LOGGER = Logger.getLogger(ApplicationsServiceImpl.class.getName());
+ private final HttpClient httpClient;
+ private final ServerConfiguration serverConfiguration;
+ private final Map authManagersByOasSecuritySchemes;
+ private final HttpMapper mapper;
- public ApplicationsApi(
+ public ApplicationsServiceImpl(
HttpClient httpClient,
ServerConfiguration serverConfiguration,
Map authManagersByOasSecuritySchemes,
@@ -55,28 +57,18 @@ public ApplicationsApi(
this.mapper = mapper;
}
- /**
- * Query number Returns information about the requested number.
- *
- * @param number The phone number you want to query. (required)
- * @return QueryNumberResponse
- * @throws ApiException if fails to make API call
- * @deprecated
- */
- @Deprecated
- public QueryNumberResponse callingQueryNumber(String number) throws ApiException {
+ @Override
+ public void assignNumbers(UpdateNumbersRequest updateNumbersRequest) throws ApiException {
- LOGGER.finest("[callingQueryNumber]" + " " + "number: " + number);
+ LOGGER.finest("[assignNumbers]" + " " + "updateNumbersRequest: " + updateNumbersRequest);
- HttpRequest httpRequest = callingQueryNumberRequestBuilder(number);
+ HttpRequest httpRequest = assignNumbersRequestBuilder(updateNumbersRequest);
HttpResponse response =
httpClient.invokeAPI(
this.serverConfiguration, this.authManagersByOasSecuritySchemes, httpRequest);
if (HttpStatus.isSuccessfulStatus(response.getCode())) {
- TypeReference localVarReturnType =
- new TypeReference() {};
- return mapper.deserialize(response, localVarReturnType);
+ return;
}
// fallback to default errors handling:
// all error cases definition are not required from specs: will try some "hardcoded" content
@@ -87,32 +79,25 @@ public QueryNumberResponse callingQueryNumber(String number) throws ApiException
mapper.deserialize(response, new TypeReference>() {}));
}
- private HttpRequest callingQueryNumberRequestBuilder(String number) throws ApiException {
- // verify the required parameter 'number' is set
- if (number == null) {
- throw new ApiException(
- 400, "Missing the required parameter 'number' when calling callingQueryNumber");
- }
+ private HttpRequest assignNumbersRequestBuilder(UpdateNumbersRequest updateNumbersRequest)
+ throws ApiException {
- String localVarPath =
- "/v1/calling/query/number/{number}"
- .replaceAll(
- "\\{" + "number" + "\\}", URLPathUtils.encodePathSegment(number.toString()));
+ String localVarPath = "/v1/configuration/numbers";
List localVarQueryParams = new ArrayList<>();
Map localVarHeaderParams = new HashMap<>();
- final Collection localVarAccepts = Arrays.asList("application/json");
+ final Collection localVarAccepts = Arrays.asList();
- final Collection localVarContentTypes = Arrays.asList();
+ final Collection localVarContentTypes = Arrays.asList("application/json");
final Collection localVarAuthNames = Arrays.asList("Basic", "Signed");
- final String serializedBody = null;
+ final String serializedBody = mapper.serialize(localVarContentTypes, updateNumbersRequest);
return new HttpRequest(
localVarPath,
- HttpMethod.GET,
+ HttpMethod.POST,
localVarQueryParams,
serializedBody,
localVarHeaderParams,
@@ -121,25 +106,18 @@ private HttpRequest callingQueryNumberRequestBuilder(String number) throws ApiEx
localVarAuthNames);
}
- /**
- * Get Callback URLs Returns any callback URLs configured for the specified application.
- *
- * @param applicationkey The unique identifying key of the application. (required)
- * @return Callbacks
- * @throws ApiException if fails to make API call
- */
- public Callbacks configurationGetCallbackURLs(String applicationkey) throws ApiException {
+ @Override
+ public Callbacks getCallbackUrls(String applicationkey) throws ApiException {
- LOGGER.finest("[configurationGetCallbackURLs]" + " " + "applicationkey: " + applicationkey);
+ LOGGER.finest("[getCallbackUrls]" + " " + "applicationkey: " + applicationkey);
- HttpRequest httpRequest = configurationGetCallbackURLsRequestBuilder(applicationkey);
+ HttpRequest httpRequest = getCallbackUrlsRequestBuilder(applicationkey);
HttpResponse response =
httpClient.invokeAPI(
this.serverConfiguration, this.authManagersByOasSecuritySchemes, httpRequest);
if (HttpStatus.isSuccessfulStatus(response.getCode())) {
- TypeReference localVarReturnType = new TypeReference() {};
- return mapper.deserialize(response, localVarReturnType);
+ return mapper.deserialize(response, new TypeReference() {});
}
// fallback to default errors handling:
// all error cases definition are not required from specs: will try some "hardcoded" content
@@ -150,14 +128,11 @@ public Callbacks configurationGetCallbackURLs(String applicationkey) throws ApiE
mapper.deserialize(response, new TypeReference>() {}));
}
- private HttpRequest configurationGetCallbackURLsRequestBuilder(String applicationkey)
- throws ApiException {
+ private HttpRequest getCallbackUrlsRequestBuilder(String applicationkey) throws ApiException {
// verify the required parameter 'applicationkey' is set
if (applicationkey == null) {
throw new ApiException(
- 400,
- "Missing the required parameter 'applicationkey' when calling"
- + " configurationGetCallbackURLs");
+ 400, "Missing the required parameter 'applicationkey' when calling getCallbackUrls");
}
String localVarPath =
@@ -188,27 +163,22 @@ private HttpRequest configurationGetCallbackURLsRequestBuilder(String applicatio
localVarAuthNames);
}
- /**
- * Get Numbers Get information about your numbers. It returns a list of numbers that you own, as
- * well as their capability (voice or SMS). For the ones that are assigned to an app, it returns
- * the application key of the app.
- *
- * @return OwnedNumbersResponse
- * @throws ApiException if fails to make API call
- */
- public OwnedNumbersResponse configurationGetNumbers() throws ApiException {
+ @Override
+ public OwnedNumbersListResponse listNumbers() throws ApiException {
- LOGGER.finest("[configurationGetNumbers]");
+ LOGGER.finest("[listNumbers]");
- HttpRequest httpRequest = configurationGetNumbersRequestBuilder();
+ HttpRequest httpRequest = listNumbersRequestBuilder();
HttpResponse response =
httpClient.invokeAPI(
this.serverConfiguration, this.authManagersByOasSecuritySchemes, httpRequest);
if (HttpStatus.isSuccessfulStatus(response.getCode())) {
- TypeReference localVarReturnType =
- new TypeReference() {};
- return mapper.deserialize(response, localVarReturnType);
+
+ OwnedNumbersListResponseInternal deserialized =
+ mapper.deserialize(response, new TypeReference() {});
+
+ return new OwnedNumbersListResponse(new Page<>(null, deserialized.getNumbers(), null));
}
// fallback to default errors handling:
// all error cases definition are not required from specs: will try some "hardcoded" content
@@ -219,7 +189,7 @@ public OwnedNumbersResponse configurationGetNumbers() throws ApiException {
mapper.deserialize(response, new TypeReference>() {}));
}
- private HttpRequest configurationGetNumbersRequestBuilder() throws ApiException {
+ private HttpRequest listNumbersRequestBuilder() throws ApiException {
String localVarPath = "/v1/configuration/numbers";
@@ -245,19 +215,12 @@ private HttpRequest configurationGetNumbersRequestBuilder() throws ApiException
localVarAuthNames);
}
- /**
- * Un-assign number Un-assign a number from an application.
- *
- * @param unAssignNumberRequest (optional)
- * @throws ApiException if fails to make API call
- */
- public void configurationUnassignNumber(UnAssignNumberRequest unAssignNumberRequest)
- throws ApiException {
+ @Override
+ public void unassignNumber(UnAssignNumberRequest unAssignNumberRequest) throws ApiException {
- LOGGER.finest(
- "[configurationUnassignNumber]" + " " + "unAssignNumberRequest: " + unAssignNumberRequest);
+ LOGGER.finest("[unassignNumber]" + " " + "unAssignNumberRequest: " + unAssignNumberRequest);
- HttpRequest httpRequest = configurationUnassignNumberRequestBuilder(unAssignNumberRequest);
+ HttpRequest httpRequest = unassignNumberRequestBuilder(unAssignNumberRequest);
HttpResponse response =
httpClient.invokeAPI(
this.serverConfiguration, this.authManagersByOasSecuritySchemes, httpRequest);
@@ -274,8 +237,8 @@ public void configurationUnassignNumber(UnAssignNumberRequest unAssignNumberRequ
mapper.deserialize(response, new TypeReference>() {}));
}
- private HttpRequest configurationUnassignNumberRequestBuilder(
- UnAssignNumberRequest unAssignNumberRequest) throws ApiException {
+ private HttpRequest unassignNumberRequestBuilder(UnAssignNumberRequest unAssignNumberRequest)
+ throws ApiException {
String localVarPath = "/v1/configuration/numbers";
@@ -301,18 +264,11 @@ private HttpRequest configurationUnassignNumberRequestBuilder(
localVarAuthNames);
}
- /**
- * Update Callbacks Update the configured callback URLs for the specified application.
- *
- * @param applicationkey The unique identifying key of the application. (required)
- * @param callbacks (optional)
- * @throws ApiException if fails to make API call
- */
- public void configurationUpdateCallbackURLs(String applicationkey, Callbacks callbacks)
- throws ApiException {
+ @Override
+ public void updateCallbackUrls(String applicationkey, Callbacks callbacks) throws ApiException {
LOGGER.finest(
- "[configurationUpdateCallbackURLs]"
+ "[updateCallbackUrls]"
+ " "
+ "applicationkey: "
+ applicationkey
@@ -320,8 +276,7 @@ public void configurationUpdateCallbackURLs(String applicationkey, Callbacks cal
+ "callbacks: "
+ callbacks);
- HttpRequest httpRequest =
- configurationUpdateCallbackURLsRequestBuilder(applicationkey, callbacks);
+ HttpRequest httpRequest = updateCallbackUrlsRequestBuilder(applicationkey, callbacks);
HttpResponse response =
httpClient.invokeAPI(
this.serverConfiguration, this.authManagersByOasSecuritySchemes, httpRequest);
@@ -338,14 +293,12 @@ public void configurationUpdateCallbackURLs(String applicationkey, Callbacks cal
mapper.deserialize(response, new TypeReference>() {}));
}
- private HttpRequest configurationUpdateCallbackURLsRequestBuilder(
- String applicationkey, Callbacks callbacks) throws ApiException {
+ private HttpRequest updateCallbackUrlsRequestBuilder(String applicationkey, Callbacks callbacks)
+ throws ApiException {
// verify the required parameter 'applicationkey' is set
if (applicationkey == null) {
throw new ApiException(
- 400,
- "Missing the required parameter 'applicationkey' when calling"
- + " configurationUpdateCallbackURLs");
+ 400, "Missing the required parameter 'applicationkey' when calling updateCallbackUrls");
}
String localVarPath =
@@ -375,60 +328,4 @@ private HttpRequest configurationUpdateCallbackURLsRequestBuilder(
localVarContentTypes,
localVarAuthNames);
}
-
- /**
- * Update Numbers Assign a number or a list of numbers to an application.
- *
- * @param updateNumbersRequest (optional)
- * @throws ApiException if fails to make API call
- */
- public void configurationUpdateNumbers(UpdateNumbersRequest updateNumbersRequest)
- throws ApiException {
-
- LOGGER.finest(
- "[configurationUpdateNumbers]" + " " + "updateNumbersRequest: " + updateNumbersRequest);
-
- HttpRequest httpRequest = configurationUpdateNumbersRequestBuilder(updateNumbersRequest);
- HttpResponse response =
- httpClient.invokeAPI(
- this.serverConfiguration, this.authManagersByOasSecuritySchemes, httpRequest);
-
- if (HttpStatus.isSuccessfulStatus(response.getCode())) {
- return;
- }
- // fallback to default errors handling:
- // all error cases definition are not required from specs: will try some "hardcoded" content
- // parsing
- throw ApiExceptionBuilder.build(
- response.getMessage(),
- response.getCode(),
- mapper.deserialize(response, new TypeReference>() {}));
- }
-
- private HttpRequest configurationUpdateNumbersRequestBuilder(
- UpdateNumbersRequest updateNumbersRequest) throws ApiException {
-
- String localVarPath = "/v1/configuration/numbers";
-
- List localVarQueryParams = new ArrayList<>();
-
- Map localVarHeaderParams = new HashMap<>();
-
- final Collection localVarAccepts = Arrays.asList();
-
- final Collection localVarContentTypes = Arrays.asList("application/json");
-
- final Collection localVarAuthNames = Arrays.asList("Basic", "Signed");
- final String serializedBody = mapper.serialize(localVarContentTypes, updateNumbersRequest);
-
- return new HttpRequest(
- localVarPath,
- HttpMethod.POST,
- localVarQueryParams,
- serializedBody,
- localVarHeaderParams,
- localVarAccepts,
- localVarContentTypes,
- localVarAuthNames);
- }
}
diff --git a/openapi-contracts/src/main/com/sinch/sdk/domains/voice/api/v1/internal/CalloutsApi.java b/openapi-contracts/src/main/com/sinch/sdk/domains/voice/api/v1/adapters/CalloutsServiceImpl.java
similarity index 66%
rename from openapi-contracts/src/main/com/sinch/sdk/domains/voice/api/v1/internal/CalloutsApi.java
rename to openapi-contracts/src/main/com/sinch/sdk/domains/voice/api/v1/adapters/CalloutsServiceImpl.java
index 768f2ca53..fdd52d2e1 100644
--- a/openapi-contracts/src/main/com/sinch/sdk/domains/voice/api/v1/internal/CalloutsApi.java
+++ b/openapi-contracts/src/main/com/sinch/sdk/domains/voice/api/v1/adapters/CalloutsServiceImpl.java
@@ -8,7 +8,7 @@
* Do not edit the class manually.
*/
-package com.sinch.sdk.domains.voice.api.v1.internal;
+package com.sinch.sdk.domains.voice.api.v1.adapters;
import com.fasterxml.jackson.core.type.TypeReference;
import com.sinch.sdk.core.exceptions.ApiException;
@@ -22,7 +22,12 @@
import com.sinch.sdk.core.http.HttpStatus;
import com.sinch.sdk.core.http.URLParameter;
import com.sinch.sdk.core.models.ServerConfiguration;
+import com.sinch.sdk.domains.voice.models.v1.callouts.request.CalloutRequest;
+import com.sinch.sdk.domains.voice.models.v1.callouts.request.CalloutRequestConference;
+import com.sinch.sdk.domains.voice.models.v1.callouts.request.CalloutRequestCustom;
+import com.sinch.sdk.domains.voice.models.v1.callouts.request.CalloutRequestTTS;
import com.sinch.sdk.domains.voice.models.v1.callouts.request.internal.CalloutRequestInternal;
+import com.sinch.sdk.domains.voice.models.v1.callouts.request.internal.CalloutRequestInternalImpl;
import com.sinch.sdk.domains.voice.models.v1.callouts.response.CalloutResponse;
import java.util.ArrayList;
import java.util.Arrays;
@@ -32,15 +37,15 @@
import java.util.Map;
import java.util.logging.Logger;
-public class CalloutsApi {
+public class CalloutsServiceImpl implements com.sinch.sdk.domains.voice.api.v1.CalloutsService {
- private static final Logger LOGGER = Logger.getLogger(CalloutsApi.class.getName());
- private HttpClient httpClient;
- private ServerConfiguration serverConfiguration;
- private Map authManagersByOasSecuritySchemes;
- private HttpMapper mapper;
+ private static final Logger LOGGER = Logger.getLogger(CalloutsServiceImpl.class.getName());
+ private final HttpClient httpClient;
+ private final ServerConfiguration serverConfiguration;
+ private final Map authManagersByOasSecuritySchemes;
+ private final HttpMapper mapper;
- public CalloutsApi(
+ public CalloutsServiceImpl(
HttpClient httpClient,
ServerConfiguration serverConfiguration,
Map authManagersByOasSecuritySchemes,
@@ -51,16 +56,7 @@ public CalloutsApi(
this.mapper = mapper;
}
- /**
- * Callout Request Makes a call out to a phone number. The types of callouts currently supported
- * are conference callouts, text-to-speech callouts, and custom callouts. The custom callout is
- * the most flexible, but text-to-speech and conference callouts are more convenient.
- *
- * @param calloutRequestInternal (optional)
- * @return CalloutResponse
- * @throws ApiException if fails to make API call
- */
- public CalloutResponse callouts(CalloutRequestInternal calloutRequestInternal)
+ private CalloutResponse callouts(CalloutRequestInternal calloutRequestInternal)
throws ApiException {
LOGGER.finest("[callouts]" + " " + "calloutRequestInternal: " + calloutRequestInternal);
@@ -71,8 +67,7 @@ public CalloutResponse callouts(CalloutRequestInternal calloutRequestInternal)
this.serverConfiguration, this.authManagersByOasSecuritySchemes, httpRequest);
if (HttpStatus.isSuccessfulStatus(response.getCode())) {
- TypeReference localVarReturnType = new TypeReference() {};
- return mapper.deserialize(response, localVarReturnType);
+ return mapper.deserialize(response, new TypeReference() {});
}
// fallback to default errors handling:
// all error cases definition are not required from specs: will try some "hardcoded" content
@@ -109,4 +104,30 @@ private HttpRequest calloutsRequestBuilder(CalloutRequestInternal calloutRequest
localVarContentTypes,
localVarAuthNames);
}
+
+ public String textToSpeech(CalloutRequestTTS parameters) {
+
+ return call(parameters);
+ }
+
+ public String conference(CalloutRequestConference parameters) {
+
+ return call(parameters);
+ }
+
+ public String custom(CalloutRequestCustom parameters) {
+
+ return call(parameters);
+ }
+
+ public String call(CalloutRequest parameters) {
+
+ CalloutRequestInternalImpl request = new CalloutRequestInternalImpl();
+ request.setActualInstance(parameters);
+ CalloutResponse response = callouts(request);
+ if (null == response) {
+ return null;
+ }
+ return response.getCallId();
+ }
}
diff --git a/openapi-contracts/src/main/com/sinch/sdk/domains/voice/api/v1/internal/CallsApi.java b/openapi-contracts/src/main/com/sinch/sdk/domains/voice/api/v1/adapters/CallsServiceImpl.java
similarity index 58%
rename from openapi-contracts/src/main/com/sinch/sdk/domains/voice/api/v1/internal/CallsApi.java
rename to openapi-contracts/src/main/com/sinch/sdk/domains/voice/api/v1/adapters/CallsServiceImpl.java
index 3c80670a0..afd380188 100644
--- a/openapi-contracts/src/main/com/sinch/sdk/domains/voice/api/v1/internal/CallsApi.java
+++ b/openapi-contracts/src/main/com/sinch/sdk/domains/voice/api/v1/adapters/CallsServiceImpl.java
@@ -8,7 +8,7 @@
* Do not edit the class manually.
*/
-package com.sinch.sdk.domains.voice.api.v1.internal;
+package com.sinch.sdk.domains.voice.api.v1.adapters;
import com.fasterxml.jackson.core.type.TypeReference;
import com.sinch.sdk.core.exceptions.ApiException;
@@ -23,6 +23,7 @@
import com.sinch.sdk.core.http.URLParameter;
import com.sinch.sdk.core.http.URLPathUtils;
import com.sinch.sdk.core.models.ServerConfiguration;
+import com.sinch.sdk.domains.voice.models.v1.calls.request.CallLeg;
import com.sinch.sdk.domains.voice.models.v1.calls.response.CallInformation;
import com.sinch.sdk.domains.voice.models.v1.svaml.SvamlControl;
import java.util.ArrayList;
@@ -33,15 +34,15 @@
import java.util.Map;
import java.util.logging.Logger;
-public class CallsApi {
+public class CallsServiceImpl implements com.sinch.sdk.domains.voice.api.v1.CallsService {
- private static final Logger LOGGER = Logger.getLogger(CallsApi.class.getName());
- private HttpClient httpClient;
- private ServerConfiguration serverConfiguration;
- private Map authManagersByOasSecuritySchemes;
- private HttpMapper mapper;
+ private static final Logger LOGGER = Logger.getLogger(CallsServiceImpl.class.getName());
+ private final HttpClient httpClient;
+ private final ServerConfiguration serverConfiguration;
+ private final Map authManagersByOasSecuritySchemes;
+ private final HttpMapper mapper;
- public CallsApi(
+ public CallsServiceImpl(
HttpClient httpClient,
ServerConfiguration serverConfiguration,
Map authManagersByOasSecuritySchemes,
@@ -52,30 +53,18 @@ public CallsApi(
this.mapper = mapper;
}
- /**
- * Get information about a call You can retrieve information about an ongoing or completed call
- * using a call ID. You can find the call ID of an ongoing call by viewing the response object
- * from a callout request. You can find the call ID of a completed call by looking at your call
- * logs in your Sinch [Dashboard](https://dashboard.sinch.com/voice/logs). Note: You can only use
- * this method for calls that terminate to PSTN or SIP networks from an In-app call.
- *
- * @param callId The unique identifier of the call. This value is generated by the system.
- * (required)
- * @return CallInformation
- * @throws ApiException if fails to make API call
- */
- public CallInformation callingGetCallResult(String callId) throws ApiException {
-
- LOGGER.finest("[callingGetCallResult]" + " " + "callId: " + callId);
-
- HttpRequest httpRequest = callingGetCallResultRequestBuilder(callId);
+ @Override
+ public CallInformation get(String callId) throws ApiException {
+
+ LOGGER.finest("[get]" + " " + "callId: " + callId);
+
+ HttpRequest httpRequest = getRequestBuilder(callId);
HttpResponse response =
httpClient.invokeAPI(
this.serverConfiguration, this.authManagersByOasSecuritySchemes, httpRequest);
if (HttpStatus.isSuccessfulStatus(response.getCode())) {
- TypeReference localVarReturnType = new TypeReference() {};
- return mapper.deserialize(response, localVarReturnType);
+ return mapper.deserialize(response, new TypeReference() {});
}
// fallback to default errors handling:
// all error cases definition are not required from specs: will try some "hardcoded" content
@@ -86,11 +75,10 @@ public CallInformation callingGetCallResult(String callId) throws ApiException {
mapper.deserialize(response, new TypeReference>() {}));
}
- private HttpRequest callingGetCallResultRequestBuilder(String callId) throws ApiException {
+ private HttpRequest getRequestBuilder(String callId) throws ApiException {
// verify the required parameter 'callId' is set
if (callId == null) {
- throw new ApiException(
- 400, "Missing the required parameter 'callId' when calling callingGetCallResult");
+ throw new ApiException(400, "Missing the required parameter 'callId' when calling get");
}
String localVarPath =
@@ -120,31 +108,12 @@ private HttpRequest callingGetCallResultRequestBuilder(String callId) throws Api
localVarAuthNames);
}
- /**
- * Manage Call with `callLeg` This method is used to manage ongoing, connected calls.
- * This method is only used when using the `PlayFiles` and `Say` instructions
- * in the request body. This method uses SVAML in the request body to perform various tasks
- * related to the call. For more information about SVAML, see the [Callback
- * API](https://developers.sinch.com/docs/voice/api-reference/svaml/) documentation. Note: You can
- * only use this method for calls that originate from or terminate to PSTN or SIP networks.
- *
- * @param callId The unique identifier of the call. This value is generated by the system.
- * (required)
- * @param callLeg Specifies which part of the call will be managed. This option is used only by
- * the `PlayFiles` and `Say` instructions to indicate which channel the
- * sound will be played on. Valid options are `caller`, `callee` or
- * `both`. If not specified, the default value is
- * `caller`.<br><Warning>The `callLeg` identifier is ignored
- * for calls that are part of a conference and calls initiated using the Callout
- * API.</Warning> (required)
- * @param svamlControl (optional)
- * @throws ApiException if fails to make API call
- */
- public void callingManageCallWithCallLeg(String callId, String callLeg, SvamlControl svamlControl)
+ @Override
+ public void manageWithCallLeg(String callId, CallLeg callLeg, SvamlControl svamlControl)
throws ApiException {
LOGGER.finest(
- "[callingManageCallWithCallLeg]"
+ "[manageWithCallLeg]"
+ " "
+ "callId: "
+ callId
@@ -155,8 +124,7 @@ public void callingManageCallWithCallLeg(String callId, String callLeg, SvamlCon
+ "svamlControl: "
+ svamlControl);
- HttpRequest httpRequest =
- callingManageCallWithCallLegRequestBuilder(callId, callLeg, svamlControl);
+ HttpRequest httpRequest = manageWithCallLegRequestBuilder(callId, callLeg, svamlControl);
HttpResponse response =
httpClient.invokeAPI(
this.serverConfiguration, this.authManagersByOasSecuritySchemes, httpRequest);
@@ -173,18 +141,17 @@ public void callingManageCallWithCallLeg(String callId, String callLeg, SvamlCon
mapper.deserialize(response, new TypeReference>() {}));
}
- private HttpRequest callingManageCallWithCallLegRequestBuilder(
- String callId, String callLeg, SvamlControl svamlControl) throws ApiException {
+ private HttpRequest manageWithCallLegRequestBuilder(
+ String callId, CallLeg callLeg, SvamlControl svamlControl) throws ApiException {
// verify the required parameter 'callId' is set
if (callId == null) {
throw new ApiException(
- 400, "Missing the required parameter 'callId' when calling callingManageCallWithCallLeg");
+ 400, "Missing the required parameter 'callId' when calling manageWithCallLeg");
}
// verify the required parameter 'callLeg' is set
if (callLeg == null) {
throw new ApiException(
- 400,
- "Missing the required parameter 'callLeg' when calling callingManageCallWithCallLeg");
+ 400, "Missing the required parameter 'callLeg' when calling manageWithCallLeg");
}
String localVarPath =
@@ -215,24 +182,12 @@ private HttpRequest callingManageCallWithCallLegRequestBuilder(
localVarAuthNames);
}
- /**
- * Update a call in progress This method is used to manage ongoing, connected calls. This method
- * uses SVAML in the request body to perform various tasks related to the call. For more
- * information about SVAML, see the [Callback
- * API](https://developers.sinch.com/docs/voice/api-reference/svaml/) documentation. This method
- * can only be used for calls that originate from or terminate to PSTN or SIP networks.
- *
- * @param callId The unique identifier of the call. This value is generated by the system.
- * (required)
- * @param svamlControl (optional)
- * @throws ApiException if fails to make API call
- */
- public void callingUpdateCall(String callId, SvamlControl svamlControl) throws ApiException {
+ @Override
+ public void update(String callId, SvamlControl svamlControl) throws ApiException {
- LOGGER.finest(
- "[callingUpdateCall]" + " " + "callId: " + callId + ", " + "svamlControl: " + svamlControl);
+ LOGGER.finest("[update]" + " " + "callId: " + callId + ", " + "svamlControl: " + svamlControl);
- HttpRequest httpRequest = callingUpdateCallRequestBuilder(callId, svamlControl);
+ HttpRequest httpRequest = updateRequestBuilder(callId, svamlControl);
HttpResponse response =
httpClient.invokeAPI(
this.serverConfiguration, this.authManagersByOasSecuritySchemes, httpRequest);
@@ -249,12 +204,11 @@ public void callingUpdateCall(String callId, SvamlControl svamlControl) throws A
mapper.deserialize(response, new TypeReference>() {}));
}
- private HttpRequest callingUpdateCallRequestBuilder(String callId, SvamlControl svamlControl)
+ private HttpRequest updateRequestBuilder(String callId, SvamlControl svamlControl)
throws ApiException {
// verify the required parameter 'callId' is set
if (callId == null) {
- throw new ApiException(
- 400, "Missing the required parameter 'callId' when calling callingUpdateCall");
+ throw new ApiException(400, "Missing the required parameter 'callId' when calling update");
}
String localVarPath =
diff --git a/openapi-contracts/src/main/com/sinch/sdk/domains/voice/api/v1/internal/ConferencesApi.java b/openapi-contracts/src/main/com/sinch/sdk/domains/voice/api/v1/adapters/ConferencesServiceImpl.java
similarity index 67%
rename from openapi-contracts/src/main/com/sinch/sdk/domains/voice/api/v1/internal/ConferencesApi.java
rename to openapi-contracts/src/main/com/sinch/sdk/domains/voice/api/v1/adapters/ConferencesServiceImpl.java
index e07596322..0f4275201 100644
--- a/openapi-contracts/src/main/com/sinch/sdk/domains/voice/api/v1/internal/ConferencesApi.java
+++ b/openapi-contracts/src/main/com/sinch/sdk/domains/voice/api/v1/adapters/ConferencesServiceImpl.java
@@ -8,7 +8,7 @@
* Do not edit the class manually.
*/
-package com.sinch.sdk.domains.voice.api.v1.internal;
+package com.sinch.sdk.domains.voice.api.v1.adapters;
import com.fasterxml.jackson.core.type.TypeReference;
import com.sinch.sdk.core.exceptions.ApiException;
@@ -23,7 +23,9 @@
import com.sinch.sdk.core.http.URLParameter;
import com.sinch.sdk.core.http.URLPathUtils;
import com.sinch.sdk.core.models.ServerConfiguration;
+import com.sinch.sdk.domains.voice.models.v1.callouts.request.CalloutRequestConference;
import com.sinch.sdk.domains.voice.models.v1.callouts.request.internal.CalloutRequestInternal;
+import com.sinch.sdk.domains.voice.models.v1.callouts.request.internal.CalloutRequestInternalImpl;
import com.sinch.sdk.domains.voice.models.v1.callouts.response.CalloutResponse;
import com.sinch.sdk.domains.voice.models.v1.conferences.request.ManageConferenceParticipantRequest;
import com.sinch.sdk.domains.voice.models.v1.conferences.response.GetConferenceInfoResponse;
@@ -35,15 +37,16 @@
import java.util.Map;
import java.util.logging.Logger;
-public class ConferencesApi {
+public class ConferencesServiceImpl
+ implements com.sinch.sdk.domains.voice.api.v1.ConferencesService {
- private static final Logger LOGGER = Logger.getLogger(ConferencesApi.class.getName());
- private HttpClient httpClient;
- private ServerConfiguration serverConfiguration;
- private Map authManagersByOasSecuritySchemes;
- private HttpMapper mapper;
+ private static final Logger LOGGER = Logger.getLogger(ConferencesServiceImpl.class.getName());
+ private final HttpClient httpClient;
+ private final ServerConfiguration serverConfiguration;
+ private final Map authManagersByOasSecuritySchemes;
+ private final HttpMapper mapper;
- public ConferencesApi(
+ public ConferencesServiceImpl(
HttpClient httpClient,
ServerConfiguration serverConfiguration,
Map authManagersByOasSecuritySchemes,
@@ -54,29 +57,18 @@ public ConferencesApi(
this.mapper = mapper;
}
- /**
- * Get Conference Info Returns information about a conference that matches the provided conference
- * ID.
- *
- * @param conferenceId The unique identifier of the conference. The user sets this value.
- * (required)
- * @return GetConferenceInfoResponse
- * @throws ApiException if fails to make API call
- */
- public GetConferenceInfoResponse callingGetConferenceInfo(String conferenceId)
+ private CalloutResponse callouts(CalloutRequestInternal calloutRequestInternal)
throws ApiException {
- LOGGER.finest("[callingGetConferenceInfo]" + " " + "conferenceId: " + conferenceId);
+ LOGGER.finest("[callouts]" + " " + "calloutRequestInternal: " + calloutRequestInternal);
- HttpRequest httpRequest = callingGetConferenceInfoRequestBuilder(conferenceId);
+ HttpRequest httpRequest = calloutsRequestBuilder(calloutRequestInternal);
HttpResponse response =
httpClient.invokeAPI(
this.serverConfiguration, this.authManagersByOasSecuritySchemes, httpRequest);
if (HttpStatus.isSuccessfulStatus(response.getCode())) {
- TypeReference localVarReturnType =
- new TypeReference() {};
- return mapper.deserialize(response, localVarReturnType);
+ return mapper.deserialize(response, new TypeReference() {});
}
// fallback to default errors handling:
// all error cases definition are not required from specs: will try some "hardcoded" content
@@ -87,20 +79,10 @@ public GetConferenceInfoResponse callingGetConferenceInfo(String conferenceId)
mapper.deserialize(response, new TypeReference>() {}));
}
- private HttpRequest callingGetConferenceInfoRequestBuilder(String conferenceId)
+ private HttpRequest calloutsRequestBuilder(CalloutRequestInternal calloutRequestInternal)
throws ApiException {
- // verify the required parameter 'conferenceId' is set
- if (conferenceId == null) {
- throw new ApiException(
- 400,
- "Missing the required parameter 'conferenceId' when calling callingGetConferenceInfo");
- }
- String localVarPath =
- "/calling/v1/conferences/id/{conferenceId}"
- .replaceAll(
- "\\{" + "conferenceId" + "\\}",
- URLPathUtils.encodePathSegment(conferenceId.toString()));
+ String localVarPath = "/calling/v1/callouts";
List localVarQueryParams = new ArrayList<>();
@@ -108,14 +90,14 @@ private HttpRequest callingGetConferenceInfoRequestBuilder(String conferenceId)
final Collection localVarAccepts = Arrays.asList("application/json");
- final Collection localVarContentTypes = Arrays.asList();
+ final Collection localVarContentTypes = Arrays.asList("application/json");
final Collection localVarAuthNames = Arrays.asList("Basic", "Signed");
- final String serializedBody = null;
+ final String serializedBody = mapper.serialize(localVarContentTypes, calloutRequestInternal);
return new HttpRequest(
localVarPath,
- HttpMethod.GET,
+ HttpMethod.POST,
localVarQueryParams,
serializedBody,
localVarHeaderParams,
@@ -124,24 +106,18 @@ private HttpRequest callingGetConferenceInfoRequestBuilder(String conferenceId)
localVarAuthNames);
}
- /**
- * Kick Conference All Removes all participants from a conference.
- *
- * @param conferenceId The unique identifier of the conference. The user sets this value.
- * (required)
- * @throws ApiException if fails to make API call
- */
- public void callingKickConferenceAll(String conferenceId) throws ApiException {
+ @Override
+ public GetConferenceInfoResponse get(String conferenceId) throws ApiException {
- LOGGER.finest("[callingKickConferenceAll]" + " " + "conferenceId: " + conferenceId);
+ LOGGER.finest("[get]" + " " + "conferenceId: " + conferenceId);
- HttpRequest httpRequest = callingKickConferenceAllRequestBuilder(conferenceId);
+ HttpRequest httpRequest = getRequestBuilder(conferenceId);
HttpResponse response =
httpClient.invokeAPI(
this.serverConfiguration, this.authManagersByOasSecuritySchemes, httpRequest);
if (HttpStatus.isSuccessfulStatus(response.getCode())) {
- return;
+ return mapper.deserialize(response, new TypeReference() {});
}
// fallback to default errors handling:
// all error cases definition are not required from specs: will try some "hardcoded" content
@@ -152,13 +128,10 @@ public void callingKickConferenceAll(String conferenceId) throws ApiException {
mapper.deserialize(response, new TypeReference>() {}));
}
- private HttpRequest callingKickConferenceAllRequestBuilder(String conferenceId)
- throws ApiException {
+ private HttpRequest getRequestBuilder(String conferenceId) throws ApiException {
// verify the required parameter 'conferenceId' is set
if (conferenceId == null) {
- throw new ApiException(
- 400,
- "Missing the required parameter 'conferenceId' when calling callingKickConferenceAll");
+ throw new ApiException(400, "Missing the required parameter 'conferenceId' when calling get");
}
String localVarPath =
@@ -171,7 +144,7 @@ private HttpRequest callingKickConferenceAllRequestBuilder(String conferenceId)
Map localVarHeaderParams = new HashMap<>();
- final Collection localVarAccepts = Arrays.asList();
+ final Collection localVarAccepts = Arrays.asList("application/json");
final Collection localVarContentTypes = Arrays.asList();
@@ -180,7 +153,7 @@ private HttpRequest callingKickConferenceAllRequestBuilder(String conferenceId)
return new HttpRequest(
localVarPath,
- HttpMethod.DELETE,
+ HttpMethod.GET,
localVarQueryParams,
serializedBody,
localVarHeaderParams,
@@ -189,29 +162,12 @@ private HttpRequest callingKickConferenceAllRequestBuilder(String conferenceId)
localVarAuthNames);
}
- /**
- * Kick Conference Participant Remove a specified conference participant from a specified
- * conference.
- *
- * @param callId The unique identifier of the call. This value is generated by the system.
- * (required)
- * @param conferenceId The unique identifier of the conference. The user sets this value.
- * (required)
- * @throws ApiException if fails to make API call
- */
- public void callingKickConferenceParticipant(String callId, String conferenceId)
- throws ApiException {
+ @Override
+ public void kickAll(String conferenceId) throws ApiException {
- LOGGER.finest(
- "[callingKickConferenceParticipant]"
- + " "
- + "callId: "
- + callId
- + ", "
- + "conferenceId: "
- + conferenceId);
+ LOGGER.finest("[kickAll]" + " " + "conferenceId: " + conferenceId);
- HttpRequest httpRequest = callingKickConferenceParticipantRequestBuilder(callId, conferenceId);
+ HttpRequest httpRequest = kickAllRequestBuilder(conferenceId);
HttpResponse response =
httpClient.invokeAPI(
this.serverConfiguration, this.authManagersByOasSecuritySchemes, httpRequest);
@@ -228,25 +184,15 @@ public void callingKickConferenceParticipant(String callId, String conferenceId)
mapper.deserialize(response, new TypeReference>() {}));
}
- private HttpRequest callingKickConferenceParticipantRequestBuilder(
- String callId, String conferenceId) throws ApiException {
- // verify the required parameter 'callId' is set
- if (callId == null) {
- throw new ApiException(
- 400,
- "Missing the required parameter 'callId' when calling callingKickConferenceParticipant");
- }
+ private HttpRequest kickAllRequestBuilder(String conferenceId) throws ApiException {
// verify the required parameter 'conferenceId' is set
if (conferenceId == null) {
throw new ApiException(
- 400,
- "Missing the required parameter 'conferenceId' when calling"
- + " callingKickConferenceParticipant");
+ 400, "Missing the required parameter 'conferenceId' when calling kickAll");
}
String localVarPath =
- "/calling/v1/conferences/id/{conferenceId}/{callId}"
- .replaceAll("\\{" + "callId" + "\\}", URLPathUtils.encodePathSegment(callId.toString()))
+ "/calling/v1/conferences/id/{conferenceId}"
.replaceAll(
"\\{" + "conferenceId" + "\\}",
URLPathUtils.encodePathSegment(conferenceId.toString()));
@@ -255,7 +201,7 @@ private HttpRequest callingKickConferenceParticipantRequestBuilder(
Map localVarHeaderParams = new HashMap<>();
- final Collection localVarAccepts = Arrays.asList("application/json");
+ final Collection localVarAccepts = Arrays.asList();
final Collection localVarContentTypes = Arrays.asList();
@@ -273,38 +219,13 @@ private HttpRequest callingKickConferenceParticipantRequestBuilder(
localVarAuthNames);
}
- /**
- * Manage Conference Participant Manages conference participant in a specified conference: * mute
- * / unmute * put on hold / resume.
- *
- * @param callId The unique identifier of the call. This value is generated by the system.
- * (required)
- * @param conferenceId The unique identifier of the conference. The user sets this value.
- * (required)
- * @param manageConferenceParticipantRequest (optional)
- * @throws ApiException if fails to make API call
- */
- public void callingManageConferenceParticipant(
- String callId,
- String conferenceId,
- ManageConferenceParticipantRequest manageConferenceParticipantRequest)
- throws ApiException {
+ @Override
+ public void kickParticipant(String conferenceId, String callId) throws ApiException {
LOGGER.finest(
- "[callingManageConferenceParticipant]"
- + " "
- + "callId: "
- + callId
- + ", "
- + "conferenceId: "
- + conferenceId
- + ", "
- + "manageConferenceParticipantRequest: "
- + manageConferenceParticipantRequest);
+ "[kickParticipant]" + " " + "conferenceId: " + conferenceId + ", " + "callId: " + callId);
- HttpRequest httpRequest =
- callingManageConferenceParticipantRequestBuilder(
- callId, conferenceId, manageConferenceParticipantRequest);
+ HttpRequest httpRequest = kickParticipantRequestBuilder(conferenceId, callId);
HttpResponse response =
httpClient.invokeAPI(
this.serverConfiguration, this.authManagersByOasSecuritySchemes, httpRequest);
@@ -321,32 +242,26 @@ public void callingManageConferenceParticipant(
mapper.deserialize(response, new TypeReference>() {}));
}
- private HttpRequest callingManageConferenceParticipantRequestBuilder(
- String callId,
- String conferenceId,
- ManageConferenceParticipantRequest manageConferenceParticipantRequest)
+ private HttpRequest kickParticipantRequestBuilder(String conferenceId, String callId)
throws ApiException {
- // verify the required parameter 'callId' is set
- if (callId == null) {
- throw new ApiException(
- 400,
- "Missing the required parameter 'callId' when calling"
- + " callingManageConferenceParticipant");
- }
// verify the required parameter 'conferenceId' is set
if (conferenceId == null) {
throw new ApiException(
- 400,
- "Missing the required parameter 'conferenceId' when calling"
- + " callingManageConferenceParticipant");
+ 400, "Missing the required parameter 'conferenceId' when calling kickParticipant");
+ }
+ // verify the required parameter 'callId' is set
+ if (callId == null) {
+ throw new ApiException(
+ 400, "Missing the required parameter 'callId' when calling kickParticipant");
}
String localVarPath =
"/calling/v1/conferences/id/{conferenceId}/{callId}"
- .replaceAll("\\{" + "callId" + "\\}", URLPathUtils.encodePathSegment(callId.toString()))
.replaceAll(
"\\{" + "conferenceId" + "\\}",
- URLPathUtils.encodePathSegment(conferenceId.toString()));
+ URLPathUtils.encodePathSegment(conferenceId.toString()))
+ .replaceAll(
+ "\\{" + "callId" + "\\}", URLPathUtils.encodePathSegment(callId.toString()));
List localVarQueryParams = new ArrayList<>();
@@ -354,15 +269,14 @@ private HttpRequest callingManageConferenceParticipantRequestBuilder(
final Collection localVarAccepts = Arrays.asList("application/json");
- final Collection localVarContentTypes = Arrays.asList("application/json");
+ final Collection localVarContentTypes = Arrays.asList();
final Collection localVarAuthNames = Arrays.asList("Basic", "Signed");
- final String serializedBody =
- mapper.serialize(localVarContentTypes, manageConferenceParticipantRequest);
+ final String serializedBody = null;
return new HttpRequest(
localVarPath,
- HttpMethod.PATCH,
+ HttpMethod.DELETE,
localVarQueryParams,
serializedBody,
localVarHeaderParams,
@@ -371,28 +285,33 @@ private HttpRequest callingManageConferenceParticipantRequestBuilder(
localVarAuthNames);
}
- /**
- * Callout Request Makes a call out to a phone number. The types of callouts currently supported
- * are conference callouts, text-to-speech callouts, and custom callouts. The custom callout is
- * the most flexible, but text-to-speech and conference callouts are more convenient.
- *
- * @param calloutRequestInternal (optional)
- * @return CalloutResponse
- * @throws ApiException if fails to make API call
- */
- public CalloutResponse callouts(CalloutRequestInternal calloutRequestInternal)
+ @Override
+ public void manageParticipant(
+ String conferenceId,
+ String callId,
+ ManageConferenceParticipantRequest manageConferenceParticipantRequest)
throws ApiException {
- LOGGER.finest("[callouts]" + " " + "calloutRequestInternal: " + calloutRequestInternal);
+ LOGGER.finest(
+ "[manageParticipant]"
+ + " "
+ + "conferenceId: "
+ + conferenceId
+ + ", "
+ + "callId: "
+ + callId
+ + ", "
+ + "manageConferenceParticipantRequest: "
+ + manageConferenceParticipantRequest);
- HttpRequest httpRequest = calloutsRequestBuilder(calloutRequestInternal);
+ HttpRequest httpRequest =
+ manageParticipantRequestBuilder(conferenceId, callId, manageConferenceParticipantRequest);
HttpResponse response =
httpClient.invokeAPI(
this.serverConfiguration, this.authManagersByOasSecuritySchemes, httpRequest);
if (HttpStatus.isSuccessfulStatus(response.getCode())) {
- TypeReference localVarReturnType = new TypeReference() {};
- return mapper.deserialize(response, localVarReturnType);
+ return;
}
// fallback to default errors handling:
// all error cases definition are not required from specs: will try some "hardcoded" content
@@ -403,10 +322,29 @@ public CalloutResponse callouts(CalloutRequestInternal calloutRequestInternal)
mapper.deserialize(response, new TypeReference>() {}));
}
- private HttpRequest calloutsRequestBuilder(CalloutRequestInternal calloutRequestInternal)
+ private HttpRequest manageParticipantRequestBuilder(
+ String conferenceId,
+ String callId,
+ ManageConferenceParticipantRequest manageConferenceParticipantRequest)
throws ApiException {
+ // verify the required parameter 'conferenceId' is set
+ if (conferenceId == null) {
+ throw new ApiException(
+ 400, "Missing the required parameter 'conferenceId' when calling manageParticipant");
+ }
+ // verify the required parameter 'callId' is set
+ if (callId == null) {
+ throw new ApiException(
+ 400, "Missing the required parameter 'callId' when calling manageParticipant");
+ }
- String localVarPath = "/calling/v1/callouts";
+ String localVarPath =
+ "/calling/v1/conferences/id/{conferenceId}/{callId}"
+ .replaceAll(
+ "\\{" + "conferenceId" + "\\}",
+ URLPathUtils.encodePathSegment(conferenceId.toString()))
+ .replaceAll(
+ "\\{" + "callId" + "\\}", URLPathUtils.encodePathSegment(callId.toString()));
List localVarQueryParams = new ArrayList<>();
@@ -417,11 +355,12 @@ private HttpRequest calloutsRequestBuilder(CalloutRequestInternal calloutRequest
final Collection localVarContentTypes = Arrays.asList("application/json");
final Collection localVarAuthNames = Arrays.asList("Basic", "Signed");
- final String serializedBody = mapper.serialize(localVarContentTypes, calloutRequestInternal);
+ final String serializedBody =
+ mapper.serialize(localVarContentTypes, manageConferenceParticipantRequest);
return new HttpRequest(
localVarPath,
- HttpMethod.POST,
+ HttpMethod.PATCH,
localVarQueryParams,
serializedBody,
localVarHeaderParams,
@@ -429,4 +368,15 @@ private HttpRequest calloutsRequestBuilder(CalloutRequestInternal calloutRequest
localVarContentTypes,
localVarAuthNames);
}
+
+ public String call(CalloutRequestConference parameters) {
+
+ CalloutRequestInternalImpl request = new CalloutRequestInternalImpl();
+ request.setActualInstance(parameters);
+ CalloutResponse response = callouts(request);
+ if (null == response) {
+ return null;
+ }
+ return response.getCallId();
+ }
}
diff --git a/openapi-contracts/src/main/com/sinch/sdk/domains/voice/models/v1/applications/response/OwnedNumbersListResponse.java b/openapi-contracts/src/main/com/sinch/sdk/domains/voice/models/v1/applications/response/OwnedNumbersListResponse.java
new file mode 100644
index 000000000..fc4d72cce
--- /dev/null
+++ b/openapi-contracts/src/main/com/sinch/sdk/domains/voice/models/v1/applications/response/OwnedNumbersListResponse.java
@@ -0,0 +1,47 @@
+/*
+ * Voice API | Sinch
+ *
+ * OpenAPI document version: 1.0.1
+ * Contact: support@sinch.com
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * Do not edit the class manually.
+ */
+
+package com.sinch.sdk.domains.voice.models.v1.applications.response;
+
+import com.sinch.sdk.core.models.pagination.ListResponse;
+import com.sinch.sdk.core.models.pagination.Page;
+import java.util.Collection;
+import java.util.Collections;
+
+/** Auto paginated response for list of OwnedNumberInformation */
+public class OwnedNumbersListResponse extends ListResponse {
+
+ private final Page