From b3ff3c6f9a581c10ec04d2a3e92319dff08adea3 Mon Sep 17 00:00:00 2001 From: Sudhanshu Moghe Date: Thu, 11 Dec 2025 10:47:07 -0500 Subject: [PATCH 1/7] feat: Add Page, SipConnectionMetadata, and SipCredentials models - Implemented Page model with pagination attributes including pageSize, totalElements, totalPages, and pageNumber. - Added SipConnectionMetadata model to encapsulate SIP connection details such as ipAddress, port, credentials, and uuiHeader. - Created SipCredentials model for managing SIP authentication with username and password fields. - Each model includes methods for JSON serialization/deserialization and validation. - Introduced support for additional undeclared properties in each model. --- .openapi-generator/FILES | 46 + README.md | 27 + api/openapi.yaml | 1605 ++- bandwidth.yml | 8585 +---------------- docs/CreateEndpointRequestBase.md | 17 + docs/CreateEndpointResponse.md | 15 + docs/CreateEndpointResponseObject.md | 20 + docs/CreateWebRtcConnectionRequest.md | 18 + docs/Device.md | 16 + docs/DeviceStatusEnum.md | 13 + docs/Endpoint.md | 19 + docs/EndpointDirectionEnum.md | 15 + docs/EndpointEvent.md | 22 + docs/EndpointEventTypeEnum.md | 13 + docs/EndpointResponse.md | 15 + docs/EndpointStatusEnum.md | 13 + docs/EndpointTypeEnum.md | 11 + docs/Endpoints.md | 18 + docs/EndpointsApi.md | 429 + docs/Error1.md | 17 + docs/Error1Source.md | 16 + docs/ErrorResponse.md | 15 + docs/Link1.md | 25 + docs/ListEndpointsResponse.md | 16 + docs/Page.md | 16 + docs/SipConnectionMetadata.md | 16 + docs/SipCredentials.md | 14 + src/main/java/com/bandwidth/sdk/JSON.java | 17 + .../com/bandwidth/sdk/api/EndpointsApi.java | 950 ++ .../sdk/model/CreateEndpointRequestBase.java | 412 + .../sdk/model/CreateEndpointResponse.java | 387 + .../model/CreateEndpointResponseObject.java | 515 + .../model/CreateWebRtcConnectionRequest.java | 438 + .../java/com/bandwidth/sdk/model/Device.java | 380 + .../bandwidth/sdk/model/DeviceStatusEnum.java | 80 + .../com/bandwidth/sdk/model/Endpoint.java | 486 + .../sdk/model/EndpointDirectionEnum.java | 82 + .../bandwidth/sdk/model/EndpointEvent.java | 521 + .../sdk/model/EndpointEventTypeEnum.java | 80 + .../bandwidth/sdk/model/EndpointResponse.java | 387 + .../sdk/model/EndpointStatusEnum.java | 80 + .../bandwidth/sdk/model/EndpointTypeEnum.java | 78 + .../com/bandwidth/sdk/model/Endpoints.java | 435 + .../java/com/bandwidth/sdk/model/Error1.java | 414 + .../com/bandwidth/sdk/model/Error1Source.java | 375 + .../bandwidth/sdk/model/ErrorResponse.java | 384 + .../java/com/bandwidth/sdk/model/Link1.java | 404 + .../sdk/model/ListEndpointsResponse.java | 434 + .../java/com/bandwidth/sdk/model/Page.java | 374 + .../sdk/model/SipConnectionMetadata.java | 374 + .../bandwidth/sdk/model/SipCredentials.java | 317 + 51 files changed, 10848 insertions(+), 8608 deletions(-) mode change 100644 => 120000 bandwidth.yml create mode 100644 docs/CreateEndpointRequestBase.md create mode 100644 docs/CreateEndpointResponse.md create mode 100644 docs/CreateEndpointResponseObject.md create mode 100644 docs/CreateWebRtcConnectionRequest.md create mode 100644 docs/Device.md create mode 100644 docs/DeviceStatusEnum.md create mode 100644 docs/Endpoint.md create mode 100644 docs/EndpointDirectionEnum.md create mode 100644 docs/EndpointEvent.md create mode 100644 docs/EndpointEventTypeEnum.md create mode 100644 docs/EndpointResponse.md create mode 100644 docs/EndpointStatusEnum.md create mode 100644 docs/EndpointTypeEnum.md create mode 100644 docs/Endpoints.md create mode 100644 docs/EndpointsApi.md create mode 100644 docs/Error1.md create mode 100644 docs/Error1Source.md create mode 100644 docs/ErrorResponse.md create mode 100644 docs/Link1.md create mode 100644 docs/ListEndpointsResponse.md create mode 100644 docs/Page.md create mode 100644 docs/SipConnectionMetadata.md create mode 100644 docs/SipCredentials.md create mode 100644 src/main/java/com/bandwidth/sdk/api/EndpointsApi.java create mode 100644 src/main/java/com/bandwidth/sdk/model/CreateEndpointRequestBase.java create mode 100644 src/main/java/com/bandwidth/sdk/model/CreateEndpointResponse.java create mode 100644 src/main/java/com/bandwidth/sdk/model/CreateEndpointResponseObject.java create mode 100644 src/main/java/com/bandwidth/sdk/model/CreateWebRtcConnectionRequest.java create mode 100644 src/main/java/com/bandwidth/sdk/model/Device.java create mode 100644 src/main/java/com/bandwidth/sdk/model/DeviceStatusEnum.java create mode 100644 src/main/java/com/bandwidth/sdk/model/Endpoint.java create mode 100644 src/main/java/com/bandwidth/sdk/model/EndpointDirectionEnum.java create mode 100644 src/main/java/com/bandwidth/sdk/model/EndpointEvent.java create mode 100644 src/main/java/com/bandwidth/sdk/model/EndpointEventTypeEnum.java create mode 100644 src/main/java/com/bandwidth/sdk/model/EndpointResponse.java create mode 100644 src/main/java/com/bandwidth/sdk/model/EndpointStatusEnum.java create mode 100644 src/main/java/com/bandwidth/sdk/model/EndpointTypeEnum.java create mode 100644 src/main/java/com/bandwidth/sdk/model/Endpoints.java create mode 100644 src/main/java/com/bandwidth/sdk/model/Error1.java create mode 100644 src/main/java/com/bandwidth/sdk/model/Error1Source.java create mode 100644 src/main/java/com/bandwidth/sdk/model/ErrorResponse.java create mode 100644 src/main/java/com/bandwidth/sdk/model/Link1.java create mode 100644 src/main/java/com/bandwidth/sdk/model/ListEndpointsResponse.java create mode 100644 src/main/java/com/bandwidth/sdk/model/Page.java create mode 100644 src/main/java/com/bandwidth/sdk/model/SipConnectionMetadata.java create mode 100644 src/main/java/com/bandwidth/sdk/model/SipCredentials.java diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 5a4b9a89..51e74d6f 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -44,16 +44,34 @@ docs/CreateAsyncBulkLookupResponse.md docs/CreateAsyncBulkLookupResponseData.md docs/CreateCall.md docs/CreateCallResponse.md +docs/CreateEndpointRequestBase.md +docs/CreateEndpointResponse.md +docs/CreateEndpointResponseObject.md docs/CreateMessageRequestError.md docs/CreateMultiChannelMessageResponse.md docs/CreateSyncLookupResponse.md docs/CreateSyncLookupResponseData.md +docs/CreateWebRtcConnectionRequest.md docs/DeactivationEventEnum.md +docs/Device.md +docs/DeviceStatusEnum.md docs/DisconnectCallback.md docs/Diversion.md docs/DtmfCallback.md +docs/Endpoint.md +docs/EndpointDirectionEnum.md +docs/EndpointEvent.md +docs/EndpointEventTypeEnum.md +docs/EndpointResponse.md +docs/EndpointStatusEnum.md +docs/EndpointTypeEnum.md +docs/Endpoints.md +docs/EndpointsApi.md docs/Error.md +docs/Error1.md +docs/Error1Source.md docs/ErrorObject.md +docs/ErrorResponse.md docs/ErrorSource.md docs/FailureWebhook.md docs/FieldError.md @@ -69,8 +87,10 @@ docs/InitiateCallback.md docs/LatestMessageDeliveryStatusEnum.md docs/LineTypeEnum.md docs/Link.md +docs/Link1.md docs/LinkSchema.md docs/LinksObject.md +docs/ListEndpointsResponse.md docs/ListMessageDirectionEnum.md docs/ListMessageItem.md docs/LookupErrorResponse.md @@ -118,6 +138,7 @@ docs/MultiChannelMessageContent.md docs/MultiChannelMessageRequest.md docs/MultiChannelMessageResponseData.md docs/OptInWorkflow.md +docs/Page.md docs/PageInfo.md docs/PhoneNumberLookupApi.md docs/PriorityEnum.md @@ -148,6 +169,8 @@ docs/RecordingTranscriptions.md docs/RecordingsApi.md docs/RedirectCallback.md docs/RedirectMethodEnum.md +docs/SipConnectionMetadata.md +docs/SipCredentials.md docs/SmsMessageContent.md docs/StandaloneCardOrientationEnum.md docs/StatisticsApi.md @@ -214,6 +237,7 @@ src/main/java/com/bandwidth/sdk/ServerVariable.java src/main/java/com/bandwidth/sdk/StringUtil.java src/main/java/com/bandwidth/sdk/api/CallsApi.java src/main/java/com/bandwidth/sdk/api/ConferencesApi.java +src/main/java/com/bandwidth/sdk/api/EndpointsApi.java src/main/java/com/bandwidth/sdk/api/MediaApi.java src/main/java/com/bandwidth/sdk/api/MessagesApi.java src/main/java/com/bandwidth/sdk/api/MfaApi.java @@ -271,16 +295,33 @@ src/main/java/com/bandwidth/sdk/model/CreateAsyncBulkLookupResponse.java src/main/java/com/bandwidth/sdk/model/CreateAsyncBulkLookupResponseData.java src/main/java/com/bandwidth/sdk/model/CreateCall.java src/main/java/com/bandwidth/sdk/model/CreateCallResponse.java +src/main/java/com/bandwidth/sdk/model/CreateEndpointRequestBase.java +src/main/java/com/bandwidth/sdk/model/CreateEndpointResponse.java +src/main/java/com/bandwidth/sdk/model/CreateEndpointResponseObject.java src/main/java/com/bandwidth/sdk/model/CreateMessageRequestError.java src/main/java/com/bandwidth/sdk/model/CreateMultiChannelMessageResponse.java src/main/java/com/bandwidth/sdk/model/CreateSyncLookupResponse.java src/main/java/com/bandwidth/sdk/model/CreateSyncLookupResponseData.java +src/main/java/com/bandwidth/sdk/model/CreateWebRtcConnectionRequest.java src/main/java/com/bandwidth/sdk/model/DeactivationEventEnum.java +src/main/java/com/bandwidth/sdk/model/Device.java +src/main/java/com/bandwidth/sdk/model/DeviceStatusEnum.java src/main/java/com/bandwidth/sdk/model/DisconnectCallback.java src/main/java/com/bandwidth/sdk/model/Diversion.java src/main/java/com/bandwidth/sdk/model/DtmfCallback.java +src/main/java/com/bandwidth/sdk/model/Endpoint.java +src/main/java/com/bandwidth/sdk/model/EndpointDirectionEnum.java +src/main/java/com/bandwidth/sdk/model/EndpointEvent.java +src/main/java/com/bandwidth/sdk/model/EndpointEventTypeEnum.java +src/main/java/com/bandwidth/sdk/model/EndpointResponse.java +src/main/java/com/bandwidth/sdk/model/EndpointStatusEnum.java +src/main/java/com/bandwidth/sdk/model/EndpointTypeEnum.java +src/main/java/com/bandwidth/sdk/model/Endpoints.java src/main/java/com/bandwidth/sdk/model/Error.java +src/main/java/com/bandwidth/sdk/model/Error1.java +src/main/java/com/bandwidth/sdk/model/Error1Source.java src/main/java/com/bandwidth/sdk/model/ErrorObject.java +src/main/java/com/bandwidth/sdk/model/ErrorResponse.java src/main/java/com/bandwidth/sdk/model/ErrorSource.java src/main/java/com/bandwidth/sdk/model/FailureWebhook.java src/main/java/com/bandwidth/sdk/model/FieldError.java @@ -296,8 +337,10 @@ src/main/java/com/bandwidth/sdk/model/InitiateCallback.java src/main/java/com/bandwidth/sdk/model/LatestMessageDeliveryStatusEnum.java src/main/java/com/bandwidth/sdk/model/LineTypeEnum.java src/main/java/com/bandwidth/sdk/model/Link.java +src/main/java/com/bandwidth/sdk/model/Link1.java src/main/java/com/bandwidth/sdk/model/LinkSchema.java src/main/java/com/bandwidth/sdk/model/LinksObject.java +src/main/java/com/bandwidth/sdk/model/ListEndpointsResponse.java src/main/java/com/bandwidth/sdk/model/ListMessageDirectionEnum.java src/main/java/com/bandwidth/sdk/model/ListMessageItem.java src/main/java/com/bandwidth/sdk/model/LookupErrorResponse.java @@ -341,6 +384,7 @@ src/main/java/com/bandwidth/sdk/model/MultiChannelMessageContent.java src/main/java/com/bandwidth/sdk/model/MultiChannelMessageRequest.java src/main/java/com/bandwidth/sdk/model/MultiChannelMessageResponseData.java src/main/java/com/bandwidth/sdk/model/OptInWorkflow.java +src/main/java/com/bandwidth/sdk/model/Page.java src/main/java/com/bandwidth/sdk/model/PageInfo.java src/main/java/com/bandwidth/sdk/model/PriorityEnum.java src/main/java/com/bandwidth/sdk/model/ProductTypeEnum.java @@ -369,6 +413,8 @@ src/main/java/com/bandwidth/sdk/model/RecordingTranscriptionMetadata.java src/main/java/com/bandwidth/sdk/model/RecordingTranscriptions.java src/main/java/com/bandwidth/sdk/model/RedirectCallback.java src/main/java/com/bandwidth/sdk/model/RedirectMethodEnum.java +src/main/java/com/bandwidth/sdk/model/SipConnectionMetadata.java +src/main/java/com/bandwidth/sdk/model/SipCredentials.java src/main/java/com/bandwidth/sdk/model/SmsMessageContent.java src/main/java/com/bandwidth/sdk/model/StandaloneCardOrientationEnum.java src/main/java/com/bandwidth/sdk/model/StatusCallback.java diff --git a/README.md b/README.md index 11380861..186a0e7f 100644 --- a/README.md +++ b/README.md @@ -143,6 +143,11 @@ Class | Method | HTTP request | Description *ConferencesApi* | [**updateConference**](docs/ConferencesApi.md#updateConference) | **POST** /accounts/{accountId}/conferences/{conferenceId} | Update Conference *ConferencesApi* | [**updateConferenceBxml**](docs/ConferencesApi.md#updateConferenceBxml) | **PUT** /accounts/{accountId}/conferences/{conferenceId}/bxml | Update Conference BXML *ConferencesApi* | [**updateConferenceMember**](docs/ConferencesApi.md#updateConferenceMember) | **PUT** /accounts/{accountId}/conferences/{conferenceId}/members/{memberId} | Update Conference Member +*EndpointsApi* | [**createEndpoint**](docs/EndpointsApi.md#createEndpoint) | **POST** /accounts/{accountId}/endpoints | Create Endpoint +*EndpointsApi* | [**deleteEndpoint**](docs/EndpointsApi.md#deleteEndpoint) | **DELETE** /accounts/{accountId}/endpoints/{endpointId} | Delete Endpoint +*EndpointsApi* | [**getEndpoint**](docs/EndpointsApi.md#getEndpoint) | **GET** /accounts/{accountId}/endpoints/{endpointId} | Get Endpoint +*EndpointsApi* | [**listEndpoints**](docs/EndpointsApi.md#listEndpoints) | **GET** /accounts/{accountId}/endpoints | List Endpoints +*EndpointsApi* | [**updateEndpointBxml**](docs/EndpointsApi.md#updateEndpointBxml) | **PUT** /accounts/{accountId}/endpoints/{endpointId}/bxml | Update Endpoint BXML *MediaApi* | [**deleteMedia**](docs/MediaApi.md#deleteMedia) | **DELETE** /users/{accountId}/media/{mediaId} | Delete Media *MediaApi* | [**getMedia**](docs/MediaApi.md#getMedia) | **GET** /users/{accountId}/media/{mediaId} | Get Media *MediaApi* | [**listMedia**](docs/MediaApi.md#listMedia) | **GET** /users/{accountId}/media | List Media @@ -222,16 +227,33 @@ Class | Method | HTTP request | Description - [CreateAsyncBulkLookupResponseData](docs/CreateAsyncBulkLookupResponseData.md) - [CreateCall](docs/CreateCall.md) - [CreateCallResponse](docs/CreateCallResponse.md) + - [CreateEndpointRequestBase](docs/CreateEndpointRequestBase.md) + - [CreateEndpointResponse](docs/CreateEndpointResponse.md) + - [CreateEndpointResponseObject](docs/CreateEndpointResponseObject.md) - [CreateMessageRequestError](docs/CreateMessageRequestError.md) - [CreateMultiChannelMessageResponse](docs/CreateMultiChannelMessageResponse.md) - [CreateSyncLookupResponse](docs/CreateSyncLookupResponse.md) - [CreateSyncLookupResponseData](docs/CreateSyncLookupResponseData.md) + - [CreateWebRtcConnectionRequest](docs/CreateWebRtcConnectionRequest.md) - [DeactivationEventEnum](docs/DeactivationEventEnum.md) + - [Device](docs/Device.md) + - [DeviceStatusEnum](docs/DeviceStatusEnum.md) - [DisconnectCallback](docs/DisconnectCallback.md) - [Diversion](docs/Diversion.md) - [DtmfCallback](docs/DtmfCallback.md) + - [Endpoint](docs/Endpoint.md) + - [EndpointDirectionEnum](docs/EndpointDirectionEnum.md) + - [EndpointEvent](docs/EndpointEvent.md) + - [EndpointEventTypeEnum](docs/EndpointEventTypeEnum.md) + - [EndpointResponse](docs/EndpointResponse.md) + - [EndpointStatusEnum](docs/EndpointStatusEnum.md) + - [EndpointTypeEnum](docs/EndpointTypeEnum.md) + - [Endpoints](docs/Endpoints.md) - [Error](docs/Error.md) + - [Error1](docs/Error1.md) + - [Error1Source](docs/Error1Source.md) - [ErrorObject](docs/ErrorObject.md) + - [ErrorResponse](docs/ErrorResponse.md) - [ErrorSource](docs/ErrorSource.md) - [FailureWebhook](docs/FailureWebhook.md) - [FieldError](docs/FieldError.md) @@ -247,8 +269,10 @@ Class | Method | HTTP request | Description - [LatestMessageDeliveryStatusEnum](docs/LatestMessageDeliveryStatusEnum.md) - [LineTypeEnum](docs/LineTypeEnum.md) - [Link](docs/Link.md) + - [Link1](docs/Link1.md) - [LinkSchema](docs/LinkSchema.md) - [LinksObject](docs/LinksObject.md) + - [ListEndpointsResponse](docs/ListEndpointsResponse.md) - [ListMessageDirectionEnum](docs/ListMessageDirectionEnum.md) - [ListMessageItem](docs/ListMessageItem.md) - [LookupErrorResponse](docs/LookupErrorResponse.md) @@ -292,6 +316,7 @@ Class | Method | HTTP request | Description - [MultiChannelMessageRequest](docs/MultiChannelMessageRequest.md) - [MultiChannelMessageResponseData](docs/MultiChannelMessageResponseData.md) - [OptInWorkflow](docs/OptInWorkflow.md) + - [Page](docs/Page.md) - [PageInfo](docs/PageInfo.md) - [PriorityEnum](docs/PriorityEnum.md) - [ProductTypeEnum](docs/ProductTypeEnum.md) @@ -320,6 +345,8 @@ Class | Method | HTTP request | Description - [RecordingTranscriptions](docs/RecordingTranscriptions.md) - [RedirectCallback](docs/RedirectCallback.md) - [RedirectMethodEnum](docs/RedirectMethodEnum.md) + - [SipConnectionMetadata](docs/SipConnectionMetadata.md) + - [SipCredentials](docs/SipCredentials.md) - [SmsMessageContent](docs/SmsMessageContent.md) - [StandaloneCardOrientationEnum](docs/StandaloneCardOrientationEnum.md) - [StatusCallback](docs/StatusCallback.md) diff --git a/api/openapi.yaml b/api/openapi.yaml index 58e13dcf..7e6de6fd 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -24,6 +24,7 @@ tags: - name: MFA - name: Phone Number Lookup - name: Toll-Free Verification +- name: Endpoints paths: /users/{accountId}/media: get: @@ -5812,6 +5813,579 @@ paths: servers: - description: Production url: https://api.bandwidth.com/api/v2 + /accounts/{accountId}/endpoints: + get: + description: Returns a list of endpoints associated with the specified account. + operationId: listEndpoints + parameters: + - description: Your Bandwidth Account ID. + explode: false + in: path + name: accountId + required: true + schema: + example: "5500123" + type: string + style: simple + - description: The type of endpoint. + explode: true + in: query + name: type + required: false + schema: + $ref: "#/components/schemas/endpointTypeEnum" + style: form + - description: The status of the endpoint. + explode: true + in: query + name: status + required: false + schema: + $ref: "#/components/schemas/endpointStatusEnum" + style: form + - description: The cursor to use for pagination. This is the value of the `next` + link in the previous response. + explode: true + in: query + name: afterCursor + required: false + schema: + example: TWF5IHRoZSBmb3JjZSBiZSB3aXRoIHlvdQ== + type: string + style: form + - description: The maximum number of endpoints to return in the response. + explode: true + in: query + name: limit + required: false + schema: + default: 100 + example: 2 + maximum: 1000 + minimum: 1 + type: integer + style: form + responses: + "200": + content: + application/json: + examples: + listEndpointsResponseExample: + $ref: "#/components/examples/listEndpointsResponseExample" + schema: + $ref: "#/components/schemas/listEndpointsResponse" + description: OK + "400": + content: + application/json: + examples: + badRequestErrorExample: + $ref: "#/components/examples/badRequestErrorExample" + schema: + $ref: "#/components/schemas/errorResponse" + description: Bad Request + "401": + content: + application/json: + examples: + unauthorizedErrorExample: + $ref: "#/components/examples/unauthorizedErrorExample" + schema: + $ref: "#/components/schemas/errorResponse" + description: Unauthorized + "403": + content: + application/json: + examples: + forbiddenErrorExample: + $ref: "#/components/examples/forbiddenErrorExample" + schema: + $ref: "#/components/schemas/errorResponse" + description: Forbidden + "404": + content: + application/json: + examples: + notFoundErrorExample: + $ref: "#/components/examples/notFoundErrorExample" + schema: + $ref: "#/components/schemas/errorResponse" + description: Not Found + "405": + content: + application/json: + examples: + methodNotAllowedErrorExample: + $ref: "#/components/examples/methodNotAllowedErrorExample" + schema: + $ref: "#/components/schemas/errorResponse" + description: Method Not Allowed + "415": + content: + application/json: + examples: + unsuppotedMediaTypeErrorExample: + $ref: "#/components/examples/unsupportedMediaTypeErrorExample" + schema: + $ref: "#/components/schemas/errorResponse" + description: Unsupported Media Type + "429": + content: + application/json: + examples: + tooManyRequestsErrorExample: + $ref: "#/components/examples/tooManyRequestsErrorExample" + schema: + $ref: "#/components/schemas/errorResponse" + description: Too Many Requests + "500": + content: + application/json: + examples: + serviceUnavailableErrorExample: + $ref: "#/components/examples/serviceUnavailableErrorExample" + schema: + $ref: "#/components/schemas/errorResponse" + description: Service Unavailable + summary: List Endpoints + tags: + - Endpoints + x-accepts: + - application/json + post: + callbacks: + endpointEventCallback: + $ref: "#/components/callbacks/endpointEvent" + description: Creates a new Endpoint for the specified account. + operationId: createEndpoint + parameters: + - description: Your Bandwidth Account ID. + explode: false + in: path + name: accountId + required: true + schema: + example: "5500123" + type: string + style: simple + requestBody: + $ref: "#/components/requestBodies/createEndpointRequest" + responses: + "201": + content: + application/json: + examples: + createEndpointResponseExample: + $ref: "#/components/examples/createEndpointResponseExample" + schema: + $ref: "#/components/schemas/createEndpointResponse" + description: Created + "400": + content: + application/json: + examples: + badRequestErrorExample: + $ref: "#/components/examples/badRequestErrorExample" + schema: + $ref: "#/components/schemas/errorResponse" + description: Bad Request + "401": + content: + application/json: + examples: + unauthorizedErrorExample: + $ref: "#/components/examples/unauthorizedErrorExample" + schema: + $ref: "#/components/schemas/errorResponse" + description: Unauthorized + "403": + content: + application/json: + examples: + forbiddenErrorExample: + $ref: "#/components/examples/forbiddenErrorExample" + schema: + $ref: "#/components/schemas/errorResponse" + description: Forbidden + "404": + content: + application/json: + examples: + notFoundErrorExample: + $ref: "#/components/examples/notFoundErrorExample" + schema: + $ref: "#/components/schemas/errorResponse" + description: Not Found + "405": + content: + application/json: + examples: + methodNotAllowedErrorExample: + $ref: "#/components/examples/methodNotAllowedErrorExample" + schema: + $ref: "#/components/schemas/errorResponse" + description: Method Not Allowed + "415": + content: + application/json: + examples: + unsuppotedMediaTypeErrorExample: + $ref: "#/components/examples/unsupportedMediaTypeErrorExample" + schema: + $ref: "#/components/schemas/errorResponse" + description: Unsupported Media Type + "429": + content: + application/json: + examples: + tooManyRequestsErrorExample: + $ref: "#/components/examples/tooManyRequestsErrorExample" + schema: + $ref: "#/components/schemas/errorResponse" + description: Too Many Requests + "500": + content: + application/json: + examples: + serviceUnavailableErrorExample: + $ref: "#/components/examples/serviceUnavailableErrorExample" + schema: + $ref: "#/components/schemas/errorResponse" + description: Service Unavailable + summary: Create Endpoint + tags: + - Endpoints + x-content-type: application/json + x-accepts: + - application/json + servers: + - description: Production + url: https://api.bandwidth.com/v2 + /accounts/{accountId}/endpoints/{endpointId}: + delete: + description: "Deletes the specified endpoint. If the endpoint is actively streaming\ + \ media, the media stream will be terminated." + operationId: deleteEndpoint + parameters: + - description: Your Bandwidth Account ID. + explode: false + in: path + name: accountId + required: true + schema: + example: "5500123" + type: string + style: simple + - description: BRTC Endpoint ID. + explode: false + in: path + name: endpointId + required: true + schema: + example: e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + type: string + style: simple + responses: + "204": + description: No Content + "400": + content: + application/json: + examples: + badRequestErrorExample: + $ref: "#/components/examples/badRequestErrorExample" + schema: + $ref: "#/components/schemas/errorResponse" + description: Bad Request + "401": + content: + application/json: + examples: + unauthorizedErrorExample: + $ref: "#/components/examples/unauthorizedErrorExample" + schema: + $ref: "#/components/schemas/errorResponse" + description: Unauthorized + "403": + content: + application/json: + examples: + forbiddenErrorExample: + $ref: "#/components/examples/forbiddenErrorExample" + schema: + $ref: "#/components/schemas/errorResponse" + description: Forbidden + "404": + content: + application/json: + examples: + notFoundErrorExample: + $ref: "#/components/examples/notFoundErrorExample" + schema: + $ref: "#/components/schemas/errorResponse" + description: Not Found + "405": + content: + application/json: + examples: + methodNotAllowedErrorExample: + $ref: "#/components/examples/methodNotAllowedErrorExample" + schema: + $ref: "#/components/schemas/errorResponse" + description: Method Not Allowed + "415": + content: + application/json: + examples: + unsuppotedMediaTypeErrorExample: + $ref: "#/components/examples/unsupportedMediaTypeErrorExample" + schema: + $ref: "#/components/schemas/errorResponse" + description: Unsupported Media Type + "429": + content: + application/json: + examples: + tooManyRequestsErrorExample: + $ref: "#/components/examples/tooManyRequestsErrorExample" + schema: + $ref: "#/components/schemas/errorResponse" + description: Too Many Requests + "500": + content: + application/json: + examples: + serviceUnavailableErrorExample: + $ref: "#/components/examples/serviceUnavailableErrorExample" + schema: + $ref: "#/components/schemas/errorResponse" + description: Service Unavailable + summary: Delete Endpoint + tags: + - Endpoints + x-accepts: + - application/json + get: + description: Returns information about the specified endpoint. + operationId: getEndpoint + parameters: + - description: Your Bandwidth Account ID. + explode: false + in: path + name: accountId + required: true + schema: + example: "5500123" + type: string + style: simple + - description: BRTC Endpoint ID. + explode: false + in: path + name: endpointId + required: true + schema: + example: e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + type: string + style: simple + responses: + "200": + content: + application/json: + examples: + getEndpointResponseExample: + $ref: "#/components/examples/getEndpointResponseExample" + schema: + $ref: "#/components/schemas/endpointResponse" + description: OK + "400": + content: + application/json: + examples: + badRequestErrorExample: + $ref: "#/components/examples/badRequestErrorExample" + schema: + $ref: "#/components/schemas/errorResponse" + description: Bad Request + "401": + content: + application/json: + examples: + unauthorizedErrorExample: + $ref: "#/components/examples/unauthorizedErrorExample" + schema: + $ref: "#/components/schemas/errorResponse" + description: Unauthorized + "403": + content: + application/json: + examples: + forbiddenErrorExample: + $ref: "#/components/examples/forbiddenErrorExample" + schema: + $ref: "#/components/schemas/errorResponse" + description: Forbidden + "404": + content: + application/json: + examples: + notFoundErrorExample: + $ref: "#/components/examples/notFoundErrorExample" + schema: + $ref: "#/components/schemas/errorResponse" + description: Not Found + "405": + content: + application/json: + examples: + methodNotAllowedErrorExample: + $ref: "#/components/examples/methodNotAllowedErrorExample" + schema: + $ref: "#/components/schemas/errorResponse" + description: Method Not Allowed + "415": + content: + application/json: + examples: + unsuppotedMediaTypeErrorExample: + $ref: "#/components/examples/unsupportedMediaTypeErrorExample" + schema: + $ref: "#/components/schemas/errorResponse" + description: Unsupported Media Type + "429": + content: + application/json: + examples: + tooManyRequestsErrorExample: + $ref: "#/components/examples/tooManyRequestsErrorExample" + schema: + $ref: "#/components/schemas/errorResponse" + description: Too Many Requests + "500": + content: + application/json: + examples: + serviceUnavailableErrorExample: + $ref: "#/components/examples/serviceUnavailableErrorExample" + schema: + $ref: "#/components/schemas/errorResponse" + description: Service Unavailable + summary: Get Endpoint + tags: + - Endpoints + x-accepts: + - application/json + servers: + - description: Production + url: https://api.bandwidth.com/v2 + /accounts/{accountId}/endpoints/{endpointId}/bxml: + put: + description: Updates the BXML for the specified endpoint. + operationId: updateEndpointBxml + parameters: + - description: Your Bandwidth Account ID. + explode: false + in: path + name: accountId + required: true + schema: + example: "5500123" + type: string + style: simple + - description: BRTC Endpoint ID. + explode: false + in: path + name: endpointId + required: true + schema: + example: e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + type: string + style: simple + requestBody: + $ref: "#/components/requestBodies/updateEndpointBxmlRequest" + responses: + "204": + description: No Content + "400": + content: + application/json: + examples: + badRequestErrorExample: + $ref: "#/components/examples/badRequestErrorExample" + schema: + $ref: "#/components/schemas/errorResponse" + description: Bad Request + "401": + content: + application/json: + examples: + unauthorizedErrorExample: + $ref: "#/components/examples/unauthorizedErrorExample" + schema: + $ref: "#/components/schemas/errorResponse" + description: Unauthorized + "403": + content: + application/json: + examples: + forbiddenErrorExample: + $ref: "#/components/examples/forbiddenErrorExample" + schema: + $ref: "#/components/schemas/errorResponse" + description: Forbidden + "404": + content: + application/json: + examples: + notFoundErrorExample: + $ref: "#/components/examples/notFoundErrorExample" + schema: + $ref: "#/components/schemas/errorResponse" + description: Not Found + "405": + content: + application/json: + examples: + methodNotAllowedErrorExample: + $ref: "#/components/examples/methodNotAllowedErrorExample" + schema: + $ref: "#/components/schemas/errorResponse" + description: Method Not Allowed + "415": + content: + application/json: + examples: + unsuppotedMediaTypeErrorExample: + $ref: "#/components/examples/unsupportedMediaTypeErrorExample" + schema: + $ref: "#/components/schemas/errorResponse" + description: Unsupported Media Type + "429": + content: + application/json: + examples: + tooManyRequestsErrorExample: + $ref: "#/components/examples/tooManyRequestsErrorExample" + schema: + $ref: "#/components/schemas/errorResponse" + description: Too Many Requests + "500": + content: + application/json: + examples: + serviceUnavailableErrorExample: + $ref: "#/components/examples/serviceUnavailableErrorExample" + schema: + $ref: "#/components/schemas/errorResponse" + description: Service Unavailable + summary: Update Endpoint BXML + tags: + - Endpoints + x-content-type: application/xml + x-accepts: + - application/json + servers: + - description: Production + url: https://api.bandwidth.com/v2 components: callbacks: inboundCallback: @@ -5969,6 +6543,20 @@ components: $ref: "#/components/schemas/tfvError" description: Service Unavailable summary: TFV status updates sent to customer's webhook URL. + endpointEvent: + '{request.body#/eventCallbackUrl}': + post: + requestBody: + content: + application/json: + examples: + endpointDisconnectedEventExample: + $ref: "#/components/examples/endpointDisconnectedEventExample" + schema: + $ref: "#/components/schemas/endpointEvent" + responses: + "204": + description: Event was successfully received. examples: smsMessageReceivedCallbackExample: summary: An example of a sms message-received callback body. @@ -6387,6 +6975,200 @@ components: type: unexpected-error description: Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time. + listEndpointsResponseExample: + summary: List Endpoints Paginated Response + value: + links: + - href: https://api.bandwidth.com/v2/accounts/5500123/endpoints?type=SIP&status=CONNECTED&limit=2 + rel: self + method: GET + - href: https://api.bandwidth.com/v2/accounts/5500123/endpoints?type=SIP&status=CONNECTED&limit=2&afterCursor=TWF5IHRoZSBmb3JjZSBiZSB3aXRoIHlvdQ== + rel: next + method: GET + page: + pageSize: 2 + totalElements: 10 + totalPages: 5 + pageNumber: 0 + data: + - endpointId: e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + type: WEBRTC + status: CONNECTED + creationTimestamp: 2021-01-01T00:00:00Z + expirationTimestamp: 2021-01-02T00:00:00Z + tag: my-tag + - endpointId: e-2cb0-4a07-b215-b22865662d85-15ac29a2-1331029c + type: WEBRTC + status: CONNECTED + creationTimestamp: 2021-01-01T00:00:00Z + expirationTimestamp: 2021-01-02T00:00:00Z + tag: my-tag + errors: [] + createEndpointResponseExample: + summary: Create Endpoint Response + value: + links: + - href: https://api.bandwidth.com/v2/accounts/5500123/endpoints/e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + rel: endpoint + method: GET + data: + endpointId: e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + token: xxxxx.yyyyy.zzzzz + type: WEBRTC + status: CONNECTED + creationTimestamp: 2021-01-01T00:00:00Z + expirationTimestamp: 2021-01-02T00:00:00Z + devices: [] + tag: my-tag + errors: [] + getEndpointResponseExample: + summary: Get Endpoint Response + value: + links: + - href: https://api.bandwidth.com/v2/accounts/5500123/endpoints/e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + rel: self + method: GET + data: + endpointId: e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + type: WEBRTC + status: CONNECTED + creationTimestamp: 2021-01-01T00:00:00Z + expirationTimestamp: 2021-01-02T00:00:00Z + devices: [] + tag: my-tag + errors: [] + createSipEndpointRequestExample: + summary: SIP Endpoint Example + value: + type: SIP + connectionMetadata: + ipAddress: 0.0.0.0 + port: 3000 + credentials: + username: username + password: '********' + uuiHeader: 123456;encoding=jwt + direction: INBOUND + eventCallbackUrl: https://myEventCallbackUrl.com/callbacks/bandwidth + eventFallbackUrl: https://fallback.myEventCallbackUrl.com/callbacks/bandwidth + tag: "{\"myTag\": \"myTagValue\"}" + createWeRtcEndpointExample: + summary: WebRTC Endpoint Example + value: + type: WEBRTC + direction: BIDIRECTIONAL + eventCallbackUrl: https://myEventCallbackUrl.com/callbacks/bandwidth + eventFallbackUrl: https://fallback.myEventCallbackUrl.com/callbacks/bandwidth + tag: "{\"myTag\": \"myTagValue\"}" + updateEndpointBxmlRequestExample: + summary: Update Endpoint BXML Request Example + value: + endpointDisconnectedEventExample: + summary: Endpoint Disconnected Event + value: + endpointId: e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + type: WEBRTC + status: DISCONNECTED + creationTimestamp: 2021-01-01T00:00:00Z + expirationTimestamp: 2021-01-02T00:00:00Z + eventTime: 2021-01-01T00:00:00Z + eventType: DEVICE_DISCONNECTED + tag: my-tag + badRequestErrorExample: + summary: Bad Request Error Example + value: + links: [] + data: null + errors: + - id: 59512d87-7a92-4040-8e4a-78fb772019b9 + type: invalid_parameter + description: accountId must not contain any characters other than numbers. + code: "400" + source: + parameter: accountId + unauthorizedErrorExample: + summary: Unauthorized Error Example + value: + links: [] + data: null + errors: + - id: 59512d87-7a92-4040-8e4a-78fb772019b9 + type: unauthorized + description: The provided credentials are not authorized to access this + resource. + code: "401" + source: + header: Authorization + forbiddenErrorExample: + summary: Forbidden Error Example + value: + links: [] + data: null + errors: + - id: 59512d87-7a92-4040-8e4a-78fb772019b9 + type: forbidden + description: The provided credentials are not authorized to access this + resource. + code: "403" + source: + header: Authorization + notFoundErrorExample: + summary: Not Found Error Example + value: + links: [] + data: null + errors: + - id: 59512d87-7a92-4040-8e4a-78fb772019b9 + type: resource_not_found + description: The requested resource was not found. + code: "404" + source: + reference: e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + methodNotAllowedErrorExample: + summary: Method Not Allowed Error Example + value: + links: [] + data: null + errors: + - id: 59512d87-7a92-4040-8e4a-78fb772019b9 + type: method_not_allowed + description: The requested method is not allowed on this resource. + code: "405" + source: + parameter: accountId + unsupportedMediaTypeErrorExample: + summary: Unsupported Media Type Error Example + value: + links: [] + data: null + errors: + - id: 59512d87-7a92-4040-8e4a-78fb772019b9 + type: unsupported_media_type + description: The provided media type is not supported. + code: "415" + source: + header: Content-Type + tooManyRequestsErrorExample: + summary: Too Many Requests Error Example + value: + links: [] + data: null + errors: + - id: 59512d87-7a92-4040-8e4a-78fb772019b9 + type: too_many_requests + description: The client has sent too many requests in a given amount of + time. + code: "429" + serviceUnavailableErrorExample: + summary: Service Unavailable Error Example + value: + links: [] + data: null + errors: + - id: 59512d87-7a92-4040-8e4a-78fb772019b9 + type: service_unavailable + description: The service is currently unavailable. + code: "500" parameters: accountId: description: Your Bandwidth Account ID. @@ -6968,6 +7750,68 @@ components: schema: type: string style: simple + accountId2: + description: Your Bandwidth Account ID. + explode: false + in: path + name: accountId + required: true + schema: + example: "5500123" + type: string + style: simple + endpointId: + description: BRTC Endpoint ID. + explode: false + in: path + name: endpointId + required: true + schema: + example: e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + type: string + style: simple + endpointType: + description: The type of endpoint. + explode: true + in: query + name: type + required: false + schema: + $ref: "#/components/schemas/endpointTypeEnum" + style: form + endpointStatus: + description: The status of the endpoint. + explode: true + in: query + name: status + required: false + schema: + $ref: "#/components/schemas/endpointStatusEnum" + style: form + afterCursor: + description: The cursor to use for pagination. This is the value of the `next` + link in the previous response. + explode: true + in: query + name: afterCursor + required: false + schema: + example: TWF5IHRoZSBmb3JjZSBiZSB3aXRoIHlvdQ== + type: string + style: form + limit1: + description: The maximum number of endpoints to return in the response. + explode: true + in: query + name: limit + required: false + schema: + default: 100 + example: 2 + maximum: 1000 + minimum: 1 + type: integer + style: form requestBodies: createMessageRequest: content: @@ -7321,6 +8165,27 @@ components: description: Information about a webhook that Bandwidth should send upon the completion of event customer is trying to subscribe to. required: true + createEndpointRequest: + content: + application/json: + examples: + createWebRtcEndpointRequestExample: + $ref: "#/components/examples/createWeRtcEndpointExample" + schema: + $ref: "#/components/schemas/createEndpointRequest" + required: true + updateEndpointBxmlRequest: + content: + application/xml: + examples: + updateEndpointBxmlRequestExample: + $ref: "#/components/examples/updateEndpointBxmlRequestExample" + schema: + description: |- + The BXML document to update the endpoint with. This BXML document will be executed against the endpoint when it is updated. + For more information, please refer to our [BXML documentation](/docs/voice/bxml/). + type: string + required: true responses: createMessageResponse: content: @@ -7932,43 +8797,142 @@ components: description: Cannot find the requested resource. type: Not Found schema: - $ref: "#/components/schemas/tfvError" - description: Cannot find the requested resource. - tfvNotAllowedResponse: + $ref: "#/components/schemas/tfvError" + description: Cannot find the requested resource. + tfvNotAllowedResponse: + content: + application/json: + example: + description: Method is not allowed. + type: Method Not Allowed + schema: + $ref: "#/components/schemas/tfvError" + description: Method Not Allowed + tfvTooManyRequestsResponse: + content: + application/json: + example: + description: Throttling error. Too many requests. + type: Too Many Requests + schema: + $ref: "#/components/schemas/tfvError" + description: Too Many Requests + tfvServerErrorResponse: + content: + application/json: + example: + description: Internal Server Error. + type: Internal Server Error + schema: + $ref: "#/components/schemas/tfvError" + description: Internal Server Error + tfvServiceUnavailableResponse: + content: + application/json: + example: + description: Service Unavailable Error. + type: Service Unavailable + schema: + $ref: "#/components/schemas/tfvError" + description: Service Unavailable + listEndpointsResponse: + content: + application/json: + examples: + listEndpointsResponseExample: + $ref: "#/components/examples/listEndpointsResponseExample" + schema: + $ref: "#/components/schemas/listEndpointsResponse" + description: OK + createEndpointResponse: + content: + application/json: + examples: + createEndpointResponseExample: + $ref: "#/components/examples/createEndpointResponseExample" + schema: + $ref: "#/components/schemas/createEndpointResponse" + description: Created + getEndpointResponse: + content: + application/json: + examples: + getEndpointResponseExample: + $ref: "#/components/examples/getEndpointResponseExample" + schema: + $ref: "#/components/schemas/endpointResponse" + description: OK + badRequestErrorResponse: + content: + application/json: + examples: + badRequestErrorExample: + $ref: "#/components/examples/badRequestErrorExample" + schema: + $ref: "#/components/schemas/errorResponse" + description: Bad Request + unauthorizedErrorResponse: + content: + application/json: + examples: + unauthorizedErrorExample: + $ref: "#/components/examples/unauthorizedErrorExample" + schema: + $ref: "#/components/schemas/errorResponse" + description: Unauthorized + forbiddenErrorResponse: + content: + application/json: + examples: + forbiddenErrorExample: + $ref: "#/components/examples/forbiddenErrorExample" + schema: + $ref: "#/components/schemas/errorResponse" + description: Forbidden + notFoundErrorResponse: + content: + application/json: + examples: + notFoundErrorExample: + $ref: "#/components/examples/notFoundErrorExample" + schema: + $ref: "#/components/schemas/errorResponse" + description: Not Found + methodNotAllowedErrorResponse: content: application/json: - example: - description: Method is not allowed. - type: Method Not Allowed + examples: + methodNotAllowedErrorExample: + $ref: "#/components/examples/methodNotAllowedErrorExample" schema: - $ref: "#/components/schemas/tfvError" + $ref: "#/components/schemas/errorResponse" description: Method Not Allowed - tfvTooManyRequestsResponse: + unsupportedMediaTypeErrorResponse: content: application/json: - example: - description: Throttling error. Too many requests. - type: Too Many Requests + examples: + unsuppotedMediaTypeErrorExample: + $ref: "#/components/examples/unsupportedMediaTypeErrorExample" schema: - $ref: "#/components/schemas/tfvError" - description: Too Many Requests - tfvServerErrorResponse: + $ref: "#/components/schemas/errorResponse" + description: Unsupported Media Type + tooManyRequestsErrorResponse: content: application/json: - example: - description: Internal Server Error. - type: Internal Server Error + examples: + tooManyRequestsErrorExample: + $ref: "#/components/examples/tooManyRequestsErrorExample" schema: - $ref: "#/components/schemas/tfvError" - description: Internal Server Error - tfvServiceUnavailableResponse: + $ref: "#/components/schemas/errorResponse" + description: Too Many Requests + serviceUnavailableErrorResponse: content: application/json: - example: - description: Service Unavailable Error. - type: Service Unavailable + examples: + serviceUnavailableErrorExample: + $ref: "#/components/examples/serviceUnavailableErrorExample" schema: - $ref: "#/components/schemas/tfvError" + $ref: "#/components/schemas/errorResponse" description: Service Unavailable schemas: applicationId: @@ -14785,6 +15749,574 @@ components: nullable: true pattern: "^[ -~]{16,64}$" type: string + endpointId: + description: The unique ID of the endpoint. + example: e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + type: string + endpointStatusEnum: + enum: + - CONNECTED + - DISCONNECTED + type: string + deviceStatusEnum: + enum: + - CONNECTED + - DISCONNECTED + type: string + endpointTypeEnum: + enum: + - WEBRTC + type: string + endpointDirectionEnum: + enum: + - INBOUND + - OUTBOUND + - BIDIRECTIONAL + type: string + sipCredentials: + properties: + username: + description: The username for the SIP connection. + example: username + type: string + password: + description: The password for the SIP connection. + example: password + type: string + type: object + sipConnectionMetadata: + properties: + ipAddress: + description: The IP address of the SIP connection. + example: 192.168.0.0 + format: ipv4 + type: string + port: + description: The port of the SIP connection. + example: 5060 + type: integer + credentials: + $ref: "#/components/schemas/sipCredentials" + uuiHeader: + description: The User-to-User Information header for the SIP connection. + example: my-uui-header + type: string + title: SIP Connection + type: object + webRtcConnectionMetadata: + title: WebRTC Connection + type: object + endpointToken: + description: The json web token specific to the endpoint. Used to authenticate + the client with the media gateway. + example: xxxxx.yyyyy.zzzzz + type: string + endpointTag: + description: A tag for the endpoint. + example: my-tag + maximum: 1024 + type: string + device: + example: + creationTimestamp: 2021-01-01T00:00:00Z + deviceId: d-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + deviceName: David's iPhone + status: CONNECTED + properties: + deviceId: + description: The unique ID of the device. + example: d-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + type: string + deviceName: + description: The name of the device. + example: David's iPhone + maximum: 1024 + type: string + status: + $ref: "#/components/schemas/deviceStatusEnum" + creationTimestamp: + description: The time the device was created. In ISO-8601 format. + example: 2021-01-01T00:00:00Z + format: date-time + type: string + required: + - creationTimestamp + - deviceId + - status + type: object + endpoints: + example: + endpointId: e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + creationTimestamp: 2021-01-01T00:00:00Z + expirationTimestamp: 2021-01-02T00:00:00Z + tag: my-tag + type: WEBRTC + status: CONNECTED + properties: + endpointId: + description: The unique ID of the endpoint. + example: e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + type: string + type: + $ref: "#/components/schemas/endpointTypeEnum" + status: + $ref: "#/components/schemas/endpointStatusEnum" + creationTimestamp: + description: The time the endpoint was created. In ISO-8601 format. + example: 2021-01-01T00:00:00Z + format: date-time + type: string + expirationTimestamp: + description: The time the endpoint token will expire. In ISO-8601 format. + Tokens last 24 hours. + example: 2021-01-02T00:00:00Z + format: date-time + type: string + tag: + description: A tag for the endpoint. + example: my-tag + maximum: 1024 + type: string + required: + - creationTimestamp + - endpointId + - expirationTimestamp + - status + - type + type: object + endpoint: + allOf: + - $ref: "#/components/schemas/endpoints" + - properties: + devices: + items: + $ref: "#/components/schemas/device" + type: array + type: object + example: + devices: + - creationTimestamp: 2021-01-01T00:00:00Z + deviceId: d-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + deviceName: David's iPhone + status: CONNECTED + - creationTimestamp: 2021-01-01T00:00:00Z + deviceId: d-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + deviceName: David's iPhone + status: CONNECTED + endpointId: e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + creationTimestamp: 2021-01-01T00:00:00Z + expirationTimestamp: 2021-01-02T00:00:00Z + tag: my-tag + type: WEBRTC + status: CONNECTED + type: object + createWebRtcConnectionRequest: + allOf: + - $ref: "#/components/schemas/createEndpointRequestBase" + - properties: + connectionMetadata: + $ref: "#/components/schemas/webRtcConnectionMetadata" + type: object + createEndpointRequestBase: + properties: + type: + $ref: "#/components/schemas/endpointTypeEnum" + direction: + $ref: "#/components/schemas/endpointDirectionEnum" + eventCallbackUrl: + description: The URL to send event callbacks to. + example: https://myapp.com/callback + format: uri + type: string + eventFallbackUrl: + description: The URL to send event fallbacks to. + example: https://fallback.myapp.com/callback + format: uri + type: string + tag: + description: A tag for the endpoint. + example: my-tag + maximum: 1024 + type: string + required: + - direction + - type + type: object + createEndpointRequest: + $ref: "#/components/schemas/createWebRtcConnectionRequest" + createEndpointResponseObject: + allOf: + - $ref: "#/components/schemas/endpoint" + - properties: + token: + $ref: "#/components/schemas/endpointToken" + required: + - token + type: object + example: + devices: + - creationTimestamp: 2021-01-01T00:00:00Z + deviceId: d-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + deviceName: David's iPhone + status: CONNECTED + - creationTimestamp: 2021-01-01T00:00:00Z + deviceId: d-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + deviceName: David's iPhone + status: CONNECTED + endpointId: e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + creationTimestamp: 2021-01-01T00:00:00Z + expirationTimestamp: 2021-01-02T00:00:00Z + tag: my-tag + type: WEBRTC + status: CONNECTED + token: xxxxx.yyyyy.zzzzz + endpointEventTypeEnum: + enum: + - DEVICE_CONNECTED + - DEVICE_DISCONNECTED + type: string + endpointEvent: + allOf: + - $ref: "#/components/schemas/endpoints" + - properties: + eventTime: + description: The time the event occurred. In ISO-8601 format. + example: 2021-01-01T00:00:00Z + format: date-time + type: string + eventType: + $ref: "#/components/schemas/endpointEventTypeEnum" + device: + $ref: "#/components/schemas/device" + required: + - eventTime + - eventType + type: object + description: An event that occurred on an endpoint. + link1: + example: + method: GET + rel: self + href: https://api.bandwidth.com/v2/accounts/5500123/endpoints/e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + properties: + href: + description: The full URL of the link. + example: https://api.bandwidth.com/v2/accounts/5500123/endpoints/e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + type: string + rel: + description: The relationship of the link to the current resource. + example: self + type: string + method: + description: The HTTP method to use when making the request. + enum: + - GET + - POST + - DELETE + example: GET + type: string + type: object + page: + example: + pageNumber: 0 + totalPages: 10 + pageSize: 10 + totalElements: 100 + properties: + pageSize: + description: The number of items per page. + example: 10 + minimum: 0 + type: integer + totalElements: + description: The total number of items. + example: 100 + minimum: 0 + type: integer + totalPages: + description: The total number of pages. + example: 10 + minimum: 0 + type: integer + pageNumber: + description: The current page number. + example: 0 + minimum: 0 + type: integer + required: + - pageSize + type: object + error1: + example: + code: "404" + description: The requested resource was not found. + id: 59512d87-7a92-4040-8e4a-78fb772019b9 + source: + reference: e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + field: accountId + parameter: accountId + header: Authorization + type: resource.not_found + properties: + id: + description: A unique identifier for the error. + example: 59512d87-7a92-4040-8e4a-78fb772019b9 + format: uuid + type: string + type: + description: The type of error. + example: resource.not_found + type: string + description: + description: A description of the error. + example: The requested resource was not found. + type: string + code: + description: A code that uniquely identifies the error. + example: "404" + type: string + source: + $ref: "#/components/schemas/error1_source" + required: + - code + - description + - id + - type + type: object + listEndpointsResponse: + example: + data: + - endpointId: e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + creationTimestamp: 2021-01-01T00:00:00Z + expirationTimestamp: 2021-01-02T00:00:00Z + tag: my-tag + type: WEBRTC + status: CONNECTED + - endpointId: e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + creationTimestamp: 2021-01-01T00:00:00Z + expirationTimestamp: 2021-01-02T00:00:00Z + tag: my-tag + type: WEBRTC + status: CONNECTED + links: + - method: GET + rel: self + href: https://api.bandwidth.com/v2/accounts/5500123/endpoints/e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + - method: GET + rel: self + href: https://api.bandwidth.com/v2/accounts/5500123/endpoints/e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + page: + pageNumber: 0 + totalPages: 10 + pageSize: 10 + totalElements: 100 + errors: + - code: "404" + description: The requested resource was not found. + id: 59512d87-7a92-4040-8e4a-78fb772019b9 + source: + reference: e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + field: accountId + parameter: accountId + header: Authorization + type: resource.not_found + - code: "404" + description: The requested resource was not found. + id: 59512d87-7a92-4040-8e4a-78fb772019b9 + source: + reference: e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + field: accountId + parameter: accountId + header: Authorization + type: resource.not_found + properties: + links: + items: + $ref: "#/components/schemas/link1" + type: array + page: + $ref: "#/components/schemas/page" + data: + items: + $ref: "#/components/schemas/endpoints" + type: array + errors: + items: + $ref: "#/components/schemas/error1" + type: array + required: + - data + - errors + - links + type: object + endpointResponse: + example: + data: + devices: + - creationTimestamp: 2021-01-01T00:00:00Z + deviceId: d-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + deviceName: David's iPhone + status: CONNECTED + - creationTimestamp: 2021-01-01T00:00:00Z + deviceId: d-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + deviceName: David's iPhone + status: CONNECTED + endpointId: e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + creationTimestamp: 2021-01-01T00:00:00Z + expirationTimestamp: 2021-01-02T00:00:00Z + tag: my-tag + type: WEBRTC + status: CONNECTED + links: + - method: GET + rel: self + href: https://api.bandwidth.com/v2/accounts/5500123/endpoints/e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + - method: GET + rel: self + href: https://api.bandwidth.com/v2/accounts/5500123/endpoints/e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + errors: + - code: "404" + description: The requested resource was not found. + id: 59512d87-7a92-4040-8e4a-78fb772019b9 + source: + reference: e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + field: accountId + parameter: accountId + header: Authorization + type: resource.not_found + - code: "404" + description: The requested resource was not found. + id: 59512d87-7a92-4040-8e4a-78fb772019b9 + source: + reference: e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + field: accountId + parameter: accountId + header: Authorization + type: resource.not_found + properties: + links: + items: + $ref: "#/components/schemas/link1" + type: array + data: + $ref: "#/components/schemas/endpoint" + errors: + items: + $ref: "#/components/schemas/error1" + type: array + required: + - data + - errors + - links + type: object + createEndpointResponse: + example: + data: + devices: + - creationTimestamp: 2021-01-01T00:00:00Z + deviceId: d-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + deviceName: David's iPhone + status: CONNECTED + - creationTimestamp: 2021-01-01T00:00:00Z + deviceId: d-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + deviceName: David's iPhone + status: CONNECTED + endpointId: e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + creationTimestamp: 2021-01-01T00:00:00Z + expirationTimestamp: 2021-01-02T00:00:00Z + tag: my-tag + type: WEBRTC + status: CONNECTED + token: xxxxx.yyyyy.zzzzz + links: + - method: GET + rel: self + href: https://api.bandwidth.com/v2/accounts/5500123/endpoints/e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + - method: GET + rel: self + href: https://api.bandwidth.com/v2/accounts/5500123/endpoints/e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + errors: + - code: "404" + description: The requested resource was not found. + id: 59512d87-7a92-4040-8e4a-78fb772019b9 + source: + reference: e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + field: accountId + parameter: accountId + header: Authorization + type: resource.not_found + - code: "404" + description: The requested resource was not found. + id: 59512d87-7a92-4040-8e4a-78fb772019b9 + source: + reference: e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + field: accountId + parameter: accountId + header: Authorization + type: resource.not_found + properties: + links: + items: + $ref: "#/components/schemas/link1" + type: array + data: + $ref: "#/components/schemas/createEndpointResponseObject" + errors: + items: + $ref: "#/components/schemas/error1" + type: array + required: + - data + - errors + - links + type: object + errorResponse: + example: + data: "{}" + links: + - method: GET + rel: self + href: https://api.bandwidth.com/v2/accounts/5500123/endpoints/e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + - method: GET + rel: self + href: https://api.bandwidth.com/v2/accounts/5500123/endpoints/e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + errors: + - code: "404" + description: The requested resource was not found. + id: 59512d87-7a92-4040-8e4a-78fb772019b9 + source: + reference: e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + field: accountId + parameter: accountId + header: Authorization + type: resource.not_found + - code: "404" + description: The requested resource was not found. + id: 59512d87-7a92-4040-8e4a-78fb772019b9 + source: + reference: e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + field: accountId + parameter: accountId + header: Authorization + type: resource.not_found + properties: + links: + items: + $ref: "#/components/schemas/link1" + type: array + data: + additionalProperties: false + nullable: true + type: object + errors: + items: + $ref: "#/components/schemas/error1" + type: array + required: + - data + - errors + - links + type: object rbmCardContent_media: allOf: - $ref: "#/components/schemas/rbmMessageContentFile" @@ -14942,6 +16474,31 @@ components: - password - username type: object + error1_source: + example: + reference: e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + field: accountId + parameter: accountId + header: Authorization + properties: + parameter: + description: The URI parameter that caused the error. + example: accountId + type: string + field: + description: The request body field that caused the error. + example: accountId + type: string + header: + description: The header that caused the error. + example: Authorization + type: string + reference: + description: The resource ID or path to the resource (or non-existent resource) + causing the error. + example: e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + type: string + type: object securitySchemes: Basic: description: |- diff --git a/bandwidth.yml b/bandwidth.yml deleted file mode 100644 index d7c32953..00000000 --- a/bandwidth.yml +++ /dev/null @@ -1,8584 +0,0 @@ -openapi: 3.0.3 -info: - title: Bandwidth - description: Bandwidth's Communication APIs - contact: - name: Bandwidth - url: https://dev.bandwidth.com - email: letstalk@bandwidth.com - version: 1.0.0 -security: - - Basic: [] - - OAuth2: [] -tags: - - name: Messages - - name: Media - - name: Multi-Channel - - name: Calls - - name: Conferences - - name: Recordings - - name: Statistics - - name: Transcriptions - - name: MFA - - name: Phone Number Lookup - - name: Toll-Free Verification -paths: - /users/{accountId}/media: - get: - summary: List Media - description: Gets a list of your media files. No query parameters are supported. - operationId: listMedia - tags: - - Media - parameters: - - $ref: '#/components/parameters/accountId' - - $ref: '#/components/parameters/continuationToken' - responses: - '200': - $ref: '#/components/responses/listMediaResponse' - '400': - $ref: '#/components/responses/messagingBadRequestError' - '401': - $ref: '#/components/responses/messagingUnauthorizedError' - '403': - $ref: '#/components/responses/messagingForbiddenError' - '404': - $ref: '#/components/responses/messagingNotFoundError' - '406': - $ref: '#/components/responses/messagingNotAcceptableError' - '415': - $ref: '#/components/responses/messagingInvalidMediaTypeError' - '429': - $ref: '#/components/responses/messagingTooManyRequestsError' - '500': - $ref: '#/components/responses/messagingInternalServerError' - servers: &ref_0 - - url: https://messaging.bandwidth.com/api/v2 - description: Production - /users/{accountId}/media/{mediaId}: - get: - summary: Get Media - description: Downloads a media file you previously uploaded. - operationId: getMedia - tags: - - Media - parameters: - - $ref: '#/components/parameters/accountId' - - $ref: '#/components/parameters/mediaId' - responses: - '200': - $ref: '#/components/responses/getMediaResponse' - '400': - $ref: '#/components/responses/messagingBadRequestError' - '401': - $ref: '#/components/responses/messagingUnauthorizedError' - '403': - $ref: '#/components/responses/messagingForbiddenError' - '404': - $ref: '#/components/responses/messagingNotFoundError' - '406': - $ref: '#/components/responses/messagingNotAcceptableError' - '415': - $ref: '#/components/responses/messagingInvalidMediaTypeError' - '429': - $ref: '#/components/responses/messagingTooManyRequestsError' - '500': - $ref: '#/components/responses/messagingInternalServerError' - put: - summary: Upload Media - description: >- - Upload a file. You may add headers to the request in order to provide - some control to your media file. - - - If a file is uploaded with the same name as a file that already exists - under this account, the previous file will be overwritten. - - - A list of supported media types can be found - [here](https://support.bandwidth.com/hc/en-us/articles/360014128994-What-MMS-file-types-are-supported-). - operationId: uploadMedia - tags: - - Media - parameters: - - $ref: '#/components/parameters/accountId' - - $ref: '#/components/parameters/mediaId' - - $ref: '#/components/parameters/contentType' - - $ref: '#/components/parameters/cacheControl' - requestBody: - $ref: '#/components/requestBodies/uploadMediaRequest' - responses: - '204': - description: No Content - '400': - $ref: '#/components/responses/messagingBadRequestError' - '401': - $ref: '#/components/responses/messagingUnauthorizedError' - '403': - $ref: '#/components/responses/messagingForbiddenError' - '404': - $ref: '#/components/responses/messagingNotFoundError' - '406': - $ref: '#/components/responses/messagingNotAcceptableError' - '415': - $ref: '#/components/responses/messagingInvalidMediaTypeError' - '429': - $ref: '#/components/responses/messagingTooManyRequestsError' - '500': - $ref: '#/components/responses/messagingInternalServerError' - delete: - summary: Delete Media - description: |- - Deletes a media file from Bandwidth API server. Make sure you don't have - any application scripts still using the media before you delete. - - If you accidentally delete a media file you can immediately upload a new - file with the same name. - operationId: deleteMedia - tags: - - Media - parameters: - - $ref: '#/components/parameters/accountId' - - $ref: '#/components/parameters/mediaId' - responses: - '204': - description: No Content - '400': - $ref: '#/components/responses/messagingBadRequestError' - '401': - $ref: '#/components/responses/messagingUnauthorizedError' - '403': - $ref: '#/components/responses/messagingForbiddenError' - '404': - $ref: '#/components/responses/messagingNotFoundError' - '406': - $ref: '#/components/responses/messagingNotAcceptableError' - '415': - $ref: '#/components/responses/messagingInvalidMediaTypeError' - '429': - $ref: '#/components/responses/messagingTooManyRequestsError' - '500': - $ref: '#/components/responses/messagingInternalServerError' - servers: *ref_0 - /users/{accountId}/messages: - get: - summary: List Messages - description: Returns a list of messages based on query parameters. - operationId: listMessages - tags: - - Messages - parameters: - - $ref: '#/components/parameters/accountId' - - $ref: '#/components/parameters/messageId' - - $ref: '#/components/parameters/sourceTn' - - $ref: '#/components/parameters/destinationTn' - - $ref: '#/components/parameters/messageStatus' - - $ref: '#/components/parameters/messageDirection' - - $ref: '#/components/parameters/carrierName' - - $ref: '#/components/parameters/messageType' - - $ref: '#/components/parameters/errorCode' - - $ref: '#/components/parameters/fromDateTime' - - $ref: '#/components/parameters/toDateTime' - - $ref: '#/components/parameters/campaignId' - - $ref: '#/components/parameters/fromBwLatency' - - $ref: '#/components/parameters/bwQueued' - - $ref: '#/components/parameters/product' - - $ref: '#/components/parameters/location' - - $ref: '#/components/parameters/carrierQueued' - - $ref: '#/components/parameters/fromCarrierLatency' - - $ref: '#/components/parameters/callingNumberCountryA3' - - $ref: '#/components/parameters/calledNumberCountryA3' - - $ref: '#/components/parameters/fromSegmentCount' - - $ref: '#/components/parameters/toSegmentCount' - - $ref: '#/components/parameters/fromMessageSize' - - $ref: '#/components/parameters/toMessageSize' - - $ref: '#/components/parameters/sort' - - $ref: '#/components/parameters/pageToken' - - $ref: '#/components/parameters/limit' - - $ref: '#/components/parameters/limitTotalCount' - responses: - '200': - $ref: '#/components/responses/listMessagesResponse' - '400': - $ref: '#/components/responses/messagingBadRequestError' - '401': - $ref: '#/components/responses/messagingUnauthorizedError' - '403': - $ref: '#/components/responses/messagingForbiddenError' - '404': - $ref: '#/components/responses/messagingNotFoundError' - '415': - $ref: '#/components/responses/messagingInvalidMediaTypeError' - '429': - $ref: '#/components/responses/messagingTooManyRequestsError' - '500': - $ref: '#/components/responses/messagingInternalServerError' - post: - summary: Create Message - description: >- - Endpoint for sending text messages and picture messages using V2 - messaging. - operationId: createMessage - tags: - - Messages - parameters: - - $ref: '#/components/parameters/accountId' - requestBody: - $ref: '#/components/requestBodies/createMessageRequest' - responses: - '202': - $ref: '#/components/responses/createMessageResponse' - '400': - $ref: '#/components/responses/createMessageBadRequestError' - '401': - $ref: '#/components/responses/messagingUnauthorizedError' - '403': - $ref: '#/components/responses/messagingForbiddenError' - '404': - $ref: '#/components/responses/messagingNotFoundError' - '405': - $ref: '#/components/responses/messagingMethodNotAllowedError' - '406': - $ref: '#/components/responses/messagingNotAcceptableError' - '415': - $ref: '#/components/responses/messagingInvalidMediaTypeError' - '429': - $ref: '#/components/responses/messagingTooManyRequestsError' - '500': - $ref: '#/components/responses/messagingInternalServerError' - callbacks: - statusCallback: - $ref: '#/components/callbacks/statusCallback' - servers: *ref_0 - /users/{accountId}/messages/multiChannel: - post: - summary: Create Multi-Channel Message - description: Endpoint for sending Multi-Channel messages. - operationId: createMultiChannelMessage - parameters: - - $ref: '#/components/parameters/accountId' - tags: - - Multi-Channel - requestBody: - $ref: '#/components/requestBodies/createMultiChannelMessageRequest' - responses: - '202': - $ref: '#/components/responses/createMultiChannelMessageResponse' - '400': - $ref: '#/components/responses/multiChannelBadRequestError' - '401': - $ref: '#/components/responses/multiChannelUnauthorizedError' - '403': - $ref: '#/components/responses/multiChannelForbiddenError' - '404': - $ref: '#/components/responses/multiChannelNotFoundError' - '405': - $ref: '#/components/responses/multiChannelMethodNotAllowedError' - '406': - $ref: '#/components/responses/multiChannelNotAcceptableError' - '415': - $ref: '#/components/responses/multiChannelInvalidMediaTypeError' - '429': - $ref: '#/components/responses/multiChannelTooManyRequestsError' - '500': - $ref: '#/components/responses/multiChannelInternalServerError' - callbacks: - statusCallback: - $ref: '#/components/callbacks/statusCallback' - x-badges: - - name: Beta - color: '#076EA8' - servers: *ref_0 - /accounts/{accountId}/calls: - post: - tags: - - Calls - summary: Create Call - description: >- - Creates an outbound phone call. - - - All calls are initially queued. Your outbound calls will initiated at a - specific dequeueing rate, enabling your application to "fire and forget" - when creating calls. Queued calls may not be modified until they are - dequeued and placed, but may be removed from your queue on demand. - - - Please note: Calls submitted to your queue will be placed - approximately in order, but exact ordering is not guaranteed. - operationId: createCall - parameters: - - $ref: '#/components/parameters/accountId' - requestBody: - $ref: '#/components/requestBodies/createCallRequest' - responses: - '201': - $ref: '#/components/responses/createCallResponse' - '400': - $ref: '#/components/responses/voiceBadRequestError' - '401': - $ref: '#/components/responses/voiceUnauthorizedError' - '403': - $ref: '#/components/responses/voiceForbiddenError' - '404': - $ref: '#/components/responses/voiceNotFoundError' - '405': - $ref: '#/components/responses/voiceNotAllowedError' - '415': - $ref: '#/components/responses/voiceUnsupportedMediaTypeError' - '429': - $ref: '#/components/responses/voiceTooManyRequestsError' - '500': - $ref: '#/components/responses/voiceInternalServerError' - get: - tags: - - Calls - summary: Get Calls - description: >- - Returns a max of 10000 calls, sorted by `createdTime` from oldest to - newest. - - - **NOTE:** If the number of calls in the account is bigger than - `pageSize`, a `Link` header (with format `<{url}>; rel="next"`) will be - returned in the response. The url can be used to retrieve the next page - of call records. - - Also, call information is kept for 7 days after the calls are hung up. - If you attempt to retrieve information for a call that is older than 7 - days, you will get an empty array [] in response. - operationId: listCalls - parameters: - - $ref: '#/components/parameters/accountId' - - $ref: '#/components/parameters/to' - - $ref: '#/components/parameters/from' - - $ref: '#/components/parameters/minStartTimeCalls' - - $ref: '#/components/parameters/maxStartTimeCalls' - - $ref: '#/components/parameters/disconnectCause' - - $ref: '#/components/parameters/pageSizeCalls' - - $ref: '#/components/parameters/pageToken1' - responses: - '200': - $ref: '#/components/responses/listCallsResponse' - '400': - $ref: '#/components/responses/voiceBadRequestError' - '401': - $ref: '#/components/responses/voiceUnauthorizedError' - '403': - $ref: '#/components/responses/voiceForbiddenError' - '404': - $ref: '#/components/responses/voiceNotFoundError' - '405': - $ref: '#/components/responses/voiceNotAllowedError' - '415': - $ref: '#/components/responses/voiceUnsupportedMediaTypeError' - '429': - $ref: '#/components/responses/voiceTooManyRequestsError' - '500': - $ref: '#/components/responses/voiceInternalServerError' - servers: &ref_1 - - url: https://voice.bandwidth.com/api/v2 - description: Production - /accounts/{accountId}/calls/{callId}: - get: - tags: - - Calls - summary: Get Call State Information - description: >- - Retrieve the current state of a specific call. This information is - near-realtime, so it may take a few minutes for your call to be - accessible using this endpoint. - - - **Note**: Call information is kept for 7 days after the calls are hung - up. If you attempt to retrieve information for a call that is older than - 7 days, you will get an HTTP 404 response. - operationId: getCallState - parameters: - - $ref: '#/components/parameters/accountId' - - $ref: '#/components/parameters/callId' - responses: - '200': - $ref: '#/components/responses/getCallStateResponse' - '400': - $ref: '#/components/responses/voiceBadRequestError' - '401': - $ref: '#/components/responses/voiceUnauthorizedError' - '403': - $ref: '#/components/responses/voiceForbiddenError' - '404': - $ref: '#/components/responses/voiceNotFoundError' - '405': - $ref: '#/components/responses/voiceNotAllowedError' - '415': - $ref: '#/components/responses/voiceUnsupportedMediaTypeError' - '429': - $ref: '#/components/responses/voiceTooManyRequestsError' - '500': - $ref: '#/components/responses/voiceInternalServerError' - post: - tags: - - Calls - summary: Update Call - description: >- - Interrupts and redirects a call to a different URL that should return a - BXML document. - operationId: updateCall - parameters: - - $ref: '#/components/parameters/accountId' - - $ref: '#/components/parameters/callId' - requestBody: - $ref: '#/components/requestBodies/updateCallRequest' - responses: - '200': - $ref: '#/components/responses/updateCallResponse' - '400': - $ref: '#/components/responses/voiceBadRequestError' - '401': - $ref: '#/components/responses/voiceUnauthorizedError' - '403': - $ref: '#/components/responses/voiceForbiddenError' - '404': - $ref: '#/components/responses/voiceNotFoundError' - '405': - $ref: '#/components/responses/voiceNotAllowedError' - '409': - $ref: '#/components/responses/voiceConflictError' - '415': - $ref: '#/components/responses/voiceUnsupportedMediaTypeError' - '429': - $ref: '#/components/responses/voiceTooManyRequestsError' - '500': - $ref: '#/components/responses/voiceInternalServerError' - servers: *ref_1 - /accounts/{accountId}/calls/{callId}/bxml: - put: - tags: - - Calls - summary: Update Call BXML - description: Interrupts and replaces an active call's BXML document. - operationId: updateCallBxml - parameters: - - $ref: '#/components/parameters/accountId' - - $ref: '#/components/parameters/callId' - requestBody: - $ref: '#/components/requestBodies/updateCallBxmlRequest' - responses: - '204': - description: Call BXML was successfully replaced. - '400': - $ref: '#/components/responses/voiceBadRequestError' - '401': - $ref: '#/components/responses/voiceUnauthorizedError' - '403': - $ref: '#/components/responses/voiceForbiddenError' - '404': - $ref: '#/components/responses/voiceNotFoundError' - '405': - $ref: '#/components/responses/voiceNotAllowedError' - '409': - $ref: '#/components/responses/voiceConflictError' - '415': - $ref: '#/components/responses/voiceUnsupportedMediaTypeError' - '429': - $ref: '#/components/responses/voiceTooManyRequestsError' - '500': - $ref: '#/components/responses/voiceInternalServerError' - servers: *ref_1 - /accounts/{accountId}/conferences: - get: - tags: - - Conferences - summary: Get Conferences - description: >- - Returns a max of 1000 conferences, sorted by `createdTime` from oldest - to newest. - - - **NOTE:** If the number of conferences in the account is bigger than - `pageSize`, a `Link` header (with format `<{url}>; rel="next"`) will be - returned in the response. The url can be used to retrieve the next page - of conference records. - operationId: listConferences - parameters: - - $ref: '#/components/parameters/accountId' - - $ref: '#/components/parameters/name' - - $ref: '#/components/parameters/minCreatedTime' - - $ref: '#/components/parameters/maxCreatedTime' - - $ref: '#/components/parameters/pageSize' - - $ref: '#/components/parameters/pageToken1' - responses: - '200': - $ref: '#/components/responses/listConferencesResponse' - '400': - $ref: '#/components/responses/voiceBadRequestError' - '401': - $ref: '#/components/responses/voiceUnauthorizedError' - '403': - $ref: '#/components/responses/voiceForbiddenError' - '404': - $ref: '#/components/responses/voiceNotFoundError' - '405': - $ref: '#/components/responses/voiceNotAllowedError' - '415': - $ref: '#/components/responses/voiceUnsupportedMediaTypeError' - '429': - $ref: '#/components/responses/voiceTooManyRequestsError' - '500': - $ref: '#/components/responses/voiceInternalServerError' - servers: *ref_1 - /accounts/{accountId}/conferences/{conferenceId}: - get: - tags: - - Conferences - summary: Get Conference Information - description: Returns information about the specified conference. - operationId: getConference - parameters: - - $ref: '#/components/parameters/accountId' - - $ref: '#/components/parameters/conferenceId' - responses: - '200': - $ref: '#/components/responses/getConferenceResponse' - '400': - $ref: '#/components/responses/voiceBadRequestError' - '401': - $ref: '#/components/responses/voiceUnauthorizedError' - '403': - $ref: '#/components/responses/voiceForbiddenError' - '404': - $ref: '#/components/responses/voiceNotFoundError' - '405': - $ref: '#/components/responses/voiceNotAllowedError' - '415': - $ref: '#/components/responses/voiceUnsupportedMediaTypeError' - '429': - $ref: '#/components/responses/voiceTooManyRequestsError' - '500': - $ref: '#/components/responses/voiceInternalServerError' - post: - tags: - - Conferences - summary: Update Conference - description: Update the conference state. - operationId: updateConference - parameters: - - $ref: '#/components/parameters/accountId' - - $ref: '#/components/parameters/conferenceId' - requestBody: - $ref: '#/components/requestBodies/updateConferenceRequest' - responses: - '204': - description: Conference was successfully modified. - '400': - $ref: '#/components/responses/voiceBadRequestError' - '401': - $ref: '#/components/responses/voiceUnauthorizedError' - '403': - $ref: '#/components/responses/voiceForbiddenError' - '404': - $ref: '#/components/responses/voiceNotFoundError' - '405': - $ref: '#/components/responses/voiceNotAllowedError' - '415': - $ref: '#/components/responses/voiceUnsupportedMediaTypeError' - '429': - $ref: '#/components/responses/voiceTooManyRequestsError' - '500': - $ref: '#/components/responses/voiceInternalServerError' - servers: *ref_1 - /accounts/{accountId}/conferences/{conferenceId}/bxml: - put: - tags: - - Conferences - summary: Update Conference BXML - description: Update the conference BXML document. - operationId: updateConferenceBxml - parameters: - - $ref: '#/components/parameters/accountId' - - $ref: '#/components/parameters/conferenceId' - requestBody: - $ref: '#/components/requestBodies/updateConferenceBxmlRequest' - responses: - '204': - description: Conference successfully modified. - '400': - $ref: '#/components/responses/voiceBadRequestError' - '401': - $ref: '#/components/responses/voiceUnauthorizedError' - '403': - $ref: '#/components/responses/voiceForbiddenError' - '404': - $ref: '#/components/responses/voiceNotFoundError' - '405': - $ref: '#/components/responses/voiceNotAllowedError' - '415': - $ref: '#/components/responses/voiceUnsupportedMediaTypeError' - '429': - $ref: '#/components/responses/voiceTooManyRequestsError' - '500': - $ref: '#/components/responses/voiceInternalServerError' - servers: *ref_1 - /accounts/{accountId}/conferences/{conferenceId}/members/{memberId}: - get: - tags: - - Conferences - summary: Get Conference Member - description: Returns information about the specified conference member. - operationId: getConferenceMember - parameters: - - $ref: '#/components/parameters/accountId' - - $ref: '#/components/parameters/conferenceId' - - $ref: '#/components/parameters/memberId' - responses: - '200': - $ref: '#/components/responses/getConferenceMemberResponse' - '400': - $ref: '#/components/responses/voiceBadRequestError' - '401': - $ref: '#/components/responses/voiceUnauthorizedError' - '403': - $ref: '#/components/responses/voiceForbiddenError' - '404': - $ref: '#/components/responses/voiceNotFoundError' - '405': - $ref: '#/components/responses/voiceNotAllowedError' - '415': - $ref: '#/components/responses/voiceUnsupportedMediaTypeError' - '429': - $ref: '#/components/responses/voiceTooManyRequestsError' - '500': - $ref: '#/components/responses/voiceInternalServerError' - put: - tags: - - Conferences - summary: Update Conference Member - description: Updates settings for a particular conference member. - operationId: updateConferenceMember - parameters: - - $ref: '#/components/parameters/accountId' - - $ref: '#/components/parameters/conferenceId' - - $ref: '#/components/parameters/memberId' - requestBody: - $ref: '#/components/requestBodies/updateConferenceMemberRequest' - responses: - '204': - description: Conference member was successfully modified. - '400': - $ref: '#/components/responses/voiceBadRequestError' - '401': - $ref: '#/components/responses/voiceUnauthorizedError' - '403': - $ref: '#/components/responses/voiceForbiddenError' - '404': - $ref: '#/components/responses/voiceNotFoundError' - '405': - $ref: '#/components/responses/voiceNotAllowedError' - '415': - $ref: '#/components/responses/voiceUnsupportedMediaTypeError' - '429': - $ref: '#/components/responses/voiceTooManyRequestsError' - '500': - $ref: '#/components/responses/voiceInternalServerError' - servers: *ref_1 - /accounts/{accountId}/conferences/{conferenceId}/recordings: - get: - tags: - - Conferences - summary: Get Conference Recordings - description: >- - Returns a (potentially empty) list of metadata for the recordings that - took place during the specified conference. - operationId: listConferenceRecordings - parameters: - - $ref: '#/components/parameters/accountId' - - $ref: '#/components/parameters/conferenceId' - responses: - '200': - $ref: '#/components/responses/listConferenceRecordingsResponse' - '400': - $ref: '#/components/responses/voiceBadRequestError' - '401': - $ref: '#/components/responses/voiceUnauthorizedError' - '403': - $ref: '#/components/responses/voiceForbiddenError' - '404': - $ref: '#/components/responses/voiceNotFoundError' - '405': - $ref: '#/components/responses/voiceNotAllowedError' - '415': - $ref: '#/components/responses/voiceUnsupportedMediaTypeError' - '429': - $ref: '#/components/responses/voiceTooManyRequestsError' - '500': - $ref: '#/components/responses/voiceInternalServerError' - servers: *ref_1 - /accounts/{accountId}/conferences/{conferenceId}/recordings/{recordingId}: - get: - tags: - - Conferences - summary: Get Conference Recording Information - description: Returns metadata for the specified recording. - operationId: getConferenceRecording - parameters: - - $ref: '#/components/parameters/accountId' - - $ref: '#/components/parameters/conferenceId' - - $ref: '#/components/parameters/recordingId' - responses: - '200': - $ref: '#/components/responses/getConferenceRecordingResponse' - '400': - $ref: '#/components/responses/voiceBadRequestError' - '401': - $ref: '#/components/responses/voiceUnauthorizedError' - '403': - $ref: '#/components/responses/voiceForbiddenError' - '404': - $ref: '#/components/responses/voiceNotFoundError' - '405': - $ref: '#/components/responses/voiceNotAllowedError' - '415': - $ref: '#/components/responses/voiceUnsupportedMediaTypeError' - '429': - $ref: '#/components/responses/voiceTooManyRequestsError' - '500': - $ref: '#/components/responses/voiceInternalServerError' - servers: *ref_1 - /accounts/{accountId}/conferences/{conferenceId}/recordings/{recordingId}/media: - get: - tags: - - Conferences - summary: Download Conference Recording - description: Downloads the specified recording file. - operationId: downloadConferenceRecording - parameters: - - $ref: '#/components/parameters/accountId' - - $ref: '#/components/parameters/conferenceId' - - $ref: '#/components/parameters/recordingId' - responses: - '200': - $ref: '#/components/responses/downloadRecordingMediaResponse' - '400': - $ref: '#/components/responses/voiceBadRequestError' - '401': - $ref: '#/components/responses/voiceUnauthorizedError' - '403': - $ref: '#/components/responses/voiceForbiddenError' - '404': - $ref: '#/components/responses/voiceNotFoundError' - '405': - $ref: '#/components/responses/voiceNotAllowedError' - '415': - $ref: '#/components/responses/voiceUnsupportedMediaTypeError' - '429': - $ref: '#/components/responses/voiceTooManyRequestsError' - '500': - $ref: '#/components/responses/voiceInternalServerError' - servers: *ref_1 - /accounts/{accountId}/recordings: - get: - tags: - - Recordings - summary: Get Call Recordings - description: >- - Returns a list of metadata for the recordings associated with the - - specified account. The list can be filtered by the optional from, to, - minStartTime, - - and maxStartTime arguments. The list is capped at 1000 entries and may - be - - empty if no recordings match the specified criteria. - operationId: listAccountCallRecordings - parameters: - - $ref: '#/components/parameters/accountId' - - $ref: '#/components/parameters/to' - - $ref: '#/components/parameters/from' - - $ref: '#/components/parameters/minStartTime' - - $ref: '#/components/parameters/maxStartTime' - responses: - '200': - $ref: '#/components/responses/listCallRecordingsResponse' - '400': - $ref: '#/components/responses/voiceBadRequestError' - '401': - $ref: '#/components/responses/voiceUnauthorizedError' - '403': - $ref: '#/components/responses/voiceForbiddenError' - '404': - $ref: '#/components/responses/voiceNotFoundError' - '405': - $ref: '#/components/responses/voiceNotAllowedError' - '415': - $ref: '#/components/responses/voiceUnsupportedMediaTypeError' - '429': - $ref: '#/components/responses/voiceTooManyRequestsError' - '500': - $ref: '#/components/responses/voiceInternalServerError' - servers: *ref_1 - /accounts/{accountId}/calls/{callId}/recording: - put: - tags: - - Recordings - summary: Update Recording - description: Pause or resume a recording on an active phone call. - operationId: updateCallRecordingState - parameters: - - $ref: '#/components/parameters/accountId' - - $ref: '#/components/parameters/callId' - requestBody: - $ref: '#/components/requestBodies/updateCallRecordingRequest' - responses: - '200': - $ref: '#/components/responses/updateRecordingResponse' - '400': - $ref: '#/components/responses/voiceBadRequestError' - '401': - $ref: '#/components/responses/voiceUnauthorizedError' - '403': - $ref: '#/components/responses/voiceForbiddenError' - '404': - $ref: '#/components/responses/voiceNotFoundError' - '405': - $ref: '#/components/responses/voiceNotAllowedError' - '415': - $ref: '#/components/responses/voiceUnsupportedMediaTypeError' - '429': - $ref: '#/components/responses/voiceTooManyRequestsError' - '500': - $ref: '#/components/responses/voiceInternalServerError' - servers: *ref_1 - /accounts/{accountId}/calls/{callId}/recordings: - get: - tags: - - Recordings - summary: List Call Recordings - description: |- - Returns a (potentially empty) list of metadata for the recordings - that took place during the specified call. - operationId: listCallRecordings - parameters: - - $ref: '#/components/parameters/accountId' - - $ref: '#/components/parameters/callId' - responses: - '200': - $ref: '#/components/responses/listCallRecordingsResponse' - '400': - $ref: '#/components/responses/voiceBadRequestError' - '401': - $ref: '#/components/responses/voiceUnauthorizedError' - '403': - $ref: '#/components/responses/voiceForbiddenError' - '404': - $ref: '#/components/responses/voiceNotFoundError' - '405': - $ref: '#/components/responses/voiceNotAllowedError' - '415': - $ref: '#/components/responses/voiceUnsupportedMediaTypeError' - '429': - $ref: '#/components/responses/voiceTooManyRequestsError' - '500': - $ref: '#/components/responses/voiceInternalServerError' - servers: *ref_1 - /accounts/{accountId}/calls/{callId}/recordings/{recordingId}: - get: - tags: - - Recordings - summary: Get Call Recording - description: Returns metadata for the specified recording. - operationId: getCallRecording - parameters: - - $ref: '#/components/parameters/accountId' - - $ref: '#/components/parameters/callId' - - $ref: '#/components/parameters/recordingId' - responses: - '200': - $ref: '#/components/responses/getCallRecordingResponse' - '400': - $ref: '#/components/responses/voiceBadRequestError' - '401': - $ref: '#/components/responses/voiceUnauthorizedError' - '403': - $ref: '#/components/responses/voiceForbiddenError' - '404': - $ref: '#/components/responses/voiceNotFoundError' - '405': - $ref: '#/components/responses/voiceNotAllowedError' - '415': - $ref: '#/components/responses/voiceUnsupportedMediaTypeError' - '429': - $ref: '#/components/responses/voiceTooManyRequestsError' - '500': - $ref: '#/components/responses/voiceInternalServerError' - delete: - tags: - - Recordings - summary: Delete Recording - description: >- - Delete the recording information, media and transcription. - - - Note: After the deletion is requested and a `204` is returned, neither - the recording metadata nor the actual media nor its transcription will - be accessible anymore. However, the media of the specified recording is - not deleted immediately. This deletion process, while transparent and - irreversible, can take an additional 24 to 48 hours. - operationId: deleteRecording - parameters: - - $ref: '#/components/parameters/accountId' - - $ref: '#/components/parameters/callId' - - $ref: '#/components/parameters/recordingId' - responses: - '204': - description: Recording was deleted. - '400': - $ref: '#/components/responses/voiceBadRequestError' - '401': - $ref: '#/components/responses/voiceUnauthorizedError' - '403': - $ref: '#/components/responses/voiceForbiddenError' - '404': - $ref: '#/components/responses/voiceNotFoundError' - '405': - $ref: '#/components/responses/voiceNotAllowedError' - '415': - $ref: '#/components/responses/voiceUnsupportedMediaTypeError' - '429': - $ref: '#/components/responses/voiceTooManyRequestsError' - '500': - $ref: '#/components/responses/voiceInternalServerError' - servers: *ref_1 - /accounts/{accountId}/calls/{callId}/recordings/{recordingId}/media: - get: - tags: - - Recordings - summary: Download Recording - description: Downloads the specified recording. - operationId: downloadCallRecording - parameters: - - $ref: '#/components/parameters/accountId' - - $ref: '#/components/parameters/callId' - - $ref: '#/components/parameters/recordingId' - responses: - '200': - $ref: '#/components/responses/downloadRecordingMediaResponse' - '400': - $ref: '#/components/responses/voiceBadRequestError' - '401': - $ref: '#/components/responses/voiceUnauthorizedError' - '403': - $ref: '#/components/responses/voiceForbiddenError' - '404': - $ref: '#/components/responses/voiceNotFoundError' - '405': - $ref: '#/components/responses/voiceNotAllowedError' - '415': - $ref: '#/components/responses/voiceUnsupportedMediaTypeError' - '429': - $ref: '#/components/responses/voiceTooManyRequestsError' - '500': - $ref: '#/components/responses/voiceInternalServerError' - delete: - tags: - - Recordings - summary: Delete Recording Media - description: Deletes the specified recording's media. - operationId: deleteRecordingMedia - parameters: - - $ref: '#/components/parameters/accountId' - - $ref: '#/components/parameters/callId' - - $ref: '#/components/parameters/recordingId' - responses: - '204': - description: The recording media was successfully deleted. - '400': - $ref: '#/components/responses/voiceBadRequestError' - '401': - $ref: '#/components/responses/voiceUnauthorizedError' - '403': - $ref: '#/components/responses/voiceForbiddenError' - '404': - $ref: '#/components/responses/voiceNotFoundError' - '405': - $ref: '#/components/responses/voiceNotAllowedError' - '415': - $ref: '#/components/responses/voiceUnsupportedMediaTypeError' - '429': - $ref: '#/components/responses/voiceTooManyRequestsError' - '500': - $ref: '#/components/responses/voiceInternalServerError' - servers: *ref_1 - /accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription: - get: - tags: - - Recordings - summary: Get Transcription - description: >- - Downloads the specified transcription. - - If the recording was multi-channel, then there will be 2 transcripts. - - The caller/called party transcript will be the first item while - [``](/docs/voice/bxml/playAudio) and - [``](/docs/voice/bxml/speakSentence) transcript will be - the second item. - - During a [``](/docs/voice/bxml/transfer) the A-leg transcript - will be the first item while the B-leg transcript will be the second - item. - operationId: getRecordingTranscription - parameters: - - $ref: '#/components/parameters/accountId' - - $ref: '#/components/parameters/callId' - - $ref: '#/components/parameters/recordingId' - responses: - '200': - $ref: '#/components/responses/getRecordingTranscriptionResponse' - '400': - $ref: '#/components/responses/voiceBadRequestError' - '401': - $ref: '#/components/responses/voiceUnauthorizedError' - '403': - $ref: '#/components/responses/voiceForbiddenError' - '404': - $ref: '#/components/responses/voiceNotFoundError' - '405': - $ref: '#/components/responses/voiceNotAllowedError' - '415': - $ref: '#/components/responses/voiceUnsupportedMediaTypeError' - '429': - $ref: '#/components/responses/voiceTooManyRequestsError' - '500': - $ref: '#/components/responses/voiceInternalServerError' - post: - tags: - - Recordings - summary: Create Transcription Request - description: >- - Generate the transcription for a specific recording. Transcription - - can succeed only for recordings of length greater than 500 milliseconds - and - - less than 4 hours. - operationId: transcribeCallRecording - parameters: - - $ref: '#/components/parameters/accountId' - - $ref: '#/components/parameters/callId' - - $ref: '#/components/parameters/recordingId' - requestBody: - $ref: '#/components/requestBodies/transcribeRecordingRequest' - responses: - '204': - description: Transcription was successfully requested. - '400': - $ref: '#/components/responses/voiceBadRequestError' - '401': - $ref: '#/components/responses/voiceUnauthorizedError' - '403': - $ref: '#/components/responses/voiceForbiddenError' - '404': - $ref: '#/components/responses/voiceNotFoundError' - '405': - $ref: '#/components/responses/voiceNotAllowedError' - '415': - $ref: '#/components/responses/voiceUnsupportedMediaTypeError' - '429': - $ref: '#/components/responses/voiceTooManyRequestsError' - '500': - $ref: '#/components/responses/voiceInternalServerError' - delete: - tags: - - Recordings - summary: Delete Transcription - description: >- - Deletes the specified recording's transcription. - - - Note: After the deletion is requested and a `204` is returned, the - transcription will not be accessible anymore. However, it is not deleted - immediately. This deletion process, while transparent and irreversible, - can take an additional 24 to 48 hours. - operationId: deleteRecordingTranscription - parameters: - - $ref: '#/components/parameters/accountId' - - $ref: '#/components/parameters/callId' - - $ref: '#/components/parameters/recordingId' - responses: - '204': - description: The transcription was successfully deleted. - '400': - $ref: '#/components/responses/voiceBadRequestError' - '401': - $ref: '#/components/responses/voiceUnauthorizedError' - '403': - $ref: '#/components/responses/voiceForbiddenError' - '404': - $ref: '#/components/responses/voiceNotFoundError' - '405': - $ref: '#/components/responses/voiceNotAllowedError' - '415': - $ref: '#/components/responses/voiceUnsupportedMediaTypeError' - '429': - $ref: '#/components/responses/voiceTooManyRequestsError' - '500': - $ref: '#/components/responses/voiceInternalServerError' - servers: *ref_1 - /accounts/{accountId}/statistics: - get: - tags: - - Statistics - summary: Get Account Statistics - description: Returns details about the current state of the account. - operationId: getStatistics - parameters: - - $ref: '#/components/parameters/accountId' - responses: - '200': - $ref: '#/components/responses/getStatisticsResponse' - '400': - $ref: '#/components/responses/voiceBadRequestError' - '401': - $ref: '#/components/responses/voiceUnauthorizedError' - '403': - $ref: '#/components/responses/voiceForbiddenError' - '404': - $ref: '#/components/responses/voiceNotFoundError' - '405': - $ref: '#/components/responses/voiceNotAllowedError' - '415': - $ref: '#/components/responses/voiceUnsupportedMediaTypeError' - '429': - $ref: '#/components/responses/voiceTooManyRequestsError' - '500': - $ref: '#/components/responses/voiceInternalServerError' - servers: *ref_1 - /accounts/{accountId}/calls/{callId}/transcriptions: - get: - tags: - - Transcriptions - summary: List Real-time Transcriptions - description: >- - List the transcriptions created on this call via - [startTranscription](/docs/voice/bxml/startTranscription). - operationId: listRealTimeTranscriptions - parameters: - - $ref: '#/components/parameters/accountId' - - $ref: '#/components/parameters/callId' - responses: - '200': - $ref: '#/components/responses/listTranscriptionsResponse' - '400': - $ref: '#/components/responses/voiceBadRequestError' - '401': - $ref: '#/components/responses/voiceUnauthorizedError' - '403': - $ref: '#/components/responses/voiceForbiddenError' - '404': - $ref: '#/components/responses/voiceNotFoundError' - '405': - $ref: '#/components/responses/voiceNotAllowedError' - '415': - $ref: '#/components/responses/voiceUnsupportedMediaTypeError' - '429': - $ref: '#/components/responses/voiceTooManyRequestsError' - '500': - $ref: '#/components/responses/voiceInternalServerError' - servers: *ref_1 - /accounts/{accountId}/calls/{callId}/transcriptions/{transcriptionId}: - get: - tags: - - Transcriptions - summary: Get Real-time Transcription - description: >- - Retrieve the specified transcription that was created on this call via - [startTranscription](/docs/voice/bxml/startTranscription). - operationId: getRealTimeTranscription - parameters: - - $ref: '#/components/parameters/accountId' - - $ref: '#/components/parameters/callId' - - $ref: '#/components/parameters/transcriptionId' - responses: - '200': - $ref: '#/components/responses/getCallTranscriptionResponse' - '400': - $ref: '#/components/responses/voiceBadRequestError' - '401': - $ref: '#/components/responses/voiceUnauthorizedError' - '403': - $ref: '#/components/responses/voiceForbiddenError' - '404': - $ref: '#/components/responses/voiceNotFoundError' - '405': - $ref: '#/components/responses/voiceNotAllowedError' - '415': - $ref: '#/components/responses/voiceUnsupportedMediaTypeError' - '429': - $ref: '#/components/responses/voiceTooManyRequestsError' - '500': - $ref: '#/components/responses/voiceInternalServerError' - delete: - tags: - - Transcriptions - summary: Delete Real-time Transcription - description: >- - Delete the specified transcription that was created on this call via - [startTranscription](/docs/voice/bxml/startTranscription). - - - Note: After the deletion is requested and a `200` is returned, the - transcription will not be accessible anymore. However, it is not deleted - immediately. This deletion process, while transparent and irreversible, - can take an additional 24 to 48 hours. - operationId: deleteRealTimeTranscription - parameters: - - $ref: '#/components/parameters/accountId' - - $ref: '#/components/parameters/callId' - - $ref: '#/components/parameters/transcriptionId' - responses: - '200': - $ref: '#/components/responses/deleteCallTranscriptionResponse' - '400': - $ref: '#/components/responses/voiceBadRequestError' - '401': - $ref: '#/components/responses/voiceUnauthorizedError' - '403': - $ref: '#/components/responses/voiceForbiddenError' - '404': - $ref: '#/components/responses/voiceNotFoundError' - '405': - $ref: '#/components/responses/voiceNotAllowedError' - '415': - $ref: '#/components/responses/voiceUnsupportedMediaTypeError' - '429': - $ref: '#/components/responses/voiceTooManyRequestsError' - '500': - $ref: '#/components/responses/voiceInternalServerError' - servers: *ref_1 - /accounts/{accountId}/code/voice: - post: - tags: - - MFA - summary: Voice Authentication Code - description: Send an MFA Code via a phone call. - operationId: generateVoiceCode - parameters: - - $ref: '#/components/parameters/accountId' - requestBody: - $ref: '#/components/requestBodies/codeRequest' - responses: - '200': - $ref: '#/components/responses/voiceCodeResponse' - '400': - $ref: '#/components/responses/mfaBadRequestError' - '401': - $ref: '#/components/responses/mfaUnauthorizedError' - '403': - $ref: '#/components/responses/mfaForbiddenError' - '500': - $ref: '#/components/responses/mfaInternalServerError' - servers: &ref_2 - - url: https://mfa.bandwidth.com/api/v1 - description: Production - /accounts/{accountId}/code/messaging: - post: - tags: - - MFA - summary: Messaging Authentication Code - description: Send an MFA code via text message (SMS). - operationId: generateMessagingCode - parameters: - - $ref: '#/components/parameters/accountId' - requestBody: - $ref: '#/components/requestBodies/codeRequest' - responses: - '200': - $ref: '#/components/responses/messagingCodeResponse' - '400': - $ref: '#/components/responses/mfaBadRequestError' - '401': - $ref: '#/components/responses/mfaUnauthorizedError' - '403': - $ref: '#/components/responses/mfaForbiddenError' - '500': - $ref: '#/components/responses/mfaInternalServerError' - servers: *ref_2 - /accounts/{accountId}/code/verify: - post: - tags: - - MFA - summary: Verify Authentication Code - description: Verify a previously sent MFA code. - operationId: verifyCode - parameters: - - $ref: '#/components/parameters/accountId' - requestBody: - $ref: '#/components/requestBodies/codeVerify' - responses: - '200': - $ref: '#/components/responses/verifyCodeResponse' - '400': - $ref: '#/components/responses/mfaBadRequestError' - '401': - $ref: '#/components/responses/mfaUnauthorizedError' - '403': - $ref: '#/components/responses/mfaForbiddenError' - '429': - $ref: '#/components/responses/mfaTooManyRequestsError' - '500': - $ref: '#/components/responses/mfaInternalServerError' - servers: *ref_2 - /accounts/{accountId}/phoneNumberLookup: - post: - summary: Create Synchronous Number Lookup - description: >- - Creates a synchronous phone number lookup request. Maximum of 100 - telephone numbers per request. - operationId: createSyncLookup - tags: - - Phone Number Lookup - parameters: - - $ref: '#/components/parameters/accountId1' - requestBody: - $ref: '#/components/requestBodies/createSyncLookupRequest' - responses: - '200': - $ref: '#/components/responses/createSyncLookupResponse' - default: - $ref: '#/components/responses/tnLookupDefaultResponse' - servers: &ref_3 - - url: https://api.bandwidth.com/v2 - description: Production - /accounts/{accountId}/phoneNumberLookup/bulk: - post: - summary: Create Asynchronous Bulk Number Lookup - description: >- - Creates an asynchronous bulk phone number lookup request. Maximum of - 15,000 telephone numbers per request. Use the [Get Asynchronous Bulk - Number Lookup](#tag/Phone-Number-Lookup/operation/getAsyncBulkLookup) - endpoint to check the status of the request and view the results. - operationId: createAsyncBulkLookup - tags: - - Phone Number Lookup - parameters: - - $ref: '#/components/parameters/accountId1' - requestBody: - $ref: '#/components/requestBodies/createAsyncBulkLookupRequest' - responses: - '202': - $ref: '#/components/responses/createAsyncBulkLookupResponse' - default: - $ref: '#/components/responses/tnLookupDefaultResponse' - servers: *ref_3 - /accounts/{accountId}/phoneNumberLookup/bulk/{requestId}: - get: - summary: Get Asynchronous Bulk Number Lookup - description: >- - Get an existing [Asynchronous Bulk Number - Lookup](#tag/Phone-Number-Lookup/operation/createAsyncBulkLookup). Use - this endpoint to check the status of the request and view the results. - operationId: getAsyncBulkLookup - tags: - - Phone Number Lookup - parameters: - - $ref: '#/components/parameters/accountId1' - - $ref: '#/components/parameters/requestId' - responses: - '200': - $ref: '#/components/responses/getAsyncBulkLookupResponse' - default: - $ref: '#/components/responses/tnLookupDefaultResponse' - servers: *ref_3 - /accounts/{accountId}/tollFreeVerification: - post: - tags: - - Toll-Free Verification - summary: Request Toll-Free Verification - description: Submit a request for verification of a toll-free phone number. - operationId: requestTollFreeVerification - parameters: - - $ref: '#/components/parameters/accountId' - requestBody: - $ref: '#/components/requestBodies/requestTollFreeVerificationRequest' - responses: - '202': - description: Accepted - '400': - $ref: '#/components/responses/tfvPostBadRequestResponse' - '401': - $ref: '#/components/responses/tfvUnauthorizedResponse' - '403': - $ref: '#/components/responses/tfvForbiddenResponse' - '405': - $ref: '#/components/responses/tfvNotAllowedResponse' - '429': - $ref: '#/components/responses/tfvTooManyRequestsResponse' - '500': - $ref: '#/components/responses/tfvServerErrorResponse' - '503': - $ref: '#/components/responses/tfvServiceUnavailableResponse' - callbacks: - tfVerificationStatus: - $ref: '#/components/callbacks/tfVerificationStatus' - servers: &ref_4 - - url: https://api.bandwidth.com/api/v2 - description: Production - /accounts/{accountId}/phoneNumbers/{phoneNumber}/tollFreeVerification: - get: - tags: - - Toll-Free Verification - summary: Get Toll-Free Verification Status - description: >- - Gets the verification status for a phone number that is provisioned to - your account. - - Submission information will be appended to the response if it is - available. - operationId: getTollFreeVerificationStatus - parameters: - - $ref: '#/components/parameters/accountId' - - $ref: '#/components/parameters/tfPhoneNumberPathParam' - responses: - '200': - $ref: '#/components/responses/getTollFreeVerificationStatusResponse' - '400': - $ref: '#/components/responses/tfvBadRequestResponse' - '401': - $ref: '#/components/responses/tfvUnauthorizedResponse' - '403': - $ref: '#/components/responses/tfvForbiddenResponse' - '404': - $ref: '#/components/responses/tfvNotFoundResponse' - '405': - $ref: '#/components/responses/tfvNotAllowedResponse' - '429': - $ref: '#/components/responses/tfvTooManyRequestsResponse' - '500': - $ref: '#/components/responses/tfvServerErrorResponse' - '503': - $ref: '#/components/responses/tfvServiceUnavailableResponse' - put: - tags: - - Toll-Free Verification - summary: Update Toll-Free Verification Request - description: >- - Updates a toll-free verification request. - - Submissions are only eligible for resubmission for 7 days within being - processed and if resubmission is allowed (resubmitAllowed field is - true). - operationId: updateTollFreeVerificationRequest - parameters: - - $ref: '#/components/parameters/accountId' - - $ref: '#/components/parameters/tfPhoneNumberPathParam' - requestBody: - $ref: '#/components/requestBodies/updateTollFreeVerificationRequestRequest' - responses: - '202': - description: Accepted - '400': - $ref: '#/components/responses/tfvPostBadRequestResponse' - '401': - $ref: '#/components/responses/tfvUnauthorizedResponse' - '403': - $ref: '#/components/responses/tfvForbiddenResponse' - '405': - $ref: '#/components/responses/tfvNotAllowedResponse' - '429': - $ref: '#/components/responses/tfvTooManyRequestsResponse' - '500': - $ref: '#/components/responses/tfvServerErrorResponse' - '503': - $ref: '#/components/responses/tfvServiceUnavailableResponse' - callbacks: - tfVerificationStatus: - $ref: '#/components/callbacks/tfVerificationStatus' - delete: - description: Delete a toll-free verification submission for a toll-free number. - operationId: deleteVerificationRequest - parameters: - - $ref: '#/components/parameters/accountId' - - $ref: '#/components/parameters/tfPhoneNumberPathParam' - responses: - '204': - $ref: '#/components/responses/noContentResponse' - '400': - $ref: '#/components/responses/tfvBadRequestResponse' - '401': - $ref: '#/components/responses/tfvUnauthorizedResponse' - '403': - $ref: '#/components/responses/tfvForbiddenResponse' - '404': - $ref: '#/components/responses/tfvNotFoundResponse' - '405': - $ref: '#/components/responses/tfvNotAllowedResponse' - '429': - $ref: '#/components/responses/tfvTooManyRequestsResponse' - '500': - $ref: '#/components/responses/tfvServerErrorResponse' - '503': - $ref: '#/components/responses/tfvServiceUnavailableResponse' - summary: Delete a Toll-Free Verification Submission - tags: - - Toll-Free Verification - servers: *ref_4 - /accounts/{accountId}/tollFreeVerification/webhooks/subscriptions: - get: - tags: - - Toll-Free Verification - summary: List Webhook Subscriptions - description: >- - Lists all webhook subscriptions that are registered to receive status - updates for the toll-free verification requests submitted under this - account (password will not be returned through this API - - If `basicAuthentication` is defined, the `password` property of that - object will be null). - operationId: listWebhookSubscriptions - parameters: - - $ref: '#/components/parameters/accountId' - responses: - '200': - $ref: '#/components/responses/listWebhookSubscriptionsResponse' - '400': - $ref: '#/components/responses/tfvPostBadRequestResponse' - '401': - $ref: '#/components/responses/tfvUnauthorizedResponse' - '403': - $ref: '#/components/responses/tfvForbiddenResponse' - '405': - $ref: '#/components/responses/tfvNotAllowedResponse' - '429': - $ref: '#/components/responses/tfvTooManyRequestsResponse' - '500': - $ref: '#/components/responses/tfvServerErrorResponse' - '503': - $ref: '#/components/responses/tfvServiceUnavailableResponse' - post: - tags: - - Toll-Free Verification - summary: Create Webhook Subscription - description: >- - Create a new webhook subscription (this webhook will be called for every - update on every submission). - - In addition to a `callbackUrl`, this subscription can provide optional - HTTP basic authentication credentials (a username and a password). - - The returned subscription object will contain an ID that can be used to - modify or delete the subscription at a later time. - operationId: createWebhookSubscription - parameters: - - $ref: '#/components/parameters/accountId' - requestBody: - $ref: '#/components/requestBodies/webhookSubscriptionRequest' - responses: - '201': - $ref: '#/components/responses/createWebhookSubscriptionResponse' - '400': - $ref: '#/components/responses/tfvBadRequestResponse' - '401': - $ref: '#/components/responses/tfvUnauthorizedResponse' - '403': - $ref: '#/components/responses/tfvForbiddenResponse' - '404': - $ref: '#/components/responses/tfvNotFoundResponse' - '405': - $ref: '#/components/responses/tfvNotAllowedResponse' - '429': - $ref: '#/components/responses/tfvTooManyRequestsResponse' - '500': - $ref: '#/components/responses/tfvServerErrorResponse' - '503': - $ref: '#/components/responses/tfvServiceUnavailableResponse' - servers: *ref_4 - /accounts/{accountId}/tollFreeVerification/webhooks/subscriptions/{id}: - delete: - tags: - - Toll-Free Verification - summary: Delete Webhook Subscription - description: Delete a webhook subscription by ID. - operationId: deleteWebhookSubscription - parameters: - - $ref: '#/components/parameters/accountId' - - $ref: '#/components/parameters/webhookSubscriptionIdPathParam' - responses: - '204': - $ref: '#/components/responses/noContentResponse' - '400': - $ref: '#/components/responses/tfvBadRequestResponse' - '401': - $ref: '#/components/responses/tfvUnauthorizedResponse' - '403': - $ref: '#/components/responses/tfvForbiddenResponse' - '404': - $ref: '#/components/responses/tfvNotFoundResponse' - '405': - $ref: '#/components/responses/tfvNotAllowedResponse' - '429': - $ref: '#/components/responses/tfvTooManyRequestsResponse' - '500': - $ref: '#/components/responses/tfvServerErrorResponse' - '503': - $ref: '#/components/responses/tfvServiceUnavailableResponse' - put: - tags: - - Toll-Free Verification - summary: Update Webhook Subscription - description: >- - Update an existing webhook subscription (`callbackUrl` and - `basicAuthentication` can be updated). - operationId: updateWebhookSubscription - parameters: - - $ref: '#/components/parameters/accountId' - - $ref: '#/components/parameters/webhookSubscriptionIdPathParam' - requestBody: - $ref: '#/components/requestBodies/webhookSubscriptionRequest' - responses: - '200': - $ref: '#/components/responses/updateWebhookSubscriptionResponse' - '400': - $ref: '#/components/responses/tfvBadRequestResponse' - '401': - $ref: '#/components/responses/tfvUnauthorizedResponse' - '403': - $ref: '#/components/responses/tfvForbiddenResponse' - '404': - $ref: '#/components/responses/tfvNotFoundResponse' - '405': - $ref: '#/components/responses/tfvNotAllowedResponse' - '429': - $ref: '#/components/responses/tfvTooManyRequestsResponse' - '500': - $ref: '#/components/responses/tfvServerErrorResponse' - '503': - $ref: '#/components/responses/tfvServiceUnavailableResponse' - servers: *ref_4 - /tollFreeVerification/useCases: - get: - tags: - - Toll-Free Verification - summary: List Toll-Free Use Cases - description: Lists valid toll-free use cases. - operationId: listTollFreeUseCases - responses: - '200': - $ref: '#/components/responses/listTollFreeUseCasesResponse' - '400': - $ref: '#/components/responses/tfvBadRequestResponse' - '401': - $ref: '#/components/responses/tfvUnauthorizedResponse' - '403': - $ref: '#/components/responses/tfvForbiddenResponse' - '404': - $ref: '#/components/responses/tfvNotFoundResponse' - '405': - $ref: '#/components/responses/tfvNotAllowedResponse' - '429': - $ref: '#/components/responses/tfvTooManyRequestsResponse' - '500': - $ref: '#/components/responses/tfvServerErrorResponse' - '503': - $ref: '#/components/responses/tfvServiceUnavailableResponse' - servers: *ref_4 -components: - schemas: - applicationId: - type: string - description: >- - The ID of the Application your from number or senderId is associated - with in the Bandwidth Phone Number Dashboard. - example: 93de2206-9669-4e07-948d-329f4b722ee2 - priorityEnum: - type: string - description: >- - Specifies the message's sending priority with respect to other messages - in your account. For best results and optimal throughput, reserve the - 'high' priority setting for critical messages only. - enum: - - default - - high - example: default - messageStatusEnum: - type: string - description: >- - The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED - DELIVERED ACCEPTED UNDELIVERED. - enum: - - RECEIVED - - QUEUED - - SENDING - - SENT - - FAILED - - DELIVERED - - ACCEPTED - - UNDELIVERED - example: RECEIVED - listMessageDirectionEnum: - type: string - description: The direction of the message. One of INBOUND OUTBOUND. - enum: - - INBOUND - - OUTBOUND - example: INBOUND - messageDirectionEnum: - type: string - description: The direction of the message. One of in out. - enum: - - in - - out - example: in - messageTypeEnum: - type: string - description: The type of message. Either SMS or MMS. - enum: - - sms - - mms - - rcs - example: sms - productTypeEnum: - type: string - description: The type of product associated with the message. - enum: - - LOCAL_A2P - - P2P - - SHORT_CODE_REACH - - TOLL_FREE - - HOSTED_SHORT_CODE - - ALPHA_NUMERIC - - RBM_MEDIA - - RBM_RICH - - RBM_CONVERSATIONAL - example: P2P - fieldError: - type: object - properties: - fieldName: - type: string - description: The name of the field that contains the error - example: from - description: - type: string - description: The error associated with the field - example: >- - '+invalid' must be replaced with a valid E164 formatted telephone - number - messagesList: - title: MessagesList - type: object - properties: - totalCount: - type: integer - description: >- - The total number of messages matched by the search. When the request - has limitTotalCount set to true this value is limited to 10,000. - example: 100 - pageInfo: - $ref: '#/components/schemas/pageInfo' - messages: - type: array - items: - $ref: '#/components/schemas/listMessageItem' - listMessageItem: - title: listMessageItem - type: object - properties: - messageId: - type: string - description: The message id - example: 1589228074636lm4k2je7j7jklbn2 - accountId: - type: string - description: The account id associated with this message. - example: '9900000' - sourceTn: - type: string - description: The source phone number of the message. - example: '+15554443333' - destinationTn: - type: string - description: The recipient phone number of the message. - example: '+15554442222' - messageStatus: - $ref: '#/components/schemas/messageStatusEnum' - messageDirection: - $ref: '#/components/schemas/listMessageDirectionEnum' - messageType: - $ref: '#/components/schemas/messageTypeEnum' - segmentCount: - $ref: '#/components/schemas/segmentCount' - errorCode: - type: integer - description: The numeric error code of the message. - example: 9902 - receiveTime: - type: string - format: date-time - description: The ISO 8601 datetime of the message. - example: 2020-04-07T14:03:07.000Z - carrierName: - type: string - nullable: true - description: >- - The name of the carrier. Not currently supported for MMS coming - soon. - example: other - messageSize: - type: integer - description: The size of the message including message content and headers. - nullable: true - example: 27 - messageLength: - type: integer - description: The length of the message content. - example: 18 - attachmentCount: - type: integer - description: The number of attachments the message has. - nullable: true - example: 1 - recipientCount: - type: integer - description: The number of recipients the message has. - nullable: true - example: 1 - campaignClass: - type: string - description: The campaign class of the message if it has one. - nullable: true - example: T - campaignId: - type: string - description: The campaign ID of the message if it has one. - nullable: true - example: CJEUMDK - bwLatency: - type: integer - description: >- - The Bandwidth latency of the message in seconds. Only available for - accounts with the Advanced Quality Metrics feature enabled. - nullable: true - example: 20 - carrierLatency: - type: integer - description: >- - The carrier latency of the message in seconds. Only available for - OUTBOUND messages from accounts with the Advanced Quality Metrics - feature enabled. - nullable: true - example: 20 - callingNumberCountryA3: - type: string - description: The A3 country code of the calling number. - nullable: true - example: USA - calledNumberCountryA3: - type: string - description: The A3 country code of the called number. - nullable: true - example: USA - product: - type: string - description: The messaging product associated with the message. - nullable: true - example: P2P - location: - type: string - description: The location ID associated with this message. - nullable: true - example: 123ID - pageInfo: - title: PageInfo - type: object - properties: - prevPage: - type: string - description: The link to the previous page for pagination. - example: >- - https://messaging.bandwidth.com/api/v2/users/accountId/messages?messageStatus=DLR_EXPIRED&nextPage=DLAPE902 - nextPage: - type: string - description: The link to the next page for pagination. - example: >- - https://messaging.bandwidth.com/api/v2/users/accountId/messages?messageStatus=DLR_EXPIRED&prevPage=GL83PD3C - prevPageToken: - type: string - description: The isolated pagination token for the previous page. - example: DLAPE902 - nextPageToken: - type: string - description: The isolated pagination token for the next page. - example: GL83PD3C - messagingRequestError: - title: MessagingRequestError - type: object - properties: - type: - type: string - description: - type: string - required: - - type - - description - createMessageRequestError: - title: CreateMessageRequestError - type: object - properties: - type: - type: string - description: - type: string - fieldErrors: - type: array - items: - $ref: '#/components/schemas/fieldError' - required: - - type - - description - id: - type: string - description: The ID of the message. - example: 1589228074636lm4k2je7j7jklbn2 - media: - title: Media - type: object - properties: - content: - type: string - contentLength: - type: integer - mediaName: - type: string - segmentCount: - type: integer - description: >- - The number of segments the user's message is broken into before sending - over carrier networks. - example: 1 - tag: - title: Tag - type: string - description: >- - A custom string that will be included in callback events of the message. - Max 1024 characters. - example: custom string - expiration: - type: string - format: date-time - description: >- - A string with the date/time value that the message will automatically - expire by. This must be a valid RFC-3339 value, e.g., - 2021-03-14T01:59:26Z or 2021-03-13T20:59:26-05:00. Must be a date-time - in the future. - example: '2021-02-01T11:29:18-05:00' - carrierName: - type: string - description: >- - The name of the Authorized Message Provider (AMP) that handled this - message. - - In the US, this is the carrier that the message was sent to. - - This field is present only when this account feature has been enabled. - example: AT&T - message: - title: Message - type: object - properties: - id: - type: string - description: The id of the message. - example: 1589228074636lm4k2je7j7jklbn2 - owner: - type: string - description: The Bandwidth phone number associated with the message. - example: '+15554443333' - applicationId: - $ref: '#/components/schemas/applicationId' - time: - type: string - format: date-time - description: The datetime stamp of the message in ISO 8601 - example: 2024-12-02T20:15:57.278Z - segmentCount: - $ref: '#/components/schemas/segmentCount' - direction: - $ref: '#/components/schemas/messageDirectionEnum' - to: - uniqueItems: true - type: array - items: - type: string - description: The phone number recipients of the message. - example: - - '+15552223333' - from: - type: string - description: The phone number the message was sent from. - example: '+15553332222' - media: - uniqueItems: true - type: array - items: - type: string - description: >- - The list of media URLs sent in the message. Including a `filename` - field in the `Content-Disposition` header of the media linked with a - URL will set the displayed file name. This is a best practice to - ensure that your media has a readable file name. - example: - - https://dev.bandwidth.com/images/bandwidth-logo.png - text: - type: string - description: The contents of the message. - example: Hello world - tag: - $ref: '#/components/schemas/tag' - priority: - $ref: '#/components/schemas/priorityEnum' - expiration: - $ref: '#/components/schemas/expiration' - messageRequest: - title: MessageRequest - type: object - required: - - applicationId - - to - - from - properties: - applicationId: - $ref: '#/components/schemas/applicationId' - to: - uniqueItems: true - type: array - description: The phone number(s) the message should be sent to in E164 format. - example: - - '+15554443333' - - '+15552223333' - items: - type: string - from: - type: string - description: >- - Either an alphanumeric sender ID or the sender's Bandwidth phone - number in E.164 format, which must be hosted within Bandwidth and - linked to the account that is generating the message. - - Alphanumeric Sender IDs can contain up to 11 characters, upper-case - letters A-Z, lower-case letters a-z, numbers 0-9, space, hyphen -, - plus +, underscore _ and ampersand &. Alphanumeric Sender IDs must - contain at least one letter. - example: '+15551113333' - text: - $ref: '#/components/schemas/messageText' - media: - $ref: '#/components/schemas/messageMedia' - tag: - $ref: '#/components/schemas/tag' - priority: - $ref: '#/components/schemas/priorityEnum' - expiration: - $ref: '#/components/schemas/expiration' - messageText: - type: string - description: The contents of the text message. Must be 2048 characters or less. - maxLength: 2048 - example: Hello world - messageMedia: - type: array - items: - type: string - format: uri - maxLength: 4096 - description: |- - A list of URLs to include as media attachments as part of the message. - Each URL can be at most 4096 characters. - example: - - https://dev.bandwidth.com/images/bandwidth-logo.png - - https://dev.bandwidth.com/images/github_logo.png - createMultiChannelMessageResponse: - type: object - properties: - links: - type: array - items: - $ref: '#/components/schemas/link' - example: [] - data: - $ref: '#/components/schemas/multiChannelMessageResponseData' - errors: - type: array - items: - $ref: '#/components/schemas/errorObject' - example: [] - multiChannelError: - type: object - properties: - links: - type: array - items: - $ref: '#/components/schemas/link' - example: [] - data: - type: object - nullable: true - example: null - errors: - type: array - items: - $ref: '#/components/schemas/errorObject' - link: - type: object - properties: - rel: - type: string - href: - type: string - errorObject: - type: object - properties: - type: - description: A concise summary of the error used for categorization. - type: string - description: - description: A detailed explanation of the error. - type: string - source: - $ref: '#/components/schemas/errorSource' - required: - - type - - description - - source - errorSource: - title: Error Source - type: object - description: Specifies relevant sources of the error, if any. - properties: - parameter: - type: string - description: The relevant URI query parameter causing the error - field: - type: string - description: The request body field that led to the error - header: - type: string - description: The header field that contributed to the error - reference: - type: string - description: A resource ID or path linked to the error - multiChannelMessageChannelEnum: - description: The channel of the multi-channel message. - type: string - enum: - - RBM - - SMS - - MMS - example: RBM - multiChannelSenderId: - type: string - description: The sender ID of the message. This could be an alphanumeric sender ID. - example: BandwidthRBM - multiChannelDestination: - type: string - description: The phone number the message should be sent to in E164 format. - example: '+15552223333' - multiChannelDestinations: - uniqueItems: true - type: array - description: The destination phone number(s) of the message, in E164 format. - example: - - '+15554443333' - items: - type: string - rbmMessageContentText: - title: RBM Text - type: object - properties: - text: - type: string - description: >- - The text associated with the message. Must be 3270 characters or - less - maxLength: 3270 - example: Hello world - suggestions: - $ref: '#/components/schemas/multiChannelFullActions' - required: - - text - rbmMediaHeightEnum: - type: string - description: The height of the media. - enum: - - SHORT - - MEDIUM - - TALL - example: SHORT - rbmMessageContentFile: - title: RBM Rich Media File - type: object - properties: - fileUrl: - type: string - format: uri - description: The URL of the media file. 100MB is the maximum file size. - example: https://dev.bandwidth.com/images/bandwidth-logo.png - maxLength: 1000 - thumbnailUrl: - type: string - format: uri - description: The URL of the thumbnail image. Applies only to video file media. - example: https://dev.bandwidth.com/images/bandwidth-logo.png - maxLength: 1000 - required: - - fileUrl - mmsMessageContentFile: - title: MMS Media File - type: object - properties: - fileUrl: - type: string - format: uri - description: >- - The URL of a media attachment. - - - For MMS, the API limits file size to 3.5MB. Specific carriers and - channels may have a smaller limit that could cause a large file to - fail, see - [here](https://support.bandwidth.com/hc/en-us/articles/360014235473-What-are-the-MMS-file-size-limits) - for more details. - example: https://dev.bandwidth.com/images/bandwidth-logo.png - maxLength: 1000 - required: - - fileUrl - rbmMessageMedia: - title: RBM Media - type: object - properties: - media: - $ref: '#/components/schemas/rbmMessageContentFile' - suggestions: - $ref: '#/components/schemas/multiChannelFullActions' - required: - - media - rbmCardContent: - type: object - properties: - title: - type: string - description: The title of the card. Must be 200 characters or less. - maxLength: 200 - example: Bandwidth - description: - type: string - description: The description of the card. Must be 2000 characters or less. - maxLength: 2000 - example: Bandwidth is a communications platform as a service (CPaaS) company. - media: - allOf: - - $ref: '#/components/schemas/rbmMessageContentFile' - - type: object - properties: - height: - $ref: '#/components/schemas/rbmMediaHeightEnum' - required: - - height - suggestions: - description: >- - An array of suggested actions for the recipient that will be - displayed on the rich card. - type: array - items: - $ref: '#/components/schemas/multiChannelAction' - maxItems: 4 - rbmStandaloneCard: - title: Standalone Card - type: object - properties: - orientation: - $ref: '#/components/schemas/standaloneCardOrientationEnum' - thumbnailImageAlignment: - $ref: '#/components/schemas/thumbnailAlignmentEnum' - cardContent: - $ref: '#/components/schemas/rbmCardContent' - suggestions: - $ref: '#/components/schemas/multiChannelFullActions' - required: - - orientation - - thumbnailImageAlignment - - cardContent - standaloneCardOrientationEnum: - type: string - enum: - - HORIZONTAL - - VERTICAL - example: VERTICAL - thumbnailAlignmentEnum: - type: string - description: >- - The alignment of the thumbnail image in the card. Only applicable if the - card using horizontal orientation. - enum: - - LEFT - - RIGHT - example: LEFT - rbmMessageCarouselCard: - title: Carousel - type: object - properties: - cardWidth: - $ref: '#/components/schemas/cardWidthEnum' - cardContents: - type: array - items: - $ref: '#/components/schemas/rbmCardContent' - maxItems: 10 - suggestions: - $ref: '#/components/schemas/multiChannelFullActions' - required: - - cardContents - - cardWidth - cardWidthEnum: - type: string - enum: - - SMALL - - MEDIUM - example: SMALL - smsMessageContent: - title: SMS Text - type: object - properties: - text: - $ref: '#/components/schemas/messageText' - required: - - text - mmsMessageContent: - title: MMS Message - type: object - properties: - text: - $ref: '#/components/schemas/messageText' - media: - type: array - items: - $ref: '#/components/schemas/mmsMessageContentFile' - rbmMessageContentRichCard: - title: RBM Rich Card - oneOf: - - $ref: '#/components/schemas/rbmStandaloneCard' - - $ref: '#/components/schemas/rbmMessageCarouselCard' - rbmActionTypeEnum: - type: string - enum: - - REPLY - - DIAL_PHONE - - SHOW_LOCATION - - CREATE_CALENDAR_EVENT - - OPEN_URL - - REQUEST_LOCATION - example: REPLY - rbmOpenUrlEnum: - type: string - description: >- - Specifies how the URL should be opened on a mobile device. - - - `BROWSER` Opens the URL in the device's default browser. If - application is not set or the device doesn’t support WebView, this - option is used by default. - - - `WEBVIEW` Opens the URL in an in-app WebView. - enum: - - BROWSER - - WEBVIEW - example: WEBVIEW - rbmWebViewEnum: - type: string - description: >- - Defines the layout of the WebView on a mobile device. It must be defined - when application is set to `WEBVIEW` - - - `FULL` WebView takes the full screen. - - - `HALF` WebView takes half of the screen. - - - `TALL` WebView takes three-quarters of the screen. - enum: - - FULL - - HALF - - TALL - rbmActionText: - title: Text - type: string - description: Displayed text for user to click - maxLength: 25 - example: Hello world - rbmActionPostbackData: - title: Post Back Data - type: string - format: byte - description: Base64 payload the customer receives when the reply is clicked. - maxLength: 2048 - example: SGVsbG8gd29ybGQ= - rbmActionBase: - type: object - properties: - type: - $ref: '#/components/schemas/rbmActionTypeEnum' - text: - $ref: '#/components/schemas/rbmActionText' - postbackData: - $ref: '#/components/schemas/rbmActionPostbackData' - required: - - text - - postbackData - - type - rbmActionDial: - allOf: - - $ref: '#/components/schemas/rbmActionBase' - - title: Dial Phone - type: object - properties: - phoneNumber: - type: string - description: The phone number to dial. Must be E164 format. - example: '+15552223333' - required: - - phoneNumber - rbmActionViewLocation: - allOf: - - $ref: '#/components/schemas/rbmActionBase' - - title: Show Location - type: object - properties: - latitude: - type: string - format: double - description: The latitude of the location. - example: '37.7749' - longitude: - type: string - format: double - description: The longitude of the location. - example: '-122.4194' - label: - type: string - description: The label of the location. - example: San Francisco - maxLength: 100 - required: - - latitude - - longitude - multiChannelActionCalendarEvent: - allOf: - - $ref: '#/components/schemas/rbmActionBase' - - title: Calendar Event - type: object - properties: - title: - type: string - description: The title of the event. - example: Meeting with John - maxLength: 100 - startTime: - type: string - format: date-time - description: The start time of the event. - example: 2022-09-14T18:20:16.000Z - endTime: - type: string - format: date-time - description: The end time of the event. - example: 2022-09-14T18:20:16.000Z - description: - type: string - description: The description of the event. - example: Discuss the new project - maxLength: 500 - required: - - title - - startTime - - endTime - rbmActionOpenUrl: - allOf: - - $ref: '#/components/schemas/rbmActionBase' - - title: Open URL - type: object - properties: - url: - type: string - format: uri - description: The URL to open in browser. - example: https://dev.bandwidth.com - maxLength: 2048 - application: - $ref: '#/components/schemas/rbmOpenUrlEnum' - webviewViewMode: - $ref: '#/components/schemas/rbmWebViewEnum' - required: - - url - multiChannelFullActions: - type: array - description: An array of suggested actions for the recipient. - items: - $ref: '#/components/schemas/multiChannelAction' - maxItems: 11 - multiChannelAction: - anyOf: - - $ref: '#/components/schemas/rbmActionBase' - - $ref: '#/components/schemas/rbmActionDial' - - $ref: '#/components/schemas/rbmActionViewLocation' - - $ref: '#/components/schemas/multiChannelActionCalendarEvent' - - $ref: '#/components/schemas/rbmActionOpenUrl' - discriminator: - propertyName: type - mapping: - REPLY: '#/components/schemas/rbmActionBase' - DIAL_PHONE: '#/components/schemas/rbmActionDial' - SHOW_LOCATION: '#/components/schemas/rbmActionViewLocation' - CREATE_CALENDAR_EVENT: '#/components/schemas/multiChannelActionCalendarEvent' - OPEN_URL: '#/components/schemas/rbmActionOpenUrl' - REQUEST_LOCATION: '#/components/schemas/rbmActionBase' - multiChannelChannelListObjectBase: - type: object - properties: - from: - $ref: '#/components/schemas/multiChannelSenderId' - applicationId: - $ref: '#/components/schemas/applicationId' - channel: - $ref: '#/components/schemas/multiChannelMessageChannelEnum' - required: - - from - - applicationId - - channel - multiChannelChannelListRBMObject: - allOf: - - $ref: '#/components/schemas/multiChannelChannelListObjectBase' - - type: object - properties: - content: - description: The content of the message. - oneOf: - - $ref: '#/components/schemas/rbmMessageContentText' - - $ref: '#/components/schemas/rbmMessageMedia' - - $ref: '#/components/schemas/rbmMessageContentRichCard' - required: - - content - multiChannelChannelListSMSObject: - allOf: - - $ref: '#/components/schemas/multiChannelChannelListObjectBase' - - type: object - properties: - content: - $ref: '#/components/schemas/smsMessageContent' - required: - - content - multiChannelChannelListMMSObject: - allOf: - - $ref: '#/components/schemas/multiChannelChannelListObjectBase' - - type: object - properties: - content: - $ref: '#/components/schemas/mmsMessageContent' - required: - - content - multiChannelChannelListRBMResponseObject: - allOf: - - $ref: '#/components/schemas/multiChannelChannelListRBMObject' - - $ref: '#/components/schemas/multiChannelChannelListOwnerObject' - multiChannelChannelListSMSResponseObject: - allOf: - - $ref: '#/components/schemas/multiChannelChannelListSMSObject' - - $ref: '#/components/schemas/multiChannelChannelListOwnerObject' - multiChannelChannelListMMSResponseObject: - allOf: - - $ref: '#/components/schemas/multiChannelChannelListMMSObject' - - $ref: '#/components/schemas/multiChannelChannelListOwnerObject' - multiChannelChannelListRequestObject: - anyOf: - - $ref: '#/components/schemas/multiChannelChannelListRBMObject' - - $ref: '#/components/schemas/multiChannelChannelListSMSObject' - - $ref: '#/components/schemas/multiChannelChannelListMMSObject' - discriminator: - propertyName: channel - mapping: - RBM: '#/components/schemas/multiChannelChannelListRBMObject' - SMS: '#/components/schemas/multiChannelChannelListSMSObject' - MMS: '#/components/schemas/multiChannelChannelListMMSObject' - multiChannelChannelListOwnerObject: - type: object - properties: - owner: - type: string - description: >- - The Bandwidth senderId associated with the message. Identical to - 'from'. - required: - - owner - multiChannelChannelListResponseObject: - anyOf: - - $ref: '#/components/schemas/multiChannelChannelListRBMResponseObject' - - $ref: '#/components/schemas/multiChannelChannelListSMSResponseObject' - - $ref: '#/components/schemas/multiChannelChannelListMMSResponseObject' - discriminator: - propertyName: channel - mapping: - RBM: '#/components/schemas/multiChannelChannelListRBMResponseObject' - SMS: '#/components/schemas/multiChannelChannelListSMSResponseObject' - MMS: '#/components/schemas/multiChannelChannelListMMSResponseObject' - multiChannelMessageRequest: - description: Multi-Channel Message Request - type: object - properties: - to: - $ref: '#/components/schemas/multiChannelDestination' - channelList: - type: array - description: >- - A list of message bodies. The messages will be attempted in the - order they are listed. Once a message sends successfully, the others - will be ignored. - items: - $ref: '#/components/schemas/multiChannelChannelListRequestObject' - maxItems: 4 - tag: - $ref: '#/components/schemas/tag' - priority: - $ref: '#/components/schemas/priorityEnum' - expiration: - $ref: '#/components/schemas/expiration' - required: - - to - - channelList - multiChannelMessageResponseData: - description: The data returned in a multichannel message response. - type: object - properties: - id: - $ref: '#/components/schemas/id' - time: - description: The time the message was received by the Bandwidth API. - type: string - format: date-time - example: 2025-01-01T18:20:16.000Z - direction: - $ref: '#/components/schemas/messageDirectionEnum' - to: - $ref: '#/components/schemas/multiChannelDestinations' - channelList: - type: array - description: >- - A list of message bodies. The messages will be attempted in the - order they are listed. Once a message sends successfully, the others - will be ignored. - items: - $ref: '#/components/schemas/multiChannelChannelListResponseObject' - maxItems: 4 - tag: - $ref: '#/components/schemas/tag' - priority: - $ref: '#/components/schemas/priorityEnum' - expiration: - $ref: '#/components/schemas/expiration' - required: - - id - - time - - direction - - to - - channelList - multiChannelMessageContent: - description: The structure of the content field of a multichannel message. - type: object - properties: - text: - type: string - media: - $ref: '#/components/schemas/rbmMessageContentFile' - rbmSuggestionResponse: - type: object - properties: - text: - type: string - description: The text associated with the suggestion response. - example: Yes, I would like to proceed - postbackData: - $ref: '#/components/schemas/rbmActionPostbackData' - rbmLocationResponse: - type: object - properties: - latitude: - type: string - format: double - description: The latitude of the client's location. - example: '37.7749' - longitude: - type: string - format: double - description: The longitude of the client's location. - example: '-122.4194' - callback: - description: >- - Callbacks are divided into two types based on direction of the related - message: - - - `statusCallback` indicates status of an outbound MT SMS, MMS, or RBM - message. - - - `inboundCallback` indicates an inbound MO message or a multichannel - message client's response to a suggestion or location request. - type: object - oneOf: - - $ref: '#/components/schemas/statusCallback' - - $ref: '#/components/schemas/inboundCallback' - discriminator: - propertyName: type - mapping: - message-sent: '#/components/schemas/statusCallback' - message-delivered: '#/components/schemas/statusCallback' - message-failed: '#/components/schemas/statusCallback' - message-read: '#/components/schemas/statusCallback' - message-received: '#/components/schemas/inboundCallback' - request-location-response: '#/components/schemas/inboundCallback' - suggestion-response: '#/components/schemas/inboundCallback' - statusCallback: - type: object - description: >- - Represents a status callback for an outbound MT SMS or MMS or RBM - message. - properties: - time: - type: string - format: date-time - example: 2024-12-02T20:15:57.278Z - eventTime: - type: string - description: >- - Represents the time at which the message was read, for - `message-read` callbacks. - format: date-time - example: 2024-12-02T20:15:58.278Z - type: - $ref: '#/components/schemas/statusCallbackTypeEnum' - to: - type: string - description: >- - The destination phone number the message was sent to. - - For status callbacks, this the the Bandwidth user's client phone - number. - example: '+15552223333' - description: - type: string - description: A detailed description of the event described by the callback. - example: Message delivered to carrier. - message: - $ref: '#/components/schemas/statusCallbackMessage' - errorCode: - type: integer - description: Optional error code, applicable only when type is `message-failed`. - example: 4405 - carrierName: - $ref: '#/components/schemas/carrierName' - required: - - time - - type - - to - - description - - message - inboundCallback: - type: object - description: Represents an inbound callback. - properties: - time: - type: string - format: date-time - example: 2024-12-02T20:15:57.278Z - type: - $ref: '#/components/schemas/inboundCallbackTypeEnum' - to: - type: string - description: > - The destination phone number the message was sent to. - - For inbound callbacks, this is the Bandwidth number or alphanumeric - identifier that received the message. - example: '+15552223333' - description: - type: string - description: A detailed description of the event described by the callback. - example: Incoming message received - message: - $ref: '#/components/schemas/inboundCallbackMessage' - carrierName: - $ref: '#/components/schemas/carrierName' - required: - - time - - type - - to - - description - - message - statusCallbackTypeEnum: - type: string - description: >- - The possible status callbacks when sending an MT SMS or MMS or RBM - message: - - - `message-sending` indicates that Bandwidth is sending the message to - the upstream provider. - - - `message-delivered` indicates that the message was successfully sent. - - - `message-failed` indicates that the message could not be sent to the - intended recipient. - - - `message-read` indicates that the RBM message was read by the - recipient. - enum: - - message-sending - - message-delivered - - message-failed - - message-read - example: message-delivered - inboundCallbackTypeEnum: - type: string - description: >- - The possible inbound callback types originating from MO messages or - multichannel message client responses: - - - `message-received` indicates an MO message from a Bandwidth user's - client to a Bandwidth number. - - - `request-location-response` indicates a response to a location request - sent by the Bandwidth user's client after receiving an RBM message. - - - `suggestion-response` indicates a response to a suggestion sent by the - Bandwidth user's client after receiving an RBM message. - enum: - - message-received - - request-location-response - - suggestion-response - example: message-received - statusCallbackMessage: - description: Message payload schema within a callback - type: object - properties: - id: - type: string - description: A unique identifier of the message. - example: 1661365814859loidf7mcwd4qacn7 - owner: - type: string - description: >- - The Bandwidth phone number or alphanumeric identifier associated - with the message. - example: '+15553332222' - applicationId: - $ref: '#/components/schemas/applicationId' - time: - type: string - format: date-time - example: 2024-12-02T20:15:57.666Z - segmentCount: - $ref: '#/components/schemas/segmentCount' - direction: - $ref: '#/components/schemas/messageDirectionEnum' - to: - description: The phone number recipients of the message. - uniqueItems: true - type: array - items: - type: string - example: - - '+15552223333' - from: - type: string - description: >- - The Bandwidth phone number or alphanumeric identifier the message - was sent from. - example: '+15553332222' - text: - type: string - example: Hello world - tag: - $ref: '#/components/schemas/tag' - media: - type: array - description: Optional media, not applicable for sms - items: - type: string - format: uri - example: - - https://dev.bandwidth.com/images/bandwidth-logo.png - - https://dev.bandwidth.com/images/github_logo.png - priority: - $ref: '#/components/schemas/priorityEnum' - channel: - $ref: '#/components/schemas/multiChannelMessageChannelEnum' - required: - - id - - owner - - applicationId - - time - - segmentCount - - direction - - to - - from - inboundCallbackMessage: - allOf: - - $ref: '#/components/schemas/statusCallbackMessage' - - type: object - properties: - content: - $ref: '#/components/schemas/multiChannelMessageContent' - suggestionResponse: - $ref: '#/components/schemas/rbmSuggestionResponse' - locationResponse: - $ref: '#/components/schemas/rbmLocationResponse' - required: - - id - - owner - - applicationId - - time - - segmentCount - - direction - - to - - from - callbackMethodEnum: - type: string - nullable: true - default: POST - enum: - - GET - - POST - description: >- - The HTTP method to use to deliver the callback. GET or POST. Default - value is POST. - example: POST - redirectMethodEnum: - type: string - nullable: true - default: POST - enum: - - GET - - POST - description: >- - The HTTP method to use for the request to `redirectUrl`. GET - - or POST. Default value is POST.

Not allowed if `state` is - `completed`. - example: POST - recordingStateEnum: - type: string - enum: - - paused - - recording - description: |- - The recording state. Possible values: - - `paused` to pause an active recording - - `recording` to resume a paused recording - example: paused - callDirectionEnum: - type: string - enum: - - inbound - - outbound - description: The direction of the call. - example: inbound - fileFormatEnum: - type: string - enum: - - mp3 - - wav - description: The format that the recording is stored in. - example: wav - callStateEnum: - nullable: true - type: string - default: active - enum: - - active - - completed - description: >- - The call state. Possible values:
`active` to redirect the - - call (default)
`completed` to hang up the call if it is answered, - cancel - - it if it is an unanswered outbound call, or reject it if it an - unanswered - - inbound call - example: completed - conferenceStateEnum: - nullable: true - type: string - default: active - enum: - - active - - completed - description: >- - Setting the conference state to `completed` ends the conference and - ejects all members. - example: completed - machineDetectionModeEnum: - type: string - default: async - enum: - - sync - - async - description: >- - The machine detection mode. If set to 'async', the detection - - result will be sent in a 'machineDetectionComplete' callback. If set to - - 'sync', the 'answer' callback will wait for the machine detection to - complete - - and will include its result. - example: async - callTranscriptionDetectedLanguageEnum: - type: string - enum: - - en-US - - es-US - - fr-FR - description: The detected language for this transcription. - example: en-US - callTranscriptionTrackEnum: - type: string - enum: - - inbound - - outbound - description: Which `track` this transcription is derived from. - example: inbound - createCall: - type: object - required: - - answerUrl - - applicationId - - from - - to - properties: - to: - type: string - description: >- - The destination to call (must be an E.164 formatted number - - (e.g. `+15555551212`) or a SIP URI (e.g. - `sip:user@server.example`)). - example: '+19195551234' - from: - type: string - description: >- - A Bandwidth phone number on your account the call should come - - from (must be in E.164 format, like `+15555551212`) even if - `privacy` is set to true. - example: '+15555551212' - privacy: - nullable: true - type: boolean - description: >- - Hide the calling number. The `displayName` field can be used to - customize the displayed name. - example: false - displayName: - nullable: true - type: string - description: >- - The caller display name to use when the call is created. - - May not exceed 256 characters nor contain control characters such as - new lines. - - If `privacy` is true, only the following values are valid: - `Restricted`, `Anonymous`, `Private`, or `Unavailable`. - maxLength: 256 - example: John Doe - uui: - nullable: true - type: string - example: >- - eyJhbGciOiJIUzI1NiJ9.WyJoaSJd.-znkjYyCkgz4djmHUPSXl9YrJ6Nix_XvmlwKGFh5ERM;encoding=jwt,aGVsbG8gd29ybGQ;encoding=base64 - description: >- - A comma-separated list of 'User-To-User' headers to be sent - - in the INVITE when calling a SIP URI. Each value must end with an - 'encoding' - - parameter as described in RFC - - 7433. Only 'jwt', 'base64' and 'hex' encodings are allowed. The - entire value - - cannot exceed 350 characters, including parameters and separators. - applicationId: - type: string - description: The id of the application associated with the `from` number. - example: 1234-qwer-5679-tyui - answerUrl: - type: string - format: uri - description: >- - The full URL to send the Answer - - event to when the called party answers. This endpoint should return - the - - first BXML document to be executed in - the - - call. - - - Must use `https` if specifying `username` and `password`. - maxLength: 2048 - example: https://www.myCallbackServer.example/webhooks/answer - answerMethod: - $ref: '#/components/schemas/callbackMethodEnum' - username: - type: string - nullable: true - description: Basic auth username. - maxLength: 1024 - example: mySecretUsername - password: - type: string - nullable: true - description: Basic auth password. - maxLength: 1024 - example: mySecretPassword1! - answerFallbackUrl: - nullable: true - type: string - format: uri - description: >- - A fallback url which, if provided, will be used to retry the - - `answer` webhook delivery in case `answerUrl` fails to respond - - - Must use `https` if specifying `fallbackUsername` and - `fallbackPassword`. - maxLength: 2048 - example: https://www.myFallbackServer.example/webhooks/answer - answerFallbackMethod: - $ref: '#/components/schemas/callbackMethodEnum' - fallbackUsername: - type: string - nullable: true - description: Basic auth username. - maxLength: 1024 - example: mySecretUsername - fallbackPassword: - type: string - nullable: true - description: Basic auth password. - maxLength: 1024 - example: mySecretPassword1! - disconnectUrl: - nullable: true - type: string - format: uri - description: >- - The URL to send the Disconnect event to when - the call ends. This event does not expect a BXML response. - maxLength: 2048 - example: https://www.myCallbackServer.example/webhooks/disconnect - disconnectMethod: - $ref: '#/components/schemas/callbackMethodEnum' - callTimeout: - nullable: true - type: number - format: double - description: >- - The timeout (in seconds) for the callee to answer the call - - after it starts ringing. If the call does not start ringing within - 30s, - - the call will be cancelled regardless of this value. Can be any - numeric - - value (including decimals) between 1 and 300. - minimum: 1 - maximum: 300 - default: 30 - example: 30 - callbackTimeout: - nullable: true - type: number - format: double - description: >- - This is the timeout (in seconds) to use when delivering webhooks - - for the call. Can be any numeric value (including decimals) between - 1 - - and 25. - minimum: 1 - maximum: 25 - default: 15 - example: 15 - machineDetection: - $ref: '#/components/schemas/machineDetectionConfiguration' - priority: - nullable: true - type: integer - minimum: 1 - maximum: 5 - default: 5 - description: >- - The priority of this call over other calls from your account. For - example, if during a call - - your application needs to place a new call and bridge it with the - current - - call, you might want to create the call with priority 1 so that it - will - - be the next call picked off your queue, ahead of other less time - sensitive - - calls. A lower value means higher priority, so a priority 1 call - takes - - precedence over a priority 2 call. - example: 5 - tag: - nullable: true - type: string - description: >- - A custom string that will be sent with all webhooks for this - - call unless overwritten by a future `` - - verb or `tag` attribute on another verb, or cleared. - - - May be cleared by setting `tag=""` - - - Max length 256 characters. - maxLength: 256 - example: arbitrary text here - createCallResponse: - type: object - required: - - accountId - - answerMethod - - answerUrl - - applicationId - - callId - - callUrl - - disconnectMethod - - from - - to - properties: - applicationId: - type: string - example: 04e88489-df02-4e34-a0ee-27a91849555f - description: The id of the application associated with the `from` number. - accountId: - type: string - example: '9900000' - description: The bandwidth account ID associated with the call. - callId: - type: string - example: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 - description: Programmable Voice API Call ID. - to: - type: string - example: '+19195551234' - description: Recipient of the outgoing call. - from: - type: string - example: '+19195554321' - description: Phone number that created the outbound call. - enqueuedTime: - nullable: true - type: string - format: date-time - description: The time at which the call was accepted into the queue. - example: '2022-06-16T13:15:07.160Z' - callUrl: - type: string - format: uri - example: >- - https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 - description: The URL to update this call's state. - callTimeout: - type: number - format: double - example: 30 - description: >- - The timeout (in seconds) for the callee to answer the call after it - starts ringing. - callbackTimeout: - type: number - format: double - example: 15 - description: >- - This is the timeout (in seconds) to use when delivering webhooks for - the call. - tag: - nullable: true - type: string - example: My custom tag value - description: Custom tag value. - answerMethod: - $ref: '#/components/schemas/callbackMethodEnum' - answerUrl: - type: string - format: uri - example: https://myServer.example/bandwidth/webhooks/answer - description: URL to deliver the `answer` event webhook. - answerFallbackMethod: - $ref: '#/components/schemas/callbackMethodEnum' - answerFallbackUrl: - nullable: true - type: string - format: uri - example: https://myFallbackServer.example/bandwidth/webhooks/answer - description: Fallback URL to deliver the `answer` event webhook. - disconnectMethod: - $ref: '#/components/schemas/callbackMethodEnum' - disconnectUrl: - nullable: true - type: string - format: uri - example: https://myServer.example/bandwidth/webhooks/disconnect - description: URL to deliver the `disconnect` event webhook. - username: - type: string - nullable: true - description: Basic auth username. - maxLength: 1024 - example: mySecretUsername - password: - type: string - nullable: true - description: Basic auth password. - maxLength: 1024 - example: mySecretPassword1! - fallbackUsername: - type: string - nullable: true - description: Basic auth username. - maxLength: 1024 - example: mySecretUsername - fallbackPassword: - type: string - nullable: true - description: Basic auth password. - maxLength: 1024 - example: mySecretPassword1! - priority: - nullable: true - type: integer - example: 5 - description: The priority of this call over other calls from your account. - callState: - type: object - properties: - applicationId: - type: string - description: The application id associated with the call. - example: 04e88489-df02-4e34-a0ee-27a91849555f - accountId: - type: string - description: The account id associated with the call. - example: '9900000' - callId: - type: string - description: The programmable voice API call ID. - example: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 - parentCallId: - nullable: true - type: string - description: >- - The A-leg call id, set only if this call is the B-leg of a - [``](/docs/voice/bxml/transfer). - example: c-25ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 - to: - type: string - description: >- - The phone number that received the call, in E.164 format (e.g. - +15555555555), or if the call was to a SIP URI, the SIP URI. - example: '+19195551234' - from: - type: string - description: >- - The phone number that made the call, in E.164 format (e.g. - +15555555555). - example: '+19195554321' - direction: - $ref: '#/components/schemas/callDirectionEnum' - state: - description: >- - The current state of the call. Current possible values are - - `queued`, `initiated`, `answered` and `disconnected`. Additional - states - - may be added in the future, so your application must be tolerant of - unknown - - values. - type: string - example: disconnected - stirShaken: - nullable: true - type: object - description: >- - For inbound calls, the Bandwidth STIR/SHAKEN implementation will - verify the information provided in the inbound invite request - `Identity` header. - - The verification status is stored in the call state `stirShaken` - property as follows. - - - | Property | Description | - - |:------------------|:------------| - - | verstat | (optional) The verification status indicating whether - the verification was successful or not. Possible values are - `TN-Validation-Passed` or `TN-Validation-Failed`. | - - | attestationIndicator | (optional) The attestation level verified - by Bandwidth. Possible values are `A` (full), `B` (partial) or `C` - (gateway). | - - | originatingId | (optional) A unique origination identifier. | - - - Note that these are common properties but that the `stirShaken` - object is free form and can contain other key-value pairs. - - - More information: [Understanding - STIR/SHAKEN](https://www.bandwidth.com/regulations/stir-shaken). - additionalProperties: - type: string - example: - verstat: TN-Validation-Passed - attestationIndicator: A - originatingId: abc123 - identity: - nullable: true - type: string - description: >- - The value of the `Identity` header from the inbound invite - - request. Only present for inbound calls and if the account is - configured - - to forward this header. - example: >- - eyJhbGciOiJFUzI1NiIsInBwdCI6InNoYWtlbiIsInR5cCI6InBhc3Nwb3J0IiwieDV1IjoiaHR0cHM6Ly9idy1zaGFrZW4tY2VydC1wdWIuczMuYW1hem9uYXdzLmNvbS9iYW5kd2lkdGgtc2hha2VuLWNlcnRfMjAyMzA3MTYucGVtIn0.eyJhdHRlc3QiOiJBIiwiZGVzdCI6eyJ0biI6WyIxOTg0MjgyMDI4MCJdfSwiaWF0IjoxNjU2NTM0MzM2LCJvcmlnIjp7InRuIjoiMTkxOTQ0NDI2ODMifSwib3JpZ2lkIjoiNDk0NTlhOGEtNDJmNi0zNTFjLTkzNjEtYWRmNTdhOWUwOGNhIn0.56un9sRw_uH-sbJvnUsqdevlVxbOVjn8MVlGTlBMicjaZuRRwxfiNp-C9zYCMKTTCbc-QdYPN05F61XNVN4D3w;info=;alg=ES256;ppt=shaken - enqueuedTime: - nullable: true - type: string - format: date-time - description: The time this call was placed in queue. - example: '2022-06-16T13:15:07.160Z' - startTime: - nullable: true - type: string - format: date-time - description: >- - The time the call was initiated, in ISO 8601 format. `null` if the - call is still in your queue. - example: '2022-06-16T13:15:07.160Z' - answerTime: - nullable: true - type: string - format: date-time - description: >- - Populated once the call has been answered, with the time in ISO 8601 - format. - example: '2022-06-16T13:15:18.126Z' - endTime: - nullable: true - type: string - format: date-time - description: Populated once the call has ended, with the time in ISO 8601 format. - example: '2022-06-16T13:15:18.314Z' - disconnectCause: - nullable: true - type: string - description: >- - | Cause | Description | - - |:------|:------------| - - | `hangup`| One party hung up the call, a - [``](../../bxml/verbs/hangup.md) verb was executed, or there - was no more BXML to execute; it indicates that the call ended - normally. | - - | `busy` | Callee was busy. | - - | `timeout` | Call wasn't answered before the `callTimeout` was - reached. | - - | `cancel` | Call was cancelled by its originator while it was - ringing. | - - | `rejected` | Call was rejected by the callee. | - - | `callback-error` | BXML callback couldn't be delivered to your - callback server. | - - | `invalid-bxml` | Invalid BXML was returned in response to a - callback. | - - | `application-error` | An unsupported action was tried on the call, - e.g. trying to play a .ogg audio. | - - | `account-limit` | Account rate limits were reached. | - - | `node-capacity-exceeded` | System maximum capacity was reached. | - - | `error` | Some error not described in any of the other causes - happened on the call. | - - | `unknown` | Unknown error happened on the call. | - - - Note: This list is not exhaustive and other values can appear in the - future. - errorMessage: - nullable: true - type: string - description: >- - Populated only if the call ended with an error, with text explaining - the reason. - example: null - errorId: - nullable: true - type: string - description: >- - Populated only if the call ended with an error, with a Bandwidth - internal id that references the error event. - example: null - lastUpdate: - type: string - format: date-time - description: The last time the call had a state update, in ISO 8601 format. - example: '2022-06-16T13:15:18.314Z' - updateCall: - type: object - properties: - state: - $ref: '#/components/schemas/callStateEnum' - redirectUrl: - description: |- - The URL to send the [Redirect](/docs/voice/bxml/redirect) event - to which will provide new BXML. - - Required if `state` is `active`. - - Not allowed if `state` is `completed`. - nullable: true - type: string - format: uri - example: https://myServer.example/bandwidth/webhooks/redirect - redirectMethod: - $ref: '#/components/schemas/redirectMethodEnum' - username: - type: string - nullable: true - description: Basic auth username. - maxLength: 1024 - example: mySecretUsername - password: - type: string - nullable: true - description: Basic auth password. - maxLength: 1024 - example: mySecretPassword1! - redirectFallbackUrl: - nullable: true - type: string - format: uri - description: |- - A fallback url which, if provided, will be used to retry the - redirect callback delivery in case `redirectUrl` fails to respond. - example: https://myFallbackServer.example/bandwidth/webhooks/redirect - redirectFallbackMethod: - $ref: '#/components/schemas/redirectMethodEnum' - fallbackUsername: - type: string - nullable: true - description: Basic auth username. - maxLength: 1024 - example: mySecretUsername - fallbackPassword: - type: string - nullable: true - description: Basic auth password. - maxLength: 1024 - example: mySecretPassword1! - tag: - nullable: true - type: string - description: >- - A custom string that will be sent with this and all future - - callbacks unless overwritten by a future `tag` attribute or - [``](/docs/voice/bxml/tag) - - verb, or cleared. - - - May be cleared by setting `tag=""`. - - - Max length 256 characters. - - - Not allowed if `state` is `completed`. - maxLength: 256 - example: My Custom Tag - updateCallRecording: - type: object - required: - - state - properties: - state: - $ref: '#/components/schemas/recordingStateEnum' - accountStatistics: - type: object - properties: - currentCallQueueSize: - type: integer - description: The number of calls currently enqueued. - example: 0 - maxCallQueueSize: - type: integer - description: >- - The maximum size of the queue before outgoing calls start being - rejected. - example: 900 - callRecordingMetadata: - type: object - properties: - applicationId: - $ref: '#/components/schemas/applicationId1' - accountId: - $ref: '#/components/schemas/accountId' - callId: - $ref: '#/components/schemas/callId' - parentCallId: - $ref: '#/components/schemas/parentCallId' - recordingId: - $ref: '#/components/schemas/recordingId' - to: - $ref: '#/components/schemas/to' - from: - $ref: '#/components/schemas/from' - transferCallerId: - $ref: '#/components/schemas/transferCallerId' - transferTo: - $ref: '#/components/schemas/transferTo' - duration: - $ref: '#/components/schemas/duration' - direction: - $ref: '#/components/schemas/callDirectionEnum' - channels: - $ref: '#/components/schemas/channels' - startTime: - $ref: '#/components/schemas/startTime' - endTime: - $ref: '#/components/schemas/endTime' - fileFormat: - $ref: '#/components/schemas/fileFormatEnum' - status: - $ref: '#/components/schemas/status' - mediaUrl: - $ref: '#/components/schemas/mediaUrl' - transcription: - $ref: '#/components/schemas/recordingTranscriptionMetadata' - recordingName: - $ref: '#/components/schemas/recordingName' - conference: - type: object - properties: - id: - type: string - description: The Bandwidth-generated conference ID. - example: conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9 - name: - type: string - description: The name of the conference, as specified by your application. - example: my-conference-name - createdTime: - type: string - format: date-time - description: The time the conference was initiated, in ISO 8601 format. - example: '2022-06-17T22:19:40.375Z' - completedTime: - nullable: true - type: string - format: date-time - description: The time the conference was terminated, in ISO 8601 format. - example: '2022-06-17T22:20:00.000Z' - conferenceEventUrl: - nullable: true - type: string - format: uri - description: The URL to send the conference-related events. - example: https://myServer.example/bandwidth/webhooks/conferenceEvent - conferenceEventMethod: - $ref: '#/components/schemas/callbackMethodEnum' - tag: - nullable: true - type: string - description: >- - The custom string attached to the conference that will be sent with - callbacks. - example: my custom tag - activeMembers: - type: array - nullable: true - items: - $ref: '#/components/schemas/conferenceMember' - description: >- - A list of active members of the conference. Omitted if this - - is a response to the [Get Conferences - endpoint](/apis/voice#tag/Conferences/operation/listConferences). - updateConference: - type: object - properties: - status: - $ref: '#/components/schemas/conferenceStateEnum' - redirectUrl: - nullable: true - type: string - format: uri - description: >- - The URL to send the - [conferenceRedirect](/docs/voice/webhooks/conferenceRedirect) - - event which will provide new BXML. Not allowed if `state` is - `completed`, - - but required if `state` is `active`. - example: https://myServer.example/bandwidth/webhooks/conferenceRedirect - redirectMethod: - $ref: '#/components/schemas/redirectMethodEnum' - username: - type: string - nullable: true - description: Basic auth username. - maxLength: 1024 - example: mySecretUsername - password: - type: string - nullable: true - description: Basic auth password. - maxLength: 1024 - example: mySecretPassword1! - redirectFallbackUrl: - nullable: true - type: string - format: uri - description: >- - A fallback url which, if provided, will be used to retry the - - `conferenceRedirect` webhook delivery in case `redirectUrl` fails to - respond. Not - - allowed if `state` is `completed`. - example: >- - https://myFallbackServer.example/bandwidth/webhooks/conferenceRedirect - redirectFallbackMethod: - $ref: '#/components/schemas/redirectMethodEnum' - fallbackUsername: - type: string - nullable: true - description: Basic auth username. - maxLength: 1024 - example: mySecretUsername - fallbackPassword: - type: string - nullable: true - description: Basic auth password. - maxLength: 1024 - example: mySecretPassword1! - conferenceMember: - type: object - properties: - callId: - $ref: '#/components/schemas/callId' - conferenceId: - $ref: '#/components/schemas/conferenceId' - memberUrl: - type: string - format: uri - description: >- - A URL that may be used to retrieve information about or update - - the state of this conference member. This is the URL of this - member's - - [Get Conference - Member](/apis/voice-apis/voice/#tag/Conferences/operation/getConferenceMember) - endpoint - - and [Modify Conference - Member](/apis/voice-apis/voice/#tag/Conferences/operation/updateConferenceMember) - - endpoint. - example: >- - https://voice.bandwidth.com/api/v2/accounts/9900000/conferences/conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9/members/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 - mute: - type: boolean - description: >- - Whether or not this member is currently muted. Members who are muted - are still able to hear other participants. - - - If used in a PUT request, updates this member's mute status. Has no - effect if omitted. - example: false - hold: - type: boolean - description: >- - Whether or not this member is currently on hold. Members who are on - hold are not able to hear or speak in the conference. - - - If used in a PUT request, updates this member's hold status. Has no - effect if omitted. - example: false - callIdsToCoach: - nullable: true - type: array - items: - type: string - description: >- - If this member had a value set for `callIdsToCoach` in its - [Conference](/docs/voice/bxml/conference) verb or this list was - added with a previous PUT request to modify the member, this is that - list of calls. - - - If present in a PUT request, modifies the calls that this member is - coaching. Has no effect if omitted. See the documentation for the - [Conference](/docs/voice/bxml/conference) verb for more details - about coaching. - - Note that this will not add the matching calls to the conference; - each call must individually execute a Conference verb to join. - example: - - c-25ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 - updateConferenceMember: - type: object - properties: - mute: - type: boolean - description: >- - Whether or not this member is currently muted. Members who are muted - are still able to hear other participants. - - - Updates this member's mute status. Has no effect if omitted. - example: false - hold: - type: boolean - description: >- - Whether or not this member is currently on hold. Members who are on - hold are not able to hear or speak in the conference. - - - Updates this member's hold status. Has no effect if omitted. - example: false - callIdsToCoach: - nullable: true - type: array - items: - type: string - description: >- - If this member had a value set for `callIdsToCoach` in its - [Conference](/docs/voice/bxml/conference) verb or this list was - added with a previous PUT request to modify the member, this is that - list of calls. - - - Modifies the calls that this member is coaching. Has no effect if - omitted. See the documentation for the - [Conference](/docs/voice/bxml/conference) verb for more details - about coaching. - - - Note that this will not add the matching calls to the conference; - each call must individually execute a Conference verb to join. - example: - - c-25ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 - conferenceRecordingMetadata: - type: object - properties: - accountId: - $ref: '#/components/schemas/accountId' - conferenceId: - $ref: '#/components/schemas/conferenceId' - name: - $ref: '#/components/schemas/name' - recordingId: - $ref: '#/components/schemas/recordingId' - duration: - $ref: '#/components/schemas/duration' - channels: - $ref: '#/components/schemas/channels' - startTime: - $ref: '#/components/schemas/startTime' - endTime: - $ref: '#/components/schemas/endTime' - fileFormat: - $ref: '#/components/schemas/fileFormatEnum' - status: - $ref: '#/components/schemas/status' - mediaUrl: - $ref: '#/components/schemas/mediaUrl' - recordingName: - $ref: '#/components/schemas/recordingName' - machineDetectionConfiguration: - type: object - description: >- - The machine detection request used to perform machine detection on the - call. Currently, there is an issue where decimal values are not getting - processed correctly. Please use whole number values. We are working to - resolve this issue. Please contact Bandwidth Support if you need more - information. - properties: - mode: - $ref: '#/components/schemas/machineDetectionModeEnum' - detectionTimeout: - nullable: true - type: number - format: double - description: >- - The timeout used for the whole operation, in seconds. If no - - result is determined in this period, a callback with a `timeout` - result - - is sent. - default: 15 - example: 15 - silenceTimeout: - nullable: true - type: number - format: double - description: >- - If no speech is detected in this period, a callback with a 'silence' - result is sent. - default: 10 - example: 10 - speechThreshold: - nullable: true - type: number - format: double - description: >- - When speech has ended and a result couldn't be determined based - - on the audio content itself, this value is used to determine if the - speaker - - is a machine based on the speech duration. If the length of the - speech - - detected is greater than or equal to this threshold, the result will - be - - 'answering-machine'. If the length of speech detected is below this - threshold, - - the result will be 'human'. - default: 10 - example: 10 - speechEndThreshold: - nullable: true - type: number - format: double - description: >- - Amount of silence (in seconds) before assuming the callee has - finished speaking. - default: 5 - example: 5 - machineSpeechEndThreshold: - nullable: true - type: number - format: double - description: >- - When an answering machine is detected, the amount of silence (in - seconds) before assuming the message has finished playing. - - If not provided it will default to the speechEndThreshold value. - example: 5 - delayResult: - nullable: true - type: boolean - description: >- - If set to 'true' and if an answering machine is detected, the - - 'answering-machine' callback will be delayed until the machine is - done - - speaking, or an end of message tone is detected, or until the - 'detectionTimeout' is exceeded. If false, the 'answering-machine' - - result is sent immediately. - default: false - example: false - callbackUrl: - nullable: true - description: >- - The URL to send the 'machineDetectionComplete' webhook when the - detection is completed. Only for 'async' mode. - type: string - format: uri - maxLength: 2048 - example: https://myServer.example/bandwidth/webhooks/machineDetectionComplete - callbackMethod: - $ref: '#/components/schemas/callbackMethodEnum' - username: - type: string - nullable: true - description: Basic auth username. - maxLength: 1024 - example: mySecretUsername - password: - type: string - nullable: true - description: Basic auth password. - maxLength: 1024 - example: mySecretPassword1! - fallbackUrl: - nullable: true - type: string - format: uri - description: >- - A fallback URL which, if provided, will be used to retry the - - machine detection complete webhook delivery in case `callbackUrl` - fails - - to respond - maxLength: 2048 - example: >- - https://myFallbackServer.example/bandwidth/webhooks/machineDetectionComplete - fallbackMethod: - $ref: '#/components/schemas/callbackMethodEnum' - fallbackUsername: - type: string - nullable: true - description: Basic auth username. - maxLength: 1024 - example: mySecretUsername - fallbackPassword: - type: string - nullable: true - description: Basic auth password. - maxLength: 1024 - example: mySecretPassword1! - transcribeRecording: - type: object - properties: - callbackUrl: - type: string - format: uri - description: >- - The URL to send the - [TranscriptionAvailable](/docs/voice/webhooks/transcriptionAvailable) - - event to. You should not include sensitive or - personally-identifiable - - information in the callbackUrl field! Always use the proper username - and - - password fields for authorization. - example: https://myServer.example/bandwidth/webhooks/transcriptionAvailable - callbackMethod: - $ref: '#/components/schemas/callbackMethodEnum' - username: - type: string - nullable: true - description: Basic auth username. - maxLength: 1024 - example: mySecretUsername - password: - type: string - nullable: true - description: Basic auth password. - maxLength: 1024 - example: mySecretPassword1! - tag: - $ref: '#/components/schemas/tag1' - callbackTimeout: - nullable: true - type: number - format: double - minimum: 1 - maximum: 25 - default: 15 - description: >- - This is the timeout (in seconds) to use when delivering the - - webhook to `callbackUrl`. Can be any numeric value (including - decimals) - - between 1 and 25. - example: 5.5 - detectLanguage: - type: boolean - nullable: true - description: >- - A boolean value to indicate that the recording may not be in - English, and the transcription service will need to detect the - dominant language the recording is in and transcribe accordingly. - Current supported languages are English, French, and Spanish. - default: false - example: true - recordingTranscriptions: - type: object - properties: - transcripts: - type: array - items: - $ref: '#/components/schemas/transcription' - callTranscriptionMetadataList: - type: array - items: - $ref: '#/components/schemas/callTranscriptionMetadata' - example: - - transcriptionId: t-3f758f24-c7a2fc78-7c91-401a-8b2e-e542f9c40d6b - transcriptionName: live_transcription - transcriptionUrl: >- - https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-fef240ff-5cfc9091-8069-4863-a8c0-a4dcbbf1f1a4/transcriptions/t-3f758f24-c7a2fc78-7c91-401a-8b2e-e542f9c40d6b - callTranscriptionMetadata: - type: object - properties: - transcriptionId: - type: string - description: The programmable voice API transcription ID. - example: t-3f758f24-c7a2fc78-7c91-401a-8b2e-e542f9c40d6b - transcriptionName: - type: string - description: >- - The programmable voice API transcription name. This name could be - provided by the user when creating the transcription. - example: live_transcription - transcriptionUrl: - type: string - description: >- - A URL that may be used to retrieve the transcription itself. This - points to the - - [Get Call - Transcription](/apis/voice-apis/voice/#tag/Transcriptions/operation/getRealTimeTranscription) - endpoint. - example: >- - https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-fef240ff-5cfc9091-8069-4863-a8c0-a4dcbbf1f1a4/transcriptions/t-3f758f24-c7a2fc78-7c91-401a-8b2e-e542f9c40d6b - callTranscriptionResponse: - type: object - properties: - accountId: - type: string - description: The user account associated with the call. - example: '9900000' - callId: - type: string - description: The call id associated with the event. - example: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 - transcriptionId: - type: string - description: The programmable voice API transcription ID. - example: t-3f758f24-c7a2fc78-7c91-401a-8b2e-e542f9c40d6b - tracks: - type: array - items: - $ref: '#/components/schemas/callTranscription' - example: - - detectedLanguage: en-US - track: inbound - transcript: Hello World! This is an example. - confidence: 0.9 - callTranscription: - type: object - properties: - detectedLanguage: - $ref: '#/components/schemas/callTranscriptionDetectedLanguageEnum' - track: - $ref: '#/components/schemas/callTranscriptionTrackEnum' - transcript: - type: string - description: The transcription itself. - example: Hello World! This is an example. - confidence: - type: number - format: double - minimum: 0 - maximum: 1 - description: >- - How confident the transcription engine was in transcribing the - associated audio (from `0` to `1`). - example: 0.9 - recordingTranscriptionMetadata: - nullable: true - type: object - description: If the recording was transcribed, metadata about the transcription - properties: - id: - type: string - description: The unique transcription ID - example: t-387bd648-18f3-4823-9d16-746bca0003c9 - status: - $ref: '#/components/schemas/status' - completedTime: - type: string - format: date-time - description: The time that the transcription was completed - example: '2022-06-13T18:46:29.715Z' - url: - type: string - format: uri - description: The URL of the [transcription](#operation/getCallTranscription) - example: >- - https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85/recordings/r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85/transcription - voiceApiError: - type: object - properties: - type: - type: string - description: - type: string - id: - nullable: true - type: string - answerCallback: - type: object - description: >- - The Answer event is sent to the answerUrl specified in the createCall - request when an outbound call is answered. - properties: - eventType: - $ref: '#/components/schemas/eventType' - eventTime: - $ref: '#/components/schemas/eventTime' - accountId: - $ref: '#/components/schemas/accountId' - applicationId: - $ref: '#/components/schemas/applicationId1' - from: - $ref: '#/components/schemas/from' - to: - $ref: '#/components/schemas/to' - direction: - $ref: '#/components/schemas/callDirectionEnum' - callId: - $ref: '#/components/schemas/callId' - callUrl: - $ref: '#/components/schemas/callUrl' - enqueuedTime: - $ref: '#/components/schemas/enqueuedTime' - startTime: - $ref: '#/components/schemas/startTime' - answerTime: - $ref: '#/components/schemas/answerTime' - tag: - $ref: '#/components/schemas/tag1' - machineDetectionResult: - $ref: '#/components/schemas/machineDetectionResult' - bridgeCompleteCallback: - type: object - description: >- - If the target call leaves the , then this callback is sent to - the bridgeCompleteUrl, and the BXML returned in it is executed on the - call. If this webhook is sent, the Bridge Target Complete webhook is NOT - sent. This callback is also sent if any problem occurs that prevents the - calls to be bridged. - properties: - eventType: - $ref: '#/components/schemas/eventType' - eventTime: - $ref: '#/components/schemas/eventTime' - accountId: - $ref: '#/components/schemas/accountId' - applicationId: - $ref: '#/components/schemas/applicationId1' - from: - $ref: '#/components/schemas/from' - to: - $ref: '#/components/schemas/to' - direction: - $ref: '#/components/schemas/callDirectionEnum' - callId: - $ref: '#/components/schemas/callId' - callUrl: - $ref: '#/components/schemas/callUrl' - enqueuedTime: - $ref: '#/components/schemas/enqueuedTime' - startTime: - $ref: '#/components/schemas/startTime' - answerTime: - $ref: '#/components/schemas/answerTime' - tag: - $ref: '#/components/schemas/tag1' - cause: - $ref: '#/components/schemas/cause' - errorMessage: - $ref: '#/components/schemas/errorMessage' - errorId: - $ref: '#/components/schemas/errorId' - bridgeTargetCompleteCallback: - type: object - description: >- - If the originating call leaves the , then this callback is sent - to the bridgeTargetCompleteUrl, and the BXML returned in it is executed - on the target call. If this webhook is sent, the Bridge Complete webhook - is NOT sent. - properties: - eventType: - $ref: '#/components/schemas/eventType' - eventTime: - $ref: '#/components/schemas/eventTime' - accountId: - $ref: '#/components/schemas/accountId' - applicationId: - $ref: '#/components/schemas/applicationId1' - from: - $ref: '#/components/schemas/from' - to: - $ref: '#/components/schemas/to' - direction: - $ref: '#/components/schemas/callDirectionEnum' - callId: - $ref: '#/components/schemas/callId' - callUrl: - $ref: '#/components/schemas/callUrl' - enqueuedTime: - $ref: '#/components/schemas/enqueuedTime' - startTime: - $ref: '#/components/schemas/startTime' - answerTime: - $ref: '#/components/schemas/answerTime' - tag: - $ref: '#/components/schemas/tag1' - conferenceCreatedCallback: - type: object - description: >- - The Conference Created event is fired whenever a new conference that - specified a callbackUrl is created. The response may be either empty or - a BXML document. Only the following verbs are valid for conferences: - PlayAudio, SpeakSentence, StartRecording, StopRecording, PauseRecording, - ResumeRecording. Audio verbs will be heard by all members of the - conference. Recordings capture audio from all members who are not muted - or on hold, as well as any audio verbs that are played into the - conference. - properties: - eventType: - $ref: '#/components/schemas/eventType' - eventTime: - $ref: '#/components/schemas/eventTime' - conferenceId: - $ref: '#/components/schemas/conferenceId' - name: - $ref: '#/components/schemas/name' - tag: - $ref: '#/components/schemas/tag1' - conferenceRedirectCallback: - type: object - description: >- - The Conference Redirect event is fired whenever an existing conference - is modified via a POST request made to the /conferences/{conferenceId} - endpoint. The response may be either empty or a BXML document. Only the - following verbs are valid for conferences: PlayAudio, SpeakSentence, - StartRecording, StopRecording, PauseRecording, ResumeRecording. Audio - verbs will be heard by all members of the conference. Recordings capture - audio from all members who are not muted or on hold, as well as any - audio verbs that are played into the conference. - properties: - eventType: - $ref: '#/components/schemas/eventType' - eventTime: - $ref: '#/components/schemas/eventTime' - conferenceId: - $ref: '#/components/schemas/conferenceId' - name: - $ref: '#/components/schemas/name' - tag: - $ref: '#/components/schemas/tag1' - conferenceMemberJoinCallback: - type: object - description: >- - The Conference Member Join event is fired whenever a caller joins a - conference that specified a callbackUrl. The response may be either - empty or a BXML document. Only the following verbs are valid for - conferences: PlayAudio, SpeakSentence, StartRecording, StopRecording, - PauseRecording, ResumeRecording. Audio verbs will be heard by all - members of the conference. Recordings capture audio from all members who - are not muted or on hold, as well as any audio verbs that are played - into the conference. - properties: - eventType: - $ref: '#/components/schemas/eventType' - eventTime: - $ref: '#/components/schemas/eventTime' - conferenceId: - $ref: '#/components/schemas/conferenceId' - name: - $ref: '#/components/schemas/name' - from: - $ref: '#/components/schemas/from' - to: - $ref: '#/components/schemas/to' - callId: - $ref: '#/components/schemas/callId' - tag: - $ref: '#/components/schemas/tag1' - conferenceMemberExitCallback: - type: object - description: >- - The Conference Member Exit event is fired whenever a caller exits a - conference that specified a callbackUrl. The response may be either - empty or a BXML document. Only the following verbs are valid for - conferences: PlayAudio, SpeakSentence, StartRecording, StopRecording, - PauseRecording, ResumeRecording. Audio verbs will be heard by all - members of the conference. Recordings capture audio from all members who - are not muted or on hold, as well as any audio verbs that are played - into the conference. - properties: - eventType: - $ref: '#/components/schemas/eventType' - eventTime: - $ref: '#/components/schemas/eventTime' - conferenceId: - $ref: '#/components/schemas/conferenceId' - name: - $ref: '#/components/schemas/name' - from: - $ref: '#/components/schemas/from' - to: - $ref: '#/components/schemas/to' - callId: - $ref: '#/components/schemas/callId' - tag: - $ref: '#/components/schemas/tag1' - conferenceCompletedCallback: - type: object - description: >- - The Conference Completed event is fired when the last member leaves the - conference. The response to this event may not contain BXML. - properties: - eventType: - $ref: '#/components/schemas/eventType' - eventTime: - $ref: '#/components/schemas/eventTime' - conferenceId: - $ref: '#/components/schemas/conferenceId' - name: - $ref: '#/components/schemas/name' - tag: - $ref: '#/components/schemas/tag1' - conferenceRecordingAvailableCallback: - type: object - description: >- - The Conference Recording Available event is sent after a conference - recording has been processed. It indicates that the recording is - available for download. - properties: - eventType: - $ref: '#/components/schemas/eventType' - eventTime: - $ref: '#/components/schemas/eventTime' - conferenceId: - $ref: '#/components/schemas/conferenceId' - name: - $ref: '#/components/schemas/name' - accountId: - $ref: '#/components/schemas/accountId' - recordingId: - $ref: '#/components/schemas/recordingId' - channels: - $ref: '#/components/schemas/channels' - startTime: - $ref: '#/components/schemas/startTime' - endTime: - $ref: '#/components/schemas/endTime' - duration: - $ref: '#/components/schemas/duration' - fileFormat: - $ref: '#/components/schemas/fileFormatEnum' - mediaUrl: - $ref: '#/components/schemas/mediaUrl' - tag: - $ref: '#/components/schemas/tag1' - status: - $ref: '#/components/schemas/status' - disconnectCallback: - type: object - description: The Disconnect event is fired when a call ends, for any reason. - properties: - eventType: - $ref: '#/components/schemas/eventType' - eventTime: - $ref: '#/components/schemas/eventTime' - accountId: - $ref: '#/components/schemas/accountId' - applicationId: - $ref: '#/components/schemas/applicationId1' - from: - $ref: '#/components/schemas/from' - to: - $ref: '#/components/schemas/to' - callId: - $ref: '#/components/schemas/callId' - direction: - $ref: '#/components/schemas/callDirectionEnum' - callUrl: - $ref: '#/components/schemas/callUrl' - enqueuedTime: - $ref: '#/components/schemas/enqueuedTime' - startTime: - $ref: '#/components/schemas/startTime' - answerTime: - $ref: '#/components/schemas/answerTime' - endTime: - $ref: '#/components/schemas/endTime' - cause: - $ref: '#/components/schemas/cause' - errorMessage: - $ref: '#/components/schemas/errorMessage' - errorId: - $ref: '#/components/schemas/errorId' - tag: - $ref: '#/components/schemas/tag1' - dtmfCallback: - type: object - description: >- - The DTMF event is sent for every digit detected after a - verb is executed. You may not respond to this event with BXML. - properties: - eventType: - $ref: '#/components/schemas/eventType' - eventTime: - $ref: '#/components/schemas/eventTime' - accountId: - $ref: '#/components/schemas/accountId' - applicationId: - $ref: '#/components/schemas/applicationId1' - from: - $ref: '#/components/schemas/from' - to: - $ref: '#/components/schemas/to' - callId: - $ref: '#/components/schemas/callId' - direction: - $ref: '#/components/schemas/callDirectionEnum' - digit: - $ref: '#/components/schemas/digit' - callUrl: - $ref: '#/components/schemas/callUrl' - enqueuedTime: - $ref: '#/components/schemas/enqueuedTime' - startTime: - $ref: '#/components/schemas/startTime' - answerTime: - $ref: '#/components/schemas/answerTime' - parentCallId: - $ref: '#/components/schemas/parentCallId' - transferCallerId: - $ref: '#/components/schemas/transferCallerId' - transferTo: - $ref: '#/components/schemas/transferTo' - tag: - $ref: '#/components/schemas/tag1' - gatherCallback: - type: object - description: >- - The gather event is sent after a verb is executed. Its purpose - is to report the gathered digits to the calling application. - properties: - eventType: - $ref: '#/components/schemas/eventType' - eventTime: - $ref: '#/components/schemas/eventTime' - accountId: - $ref: '#/components/schemas/accountId' - applicationId: - $ref: '#/components/schemas/applicationId1' - from: - $ref: '#/components/schemas/from' - to: - $ref: '#/components/schemas/to' - direction: - $ref: '#/components/schemas/callDirectionEnum' - callId: - $ref: '#/components/schemas/callId' - digits: - $ref: '#/components/schemas/digits' - callUrl: - $ref: '#/components/schemas/callUrl' - enqueuedTime: - $ref: '#/components/schemas/enqueuedTime' - startTime: - $ref: '#/components/schemas/startTime' - answerTime: - $ref: '#/components/schemas/answerTime' - parentCallId: - $ref: '#/components/schemas/parentCallId' - terminatingDigit: - $ref: '#/components/schemas/terminatingDigit' - transferCallerId: - $ref: '#/components/schemas/transferCallerId' - transferTo: - $ref: '#/components/schemas/transferTo' - tag: - $ref: '#/components/schemas/tag1' - initiateCallback: - type: object - description: >- - The Initiate event is fired when an inbound call is received for a - Telephone Number on your Account. It is sent to the URL specified in the - application associated with the location (sip-peer) that the called - telephone number belongs to. - properties: - eventType: - $ref: '#/components/schemas/eventType' - eventTime: - $ref: '#/components/schemas/eventTime' - accountId: - $ref: '#/components/schemas/accountId' - applicationId: - $ref: '#/components/schemas/applicationId1' - from: - $ref: '#/components/schemas/from' - to: - $ref: '#/components/schemas/to' - direction: - $ref: '#/components/schemas/callDirectionEnum' - callId: - $ref: '#/components/schemas/callId' - callUrl: - $ref: '#/components/schemas/callUrl' - startTime: - $ref: '#/components/schemas/startTime' - diversion: - $ref: '#/components/schemas/diversion' - stirShaken: - $ref: '#/components/schemas/stirShaken' - uui: - $ref: '#/components/schemas/uui' - machineDetectionCompleteCallback: - type: object - description: >- - This event is sent to the url informed when requesting a machine - detection operation. It contains the machine detection operation result, - which can be: human, answering-machine, silence, timeout, error. This - event is not sent when sync answering machine detection mode is chosen. - properties: - eventType: - $ref: '#/components/schemas/eventType' - eventTime: - $ref: '#/components/schemas/eventTime' - accountId: - $ref: '#/components/schemas/accountId' - applicationId: - $ref: '#/components/schemas/applicationId1' - from: - $ref: '#/components/schemas/from' - to: - $ref: '#/components/schemas/to' - direction: - $ref: '#/components/schemas/callDirectionEnum' - callId: - $ref: '#/components/schemas/callId' - callUrl: - $ref: '#/components/schemas/callUrl' - enqueuedTime: - $ref: '#/components/schemas/enqueuedTime' - startTime: - $ref: '#/components/schemas/startTime' - answerTime: - $ref: '#/components/schemas/answerTime' - tag: - $ref: '#/components/schemas/tag1' - machineDetectionResult: - $ref: '#/components/schemas/machineDetectionResult' - recordingCompleteCallback: - type: object - description: >- - The Record Complete event is sent after a verb has executed if - the call is still active. The BXML returned by this callback is executed - next. When the recording is available for download, a Recording - Available event will be sent. - properties: - eventType: - $ref: '#/components/schemas/eventType' - eventTime: - $ref: '#/components/schemas/eventTime' - accountId: - $ref: '#/components/schemas/accountId' - applicationId: - $ref: '#/components/schemas/applicationId1' - from: - $ref: '#/components/schemas/from' - to: - $ref: '#/components/schemas/to' - direction: - $ref: '#/components/schemas/callDirectionEnum' - callId: - $ref: '#/components/schemas/callId' - callUrl: - $ref: '#/components/schemas/callUrl' - parentCallId: - $ref: '#/components/schemas/parentCallId' - recordingId: - $ref: '#/components/schemas/recordingId' - mediaUrl: - $ref: '#/components/schemas/mediaUrl' - enqueuedTime: - $ref: '#/components/schemas/enqueuedTime' - startTime: - $ref: '#/components/schemas/startTime' - answerTime: - $ref: '#/components/schemas/answerTime' - endTime: - $ref: '#/components/schemas/endTime' - duration: - $ref: '#/components/schemas/duration' - fileFormat: - $ref: '#/components/schemas/fileFormatEnum' - channels: - $ref: '#/components/schemas/channels' - tag: - $ref: '#/components/schemas/tag1' - transferCallerId: - $ref: '#/components/schemas/transferCallerId' - transferTo: - $ref: '#/components/schemas/transferTo' - recordingAvailableCallback: - type: object - description: >- - The Recording Available event is sent after a recording has been - processed. It indicates that the recording is available for download. - properties: - eventType: - $ref: '#/components/schemas/eventType' - eventTime: - $ref: '#/components/schemas/eventTime' - accountId: - $ref: '#/components/schemas/accountId' - applicationId: - $ref: '#/components/schemas/applicationId1' - from: - $ref: '#/components/schemas/from' - to: - $ref: '#/components/schemas/to' - direction: - $ref: '#/components/schemas/callDirectionEnum' - callId: - $ref: '#/components/schemas/callId' - callUrl: - $ref: '#/components/schemas/callUrl' - parentCallId: - $ref: '#/components/schemas/parentCallId' - recordingId: - $ref: '#/components/schemas/recordingId' - mediaUrl: - $ref: '#/components/schemas/mediaUrl' - enqueuedTime: - $ref: '#/components/schemas/enqueuedTime' - startTime: - $ref: '#/components/schemas/startTime' - endTime: - $ref: '#/components/schemas/endTime' - duration: - $ref: '#/components/schemas/duration' - fileFormat: - $ref: '#/components/schemas/fileFormatEnum' - channels: - $ref: '#/components/schemas/channels' - tag: - $ref: '#/components/schemas/tag1' - status: - $ref: '#/components/schemas/status' - transferCallerId: - $ref: '#/components/schemas/transferCallerId' - transferTo: - $ref: '#/components/schemas/transferTo' - redirectCallback: - type: object - description: >- - The Redirect event is fired when a verb is executed. Its - purpose is to get the next set of verbs from the calling application. - properties: - eventType: - $ref: '#/components/schemas/eventType' - eventTime: - $ref: '#/components/schemas/eventTime' - accountId: - $ref: '#/components/schemas/accountId' - applicationId: - $ref: '#/components/schemas/applicationId1' - from: - $ref: '#/components/schemas/from' - to: - $ref: '#/components/schemas/to' - direction: - $ref: '#/components/schemas/callDirectionEnum' - callId: - $ref: '#/components/schemas/callId' - callUrl: - $ref: '#/components/schemas/callUrl' - parentCallId: - $ref: '#/components/schemas/parentCallId' - enqueuedTime: - $ref: '#/components/schemas/enqueuedTime' - startTime: - $ref: '#/components/schemas/startTime' - answerTime: - $ref: '#/components/schemas/answerTime' - tag: - $ref: '#/components/schemas/tag1' - transferCallerId: - $ref: '#/components/schemas/transferCallerId' - transferTo: - $ref: '#/components/schemas/transferTo' - transcriptionAvailableCallback: - type: object - description: >- - The Transcription Available event is sent when the recording - transcription is available to be downloaded. - properties: - eventType: - $ref: '#/components/schemas/eventType' - eventTime: - $ref: '#/components/schemas/eventTime' - accountId: - $ref: '#/components/schemas/accountId' - applicationId: - $ref: '#/components/schemas/applicationId1' - from: - $ref: '#/components/schemas/from' - to: - $ref: '#/components/schemas/to' - direction: - $ref: '#/components/schemas/callDirectionEnum' - callId: - $ref: '#/components/schemas/callId' - callUrl: - $ref: '#/components/schemas/callUrl' - mediaUrl: - $ref: '#/components/schemas/mediaUrl' - parentCallId: - $ref: '#/components/schemas/parentCallId' - recordingId: - $ref: '#/components/schemas/recordingId' - enqueuedTime: - $ref: '#/components/schemas/enqueuedTime' - startTime: - $ref: '#/components/schemas/startTime' - endTime: - $ref: '#/components/schemas/endTime' - duration: - $ref: '#/components/schemas/duration' - fileFormat: - $ref: '#/components/schemas/fileFormatEnum' - tag: - $ref: '#/components/schemas/tag1' - transcription: - $ref: '#/components/schemas/transcription' - transferCallerId: - $ref: '#/components/schemas/transferCallerId' - transferTo: - $ref: '#/components/schemas/transferTo' - transferAnswerCallback: - type: object - description: >- - When processing a verb, this event is sent when a called - party (B-leg) answers. The event is sent to the endpoint specified in - the transferAnswerUrl attribute of the tag that answered. - BXML returned by this callback will be executed for the called party - only. After all BXML has been executed, the called party will be bridged - to the original call. Most BXML verbs are allowed in response to a - transferAnswer event, but some are not allowed. - properties: - eventType: - $ref: '#/components/schemas/eventType' - eventTime: - $ref: '#/components/schemas/eventTime' - accountId: - $ref: '#/components/schemas/accountId' - applicationId: - $ref: '#/components/schemas/applicationId1' - from: - $ref: '#/components/schemas/from' - to: - $ref: '#/components/schemas/to' - direction: - $ref: '#/components/schemas/callDirectionEnum' - callId: - $ref: '#/components/schemas/callId' - callUrl: - $ref: '#/components/schemas/callUrl' - enqueuedTime: - $ref: '#/components/schemas/enqueuedTime' - startTime: - $ref: '#/components/schemas/startTime' - answerTime: - $ref: '#/components/schemas/answerTime' - tag: - $ref: '#/components/schemas/tag1' - transferCallerId: - $ref: '#/components/schemas/transferCallerId' - transferTo: - $ref: '#/components/schemas/transferTo' - transferCompleteCallback: - type: object - description: >- - This event is sent to the transferCompleteUrl of the A-leg's - verb when the transferred call (B-leg) completes. In a simultaneous - ringing scenario, only one B-leg succeeds and this event corresponds to - that successful leg. If none of the calls were answered, the - transferComplete event corresponds to one of the legs. - properties: - eventType: - $ref: '#/components/schemas/eventType' - eventTime: - $ref: '#/components/schemas/eventTime' - accountId: - $ref: '#/components/schemas/accountId' - applicationId: - $ref: '#/components/schemas/applicationId1' - from: - $ref: '#/components/schemas/from' - to: - $ref: '#/components/schemas/to' - direction: - $ref: '#/components/schemas/callDirectionEnum' - callId: - $ref: '#/components/schemas/callId' - callUrl: - $ref: '#/components/schemas/callUrl' - enqueuedTime: - $ref: '#/components/schemas/enqueuedTime' - startTime: - $ref: '#/components/schemas/startTime' - answerTime: - $ref: '#/components/schemas/answerTime' - tag: - $ref: '#/components/schemas/tag1' - transferCallerId: - $ref: '#/components/schemas/transferCallerId' - transferTo: - $ref: '#/components/schemas/transferTo' - cause: - $ref: '#/components/schemas/cause' - errorMessage: - $ref: '#/components/schemas/errorMessage' - errorId: - $ref: '#/components/schemas/errorId' - transferDisconnectCallback: - type: object - description: >- - This event is sent to the transferDisconnectUrl of each - tag when its respective call leg ends for any reason. The event is sent - in the normal case, when the transferred leg is answered and later hung - up, but is also sent if the new leg was never answered in the first - place, if it was rejected, and if the original call leg hung up before - the transferred leg. - properties: - eventType: - $ref: '#/components/schemas/eventType' - eventTime: - $ref: '#/components/schemas/eventTime' - accountId: - $ref: '#/components/schemas/accountId' - applicationId: - $ref: '#/components/schemas/applicationId1' - from: - $ref: '#/components/schemas/from' - to: - $ref: '#/components/schemas/to' - direction: - $ref: '#/components/schemas/callDirectionEnum' - callId: - $ref: '#/components/schemas/callId' - callUrl: - $ref: '#/components/schemas/callUrl' - parentCallId: - $ref: '#/components/schemas/parentCallId' - enqueuedTime: - $ref: '#/components/schemas/enqueuedTime' - startTime: - $ref: '#/components/schemas/startTime' - answerTime: - $ref: '#/components/schemas/answerTime' - endTime: - $ref: '#/components/schemas/endTime' - tag: - $ref: '#/components/schemas/tag1' - transferCallerId: - $ref: '#/components/schemas/transferCallerId' - transferTo: - $ref: '#/components/schemas/transferTo' - cause: - $ref: '#/components/schemas/cause' - errorMessage: - $ref: '#/components/schemas/errorMessage' - errorId: - $ref: '#/components/schemas/errorId' - eventType: - type: string - description: >- - The event type, value can be one of the following: answer, - bridgeComplete, bridgeTargetComplete, conferenceCreated, - conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, - conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, - gather, initiate, machineDetectionComplete, recordingComplete, - recordingAvailable, redirect, transcriptionAvailable, transferAnswer, - transferComplete, transferDisconnect. - example: bridgeComplete - eventTime: - type: string - format: date-time - description: >- - The approximate UTC date and time when the event was generated by the - Bandwidth server, in ISO 8601 format. This may not be exactly the time - of event execution. - example: '2022-06-17T22:19:40.375Z' - accountId: - type: string - description: The user account associated with the call. - example: '9900000' - applicationId1: - type: string - description: The id of the application associated with the call. - example: 04e88489-df02-4e34-a0ee-27a91849555f - to: - type: string - description: >- - The phone number that received the call, in E.164 format (e.g. - +15555555555). - example: '+15555555555' - from: - type: string - description: >- - The provided identifier of the caller. Must be a phone number in E.164 - format (e.g. +15555555555). - example: '+15555555555' - conferenceId: - type: string - description: The unique, Bandwidth-generated ID of the conference that was recorded - example: conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9 - name: - type: string - description: The user-specified name of the conference that was recorded - example: my-conference-name - recordingId: - type: string - description: The unique ID of this recording - example: r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833 - duration: - type: string - description: The duration of the recording in ISO-8601 format - example: PT13.67S - channels: - type: integer - format: int32 - description: >- - Always `1` for conference recordings; multi-channel recordings are not - supported on conferences. - example: 1 - digit: - type: string - description: The digit collected in the call. - example: '2' - digits: - type: string - description: >- - (optional) The digits, letters, and/or symbols entered by the user. The - string is empty if a timeout occurred before any buttons were pressed. - example: '123' - terminatingDigit: - type: string - description: >- - (optional) The digit the user pressed to end the gather. Empty string - value if no terminating digit was pressed. - example: '#' - startTime: - type: string - format: date-time - description: Time the call was started, in ISO 8601 format. - example: '2022-06-17T22:19:40.375Z' - enqueuedTime: - type: string - format: date-time - description: >- - (optional) If call queueing is enabled and this is an outbound call, - time the call was queued, in ISO 8601 format. - example: '2022-06-17T22:20:00.000Z' - nullable: true - answerTime: - type: string - format: date-time - description: Time the call was answered, in ISO 8601 format. - example: '2022-06-17T22:20:00.000Z' - nullable: true - endTime: - type: string - format: date-time - description: The time that the recording ended in ISO-8601 format - example: '2022-06-17T22:20:00.000Z' - status: - type: string - description: >- - The current status of the process. For recording, current possible - values are 'processing', 'partial', 'complete', 'deleted', and 'error'. - For transcriptions, current possible values are 'none', 'processing', - 'available', 'error', 'timeout', 'file-size-too-big', and - 'file-size-too-small'. Additional states may be added in the future, so - your application must be tolerant of unknown values. - example: completed - transferCallerId: - type: string - description: >- - The phone number used as the from field of the B-leg call, in E.164 - format (e.g. +15555555555). - example: '+15555555555' - transferTo: - type: string - description: >- - The phone number used as the to field of the B-leg call, in E.164 format - (e.g. +15555555555). - example: '+15555555555' - mediaUrl: - nullable: true - type: string - format: uri - description: >- - The URL that can be used to download the recording. Only present if the - recording is finished and may be downloaded. - example: >- - https://voice.bandwidth.com/api/v2/accounts/9900000/conferences/conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9/recordings/r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833/media - callId: - type: string - description: The call id associated with the event. - example: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 - recordingName: - type: string - description: A name to identify this recording. - example: my-recording-name - callUrl: - type: string - format: uri - description: The URL of the call associated with the event. - example: >- - https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 - parentCallId: - type: string - description: >- - (optional) If the event is related to the B leg of a , the - call id of the original call leg that executed the . - Otherwise, this field will not be present. - example: c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d - tag1: - type: string - description: >- - (optional) The tag specified on call creation. If no tag was specified - or it was previously cleared, this field will not be present. - example: exampleTag - nullable: true - cause: - type: string - description: >- - Reason the call failed - hangup, busy, timeout, cancel, rejected, - callback-error, invalid-bxml, application-error, account-limit, - node-capacity-exceeded, error, or unknown. - example: busy - errorMessage: - type: string - description: >- - Text explaining the reason that caused the call to fail in case of - errors. - example: >- - Call c-2a913f94-6a486f3a-3cae-4034-bcc3-f0c9fa77ca2f is already bridged - with another call - nullable: true - errorId: - type: string - description: Bandwidth's internal id that references the error event. - example: 4642074b-7b58-478b-96e4-3a60955c6765 - nullable: true - machineDetectionResult: - type: object - description: >- - (optional) if machine detection was requested in sync mode, the result - will be specified here. Possible values are the same as the async - counterpart: Machine Detection Complete - properties: - value: - type: string - description: >- - Possible values are answering-machine, human, silence, timeout, or - error. - example: answering-machine - duration: - type: string - description: The amount of time it took to determine the result. - example: PT4.9891287S - nullable: true - diversion: - type: object - properties: - reason: - type: string - description: >- - The reason for the diversion. Common values: unknown, user-busy, - no-answer, unavailable, unconditional, time-of-day, do-not-disturb, - deflection, follow-me, out-of-service, away. - example: unavailable - privacy: - type: string - description: off or full - example: 'off' - screen: - type: string - description: >- - No if the number was provided by the user, yes if the number was - provided by the network - example: 'no' - counter: - type: string - description: The number of diversions that have occurred - example: '2' - limit: - type: string - description: The maximum number of diversions allowed for this session - example: '3' - unknown: - type: string - description: >- - The normal list of values is not exhaustive. Your application must - be tolerant of unlisted keys and unlisted values of those keys. - example: unknownValue - origTo: - type: string - description: >- - Always present. Indicates the last telephone number that the call - was diverted from. - example: '+15558884444' - transcription: - type: object - properties: - text: - type: string - description: The transcribed text - example: Nice talking to you, friend! - confidence: - type: number - format: double - description: >- - The confidence on the recognized content, ranging from `0.0` to - `1.0` with `1.0` being the highest confidence. - example: 0.9 - stirShaken: - type: object - properties: - verstat: - type: string - description: >- - (optional) The verification status indicating whether the - verification was successful or not. Possible values are - TN-Validation-Passed and TN-Validation-Failed. - example: Tn-Validation-Passed - attestationIndicator: - type: string - description: >- - (optional) The attestation level verified by Bandwidth. Possible - values are A (full), B (partial) or C (gateway). - example: A - originatingId: - type: string - description: (optional) A unique origination identifier. - example: 99759086-1335-11ed-9bcf-5f7d464e91af - uui: - type: string - description: >- - The value of the `User-To-User` header to send within the initial - `INVITE`. Must include the encoding parameter as specified in RFC 7433. - Only `base64`, `jwt` and `hex` encoding are currently allowed. This - value, including the encoding specifier, may not exceed 256 characters. - example: bXktdXVp - maxLength: 256 - codeRequest: - type: object - properties: - to: - type: string - description: The phone number to send the mfa code to. - pattern: ^\+[1-9]\d{1,14}$ - example: '+19195551234' - from: - type: string - description: The application phone number, the sender of the mfa code. - pattern: ^\+[1-9]\d{1,14}$ - maxLength: 32 - example: '+19195554321' - applicationId: - type: string - description: The application unique ID, obtained from Bandwidth. - maxLength: 50 - example: 66fd98ae-ac8d-a00f-7fcd-ba3280aeb9b1 - scope: - type: string - description: >- - An optional field to denote what scope or action the mfa code is - addressing. If not supplied, defaults to "2FA". - maxLength: 25 - example: 2FA - message: - type: string - description: >- - The message format of the mfa code. There are three values that the - system will replace "{CODE}", "{NAME}", "{SCOPE}". The "{SCOPE}" - and "{NAME} value template are optional, while "{CODE}" must be - supplied. As the name would suggest, code will be replace with the - actual mfa code. Name is replaced with the application name, - configured during provisioning of mfa. The scope value is the same - value sent during the call and partitioned by the server. - maxLength: 2048 - example: Your temporary {NAME} {SCOPE} code is {CODE} - digits: - type: integer - description: >- - The number of digits for your mfa code. The valid number ranges - from 2 to 8, inclusively. - minimum: 4 - maximum: 8 - example: 6 - required: - - to - - from - - applicationId - - message - - digits - voiceCodeResponse: - type: object - properties: - callId: - type: string - description: Programmable Voice API Call ID. - example: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 - messagingCodeResponse: - type: object - properties: - messageId: - type: string - description: Messaging API Message ID. - example: 1589228074636lm4k2je7j7jklbn2 - verifyCodeRequest: - type: object - properties: - to: - type: string - description: The phone number to send the mfa code to. - pattern: ^\+[1-9]\d{1,14}$ - example: '+19195551234' - scope: - type: string - description: >- - An optional field to denote what scope or action the mfa code is - addressing. If not supplied, defaults to "2FA". - example: 2FA - expirationTimeInMinutes: - type: number - description: >- - The time period, in minutes, to validate the mfa code. By setting - this to 3 minutes, it will mean any code generated within the last 3 - minutes are still valid. The valid range for expiration time is - between 0 and 15 minutes, exclusively and inclusively, respectively. - minimum: 1 - maximum: 15 - example: 3 - code: - type: string - description: The generated mfa code to check if valid. - minLength: 4 - maxLength: 8 - example: '123456' - required: - - to - - expirationTimeInMinutes - - code - verifyCodeResponse: - type: object - properties: - valid: - type: boolean - description: Whether or not the supplied code is valid. - example: true - mfaRequestError: - type: object - properties: - error: - type: string - description: A message describing the error with your request. - example: 400 Request is malformed or invalid - requestId: - type: string - description: The associated requestId from AWS. - example: 354cc8a3-6701-461e-8fa7-8671703dd898 - mfaUnauthorizedRequestError: - type: object - properties: - message: - type: string - description: Unauthorized - example: Unauthorized - mfaForbiddenRequestError: - type: object - properties: - message: - type: string - description: >- - The message containing the reason behind the request being - forbidden. - example: Missing Authentication Token - completedLookupStatusEnum: - type: string - enum: - - COMPLETE - - PARTIAL_COMPLETE - - FAILED - example: COMPLETE - inProgressLookupStatusEnum: - type: string - enum: - - IN_PROGRESS - - COMPLETE - - PARTIAL_COMPLETE - - FAILED - example: COMPLETE - deactivationEventEnum: - type: string - description: > - [DNI-Only](#section/DNI-Only). - - `DEACTIVATED` if the carrier reported a deactivation event for this - phone number. - enum: - - DEACTIVATED - latestMessageDeliveryStatusEnum: - type: string - description: >- - [DNI-Only](#section/DNI-Only). The current delivery status of the phone - number. - - - ACTIVE: A message was successfully sent to the number (delivery code - 0). - - - DEACTIVATED: A message was not delivered to a number (delivery code - 720) - - - UNKNOWN: Bandwidth cannot find an delivery status entry for the - number. - enum: - - ACTIVE - - DEACTIVATED - - UNKNOWN - lineTypeEnum: - type: string - enum: - - FIXED - - VOIP-FIXED - - MOBILE - - VOIP - example: MOBILE - requestId: - type: string - format: uuid - description: The phone number lookup request ID from Bandwidth. - example: 004223a0-8b17-41b1-bf81-20732adf5590 - linkSchema: - title: Link - type: object - properties: - href: - type: string - description: URI of the link. - example: /relative/uri - rel: - type: string - description: Specifies the relationship between this link and the resource. - example: aRelatedResource - method: - type: string - description: HTTP method to be used. - example: GET - lookupErrorSchema: - type: object - properties: - code: - type: string - description: Validation error code - example: NO-MATCH - description: - type: string - description: Description of validation error - example: Example error description - type: - type: string - description: Type of validation error - example: NumberInventory - meta: - type: object - properties: - phoneNumbers: - type: array - items: - type: string - description: Phone number experiencing the error. - example: - - '+13992077164' - - '+19196104424' - message: - type: string - description: Message describing the error - example: Invalid TNs - code: - type: integer - description: Error code associated with the message - example: 1001 - syncLookupRequest: - type: object - properties: - phoneNumbers: - description: Telephone numbers in E.164 format. - type: array - minimum: 1 - maximum: 100 - items: - type: string - pattern: ^\+[1-9]\d{1,14}$ - required: - - phoneNumbers - asyncLookupRequest: - type: object - properties: - phoneNumbers: - description: Telephone numbers in E.164 format. - type: array - minimum: 1 - maximum: 15000 - items: - type: string - pattern: ^\+[1-9]\d{1,14}$ - required: - - phoneNumbers - createSyncLookupResponse: - type: object - properties: - links: - type: array - items: - $ref: '#/components/schemas/linkSchema' - example: [] - data: - type: object - description: The phone number lookup response data - properties: - requestId: - $ref: '#/components/schemas/requestId' - status: - $ref: '#/components/schemas/completedLookupStatusEnum' - results: - type: array - description: >- - The carrier information results for the specified telephone - numbers. - items: - $ref: '#/components/schemas/lookupResult' - errors: - type: array - items: - $ref: '#/components/schemas/lookupErrorSchema' - createAsyncBulkLookupResponse: - type: object - properties: - links: - type: array - description: Links for pagination (if applicable) - items: - $ref: '#/components/schemas/linkSchema' - data: - type: object - description: The phone number lookup response data - properties: - requestId: - $ref: '#/components/schemas/requestId' - status: - $ref: '#/components/schemas/inProgressLookupStatusEnum' - errors: - type: array - items: - $ref: '#/components/schemas/lookupErrorSchema' - getAsyncBulkLookupResponse: - type: object - properties: - links: - type: array - items: - $ref: '#/components/schemas/linkSchema' - example: [] - data: - type: object - description: The phone number lookup response data - properties: - requestId: - $ref: '#/components/schemas/requestId' - status: - $ref: '#/components/schemas/inProgressLookupStatusEnum' - results: - type: array - description: >- - The carrier information results for the specified telephone - number. - items: - $ref: '#/components/schemas/lookupResult' - errors: - type: array - items: - $ref: '#/components/schemas/lookupErrorSchema' - lookupErrorResponse: - type: object - properties: - links: - type: array - items: - $ref: '#/components/schemas/linkSchema' - example: [] - data: - type: object - description: The phone number lookup response data - errors: - type: array - items: - $ref: '#/components/schemas/lookupErrorSchema' - lookupResult: - type: object - description: Carrier information results for the specified telephone number. - properties: - phoneNumber: - type: string - description: The telephone number in E.164 format. - example: '+10072904498' - lineType: - $ref: '#/components/schemas/lineTypeEnum' - messagingProvider: - type: string - description: The messaging service provider of the telephone number. - example: Verizon Wireless - voiceProvider: - type: string - description: The voice service provider of the telephone number. - example: Verizon Wireless - countryCodeA3: - type: string - description: >- - The country code of the telephone number in ISO 3166-1 alpha-3 - format. - example: USA - deactivationReporter: - type: string - description: > - [DNI-Only](#section/DNI-Only). - - The carrier that reported a deactivation event for this phone - number. - deactivationDate: - type: string - format: date-time-local - description: >- - [DNI-Only](#section/DNI-Only). The datetime the carrier reported a - deactivation event. - example: 2025-06-20 18:35 - deactivationEvent: - $ref: '#/components/schemas/deactivationEventEnum' - latestMessageDeliveryStatus: - $ref: '#/components/schemas/latestMessageDeliveryStatusEnum' - initialMessageDeliveryStatusDate: - type: string - format: date - description: >- - [DNI-Only](#section/DNI-Only). The date the phone number entered the - status described in `latestMessageDeliveryStatus`. - - Think of this as the "start time" for that status. - - Value resets every time the `latestMessageDeliveryStatus` changes. - example: '2025-06-20' - latestMessageDeliveryStatusDate: - type: string - format: date - description: >- - [DNI-Only](#section/DNI-Only). The date bandwidth last received - delivery status information for this phone number. - - Use this field to understand how up-to-date the - `latestMessageDeliveryStatus` is. - - Value resets every time the `latestMessageDeliveryStatus` changes. - example: '2025-06-21' - accountId1: - type: string - description: User's account ID. - example: '1234567' - tfPhoneNumber: - type: string - description: Toll-free telephone number in E.164 format. - minLength: 12 - maxLength: 12 - nullable: false - pattern: ^\+1(800|833|844|855|866|877|888)[2-9]\d{6}$ - example: '+18005555555' - tfvWebhookErrors: - type: array - description: Details of the errors that were encountered when processing the request. - items: - type: string - example: 'optInWorkflowImageURLs: Entries must be a valid array of objects.' - tfvCallbackStatusEnum: - type: string - enum: - - VERIFIED - - UNVERIFIED - example: VERIFIED - tfvUnverifiedStatus: - type: string - default: UNVERIFIED - example: UNVERIFIED - declineReasonDescription: - type: string - description: Explanation for why a verification request was declined. - nullable: false - example: >- - Invalid Information - Can't Validate URL - Website is not accessible / - not available - denialStatusCode: - description: Reason code for denial. - type: integer - example: 511 - resubmitAllowed: - description: >- - Whether a Toll-Free Verification request qualifies for resubmission via - PUT. - example: true - type: boolean - blocked: - description: >- - Whether a Toll-Free Verification is blocked. This attribute will only be - defined when the number is blocked. - example: true - type: boolean - blockedReason: - description: >- - The reason why the Toll-Free Verification is blocked. This attribute - will only be defined when the number is blocked. - example: Toll-free number was used to send spam messages - type: string - privacyPolicyUrl: - description: The Toll-Free Verification request privacy policy URL. - example: http://your-company.com/privacyPolicy - type: string - termsAndConditionsUrl: - description: The Toll-Free Verification request terms and conditions policy URL. - example: http://your-company.com/termsAndConditions - type: string - businessDba: - description: The company 'Doing Business As'. - example: Another Company Name Inc. - type: string - businessRegistrationNumber: - type: string - description: >- - US Federal Tax ID Number (EIN) or Canada Business Number (CBN). Optional - until early 2026. If a value is provided for this field, a value must be - provided for `businessRegistrationType` and `businessEntityType`. - Available starting October 1st, 2025. - nullable: true - maxLength: 500 - example: 12-3456789 - businessRegistrationTypeEnum: - type: string - description: >- - The type of business registration number. Optional until early 2026; - required if `businessRegistrationNumber` is provided. Available starting - October 1st, 2025. - enum: - - EIN - - CBN - nullable: true - businessEntityTypeEnum: - type: string - description: >- - The type of registered business. If no option is applicable, please - provide "SOLE_PROPRIETOR" as a value. Optional until early 2026; - required if `businessRegistrationNumber` is provided. Available starting - October 1st, 2025. - enum: - - SOLE_PROPRIETOR - - PRIVATE_PROFIT - - PUBLIC_PROFIT - - NON_PROFIT - - GOVERNMENT - nullable: true - helpMessageResponse: - type: string - description: A message that gets sent to users requesting help. - nullable: true - maxLength: 500 - example: Please contact support for assistance. - ageGatedContent: - type: boolean - description: Indicates whether the content is age-gated. - example: false - additionalDenialReason: - properties: - statusCode: - $ref: '#/components/schemas/denialStatusCode' - reason: - $ref: '#/components/schemas/declineReasonDescription' - resubmitAllowed: - $ref: '#/components/schemas/resubmitAllowed' - required: - - statusCode - - reason - - resubmitAllowed - type: object - internalTicketNumber: - type: string - format: uuid - description: >- - Unique identifier (UUID) generated by Bandwidth to assist in tracking - the verification status of a toll-free number - included in all webhook - payloads. - example: acde070d-8c4c-4f0d-9d8a-162843c10333 - internalTicketNumberForWebhook: - type: string - format: uuid - description: >- - Unique identifier (UUID) generated by Bandwidth to assist in tracking - the verification status of a toll-free number. - example: acde070d-8c4c-4f0d-9d8a-162843c10333 - businessContactPhoneNumber: - description: Contact telephone number - type: string - minLength: 1 - maxLength: 500 - nullable: false - example: '+19192654500' - verificationRequest: - type: object - required: - - businessAddress - - businessContact - - messageVolume - - phoneNumbers - - useCase - - useCaseSummary - - productionMessageContent - - optInWorkflow - properties: - businessAddress: - $ref: '#/components/schemas/address' - businessContact: - $ref: '#/components/schemas/contact' - messageVolume: - type: integer - description: Estimated monthly volume of messages from the toll-free number. - minimum: 10 - maximum: 10000000 - example: 10000 - phoneNumbers: - type: array - minItems: 1 - maxItems: 10 - items: - $ref: '#/components/schemas/tfPhoneNumber' - useCase: - $ref: '#/components/schemas/useCase' - useCaseSummary: - $ref: '#/components/schemas/useCaseSummary' - productionMessageContent: - $ref: '#/components/schemas/productionMessageContent' - optInWorkflow: - $ref: '#/components/schemas/optInWorkflow' - additionalInformation: - type: string - description: Any additional information. - minLength: 0 - maxLength: 500 - nullable: true - example: Any additional information - isvReseller: - $ref: '#/components/schemas/isvReseller' - privacyPolicyUrl: - $ref: '#/components/schemas/privacyPolicyUrl' - termsAndConditionsUrl: - $ref: '#/components/schemas/termsAndConditionsUrl' - businessDba: - $ref: '#/components/schemas/businessDba' - businessRegistrationNumber: - $ref: '#/components/schemas/businessRegistrationNumber' - businessRegistrationType: - $ref: '#/components/schemas/businessRegistrationTypeEnum' - businessEntityType: - $ref: '#/components/schemas/businessEntityTypeEnum' - helpMessageResponse: - $ref: '#/components/schemas/helpMessageResponse' - ageGatedContent: - $ref: '#/components/schemas/ageGatedContent' - verificationUpdateRequest: - type: object - required: - - businessAddress - - businessContact - - messageVolume - - useCase - - useCaseSummary - - productionMessageContent - - optInWorkflow - properties: - businessAddress: - $ref: '#/components/schemas/address' - businessContact: - $ref: '#/components/schemas/contact' - messageVolume: - type: integer - description: Estimated monthly volume of messages from the toll-free number. - minimum: 10 - maximum: 10000000 - example: 10000 - useCase: - $ref: '#/components/schemas/useCase' - useCaseSummary: - $ref: '#/components/schemas/useCaseSummary' - productionMessageContent: - $ref: '#/components/schemas/productionMessageContent' - optInWorkflow: - $ref: '#/components/schemas/optInWorkflow' - additionalInformation: - $ref: '#/components/schemas/additionalInformation' - isvReseller: - $ref: '#/components/schemas/isvReseller' - privacyPolicyUrl: - $ref: '#/components/schemas/privacyPolicyUrl' - termsAndConditionsUrl: - $ref: '#/components/schemas/termsAndConditionsUrl' - businessDba: - $ref: '#/components/schemas/businessDba' - businessRegistrationNumber: - $ref: '#/components/schemas/businessRegistrationNumber' - businessRegistrationType: - $ref: '#/components/schemas/businessRegistrationTypeEnum' - businessEntityType: - $ref: '#/components/schemas/businessEntityTypeEnum' - helpMessageResponse: - $ref: '#/components/schemas/helpMessageResponse' - ageGatedContent: - $ref: '#/components/schemas/ageGatedContent' - tfvBasicAuthentication: - type: object - properties: - username: - type: string - maxLength: 100 - example: username - password: - type: string - maxLength: 200 - example: password - required: - - username - - password - webhookSubscriptionRequestSchema: - type: object - properties: - basicAuthentication: - $ref: '#/components/schemas/tfvBasicAuthentication' - callbackUrl: - $ref: '#/components/schemas/webhookUrl' - sharedSecretKey: - $ref: '#/components/schemas/sharedSecretKey' - required: - - callbackUrl - failureWebhook: - type: object - properties: - accountId: - $ref: '#/components/schemas/accountId1' - phoneNumber: - $ref: '#/components/schemas/tfPhoneNumber' - errorCode: - type: string - description: >- - An error code indicating what error was encountered. This code can - be interpreted as an HTTP status code in regards to the error that - was encountered. - example: '400' - errorMessage: - type: string - description: A description of the error that was encountered. - example: cannot process request. - errors: - $ref: '#/components/schemas/tfvWebhookErrors' - internalTicketNumber: - $ref: '#/components/schemas/internalTicketNumberForWebhook' - verificationDenialWebhook: - type: object - properties: - accountId: - $ref: '#/components/schemas/accountId1' - additionalDenialReasons: - description: >- - An optional list of denial reasons in addition to - declineReasonDescription when multiple reasons apply. - items: - $ref: '#/components/schemas/additionalDenialReason' - example: - - statusCode: 512 - reason: Reason A - resubmitAllowed: true - - statusCode: 513 - reason: Reason B - resubmitAllowed: true - type: array - declineReasonDescription: - $ref: '#/components/schemas/declineReasonDescription' - denialStatusCode: - $ref: '#/components/schemas/denialStatusCode' - internalTicketNumber: - $ref: '#/components/schemas/internalTicketNumberForWebhook' - phoneNumber: - $ref: '#/components/schemas/tfPhoneNumber' - resubmitAllowed: - $ref: '#/components/schemas/resubmitAllowed' - status: - $ref: '#/components/schemas/tfvUnverifiedStatus' - blocked: - $ref: '#/components/schemas/blocked' - blockedReason: - $ref: '#/components/schemas/blockedReason' - verificationWebhook: - type: object - properties: - accountId: - $ref: '#/components/schemas/accountId1' - phoneNumber: - $ref: '#/components/schemas/tfPhoneNumber' - status: - $ref: '#/components/schemas/tfvCallbackStatusEnum' - internalTicketNumber: - $ref: '#/components/schemas/internalTicketNumberForWebhook' - blockedWebhook: - type: object - properties: - accountId: - $ref: '#/components/schemas/accountId1' - phoneNumber: - $ref: '#/components/schemas/tfPhoneNumber' - status: - $ref: '#/components/schemas/tfvCallbackStatusEnum' - internalTicketNumber: - $ref: '#/components/schemas/internalTicketNumberForWebhook' - blocked: - $ref: '#/components/schemas/blocked' - blockedReason: - $ref: '#/components/schemas/blockedReason' - tfvSubmissionWrapper: - type: object - properties: - submission: - $ref: '#/components/schemas/verificationUpdateRequest' - address: - type: object - nullable: false - required: - - name - - addr1 - - city - - state - - zip - - url - properties: - name: - type: string - description: The name of the business using the toll-free number. - minLength: 1 - maxLength: 500 - nullable: false - example: Bandwidth Inc. - addr1: - type: string - description: The address of the business using the toll-free number. - minLength: 1 - maxLength: 500 - nullable: false - example: 2230 Bandmate Way - addr2: - type: string - description: The address of the business using the toll-free number. - minLength: 0 - maxLength: 500 - nullable: true - example: 2230 Bandmate Way - city: - type: string - description: The city of the business using the toll-free number. - minLength: 1 - maxLength: 500 - nullable: false - example: Raleigh - state: - type: string - description: The state of the business using the toll-free number. - minLength: 1 - maxLength: 500 - nullable: false - example: NC - zip: - type: string - description: The zip of the business using the toll-free number. - nullable: false - example: '27606' - pattern: '[- A-Za-z0-9]{0,500}' - url: - type: string - format: url - description: The website of the business using the toll-free number. - minLength: 1 - maxLength: 500 - nullable: false - example: https://www.example.com/path/to/resource - additionalInformation: - type: string - description: Any additional information. - minLength: 0 - maxLength: 500 - nullable: true - example: Any additional information - optInWorkflow: - type: object - nullable: false - required: - - description - - imageUrls - properties: - description: - type: string - minLength: 1 - maxLength: 500 - nullable: false - example: Opt In Flow - imageUrls: - type: array - items: - type: string - minLength: 1 - maxLength: 500 - nullable: false - example: https://www.example.com/path/to/resource - pattern: >- - ^$|(https?:\/\/)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,253}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#()?&//=]*) - confirmationResponse: - type: string - minLength: 0 - maxLength: 500 - nullable: true - example: Thank you for opting in! - isvReseller: - type: string - description: ISV name. - minLength: 0 - maxLength: 500 - nullable: true - example: Test ISV - contact: - type: object - nullable: false - required: - - firstName - - lastName - - email - - phoneNumber - properties: - firstName: - type: string - description: The first name of the business contact using the toll-free number. - minLength: 1 - maxLength: 500 - nullable: false - example: John - lastName: - type: string - description: The last name of the business contact using the toll-free number. - minLength: 1 - maxLength: 500 - nullable: false - example: Doe - email: - $ref: '#/components/schemas/email' - phoneNumber: - $ref: '#/components/schemas/businessContactPhoneNumber' - email: - type: string - format: email - minLength: 0 - maxLength: 500 - nullable: false - pattern: >- - ^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\.){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$ - example: foo@bar.com - useCases: - type: array - items: - type: string - example: - - 2FA - - App Notifications - - Appointments - - Auctions - - Auto Repair Services - - Bank Transfers - - Billing - - Booking Confirmations - - Business Updates - - COVID-19 Alerts - useCase: - type: string - description: The category of the use case. - minLength: 0 - maxLength: 500 - example: 2FA - useCaseSummary: - type: string - description: A general idea of the use case and customer. - minLength: 0 - maxLength: 500 - nullable: false - example: Text summarizing the use case for the toll-free number - productionMessageContent: - type: string - description: Example of message content. - minLength: 0 - maxLength: 500 - nullable: false - example: Production message content - webhookSubscriptionsListBody: - description: >- - A list of all webhook subscriptions registered for this account ID for - this particular feature (unpaginated). - type: object - required: - - data - properties: - links: - $ref: '#/components/schemas/linksObject' - errors: - type: array - items: - $ref: '#/components/schemas/error' - data: - items: - $ref: '#/components/schemas/webhookSubscription' - type: array - linksObject: - type: object - properties: - first: - description: The first (or only) page of results matching the query. - type: string - next: - description: >- - If more results exist than specified by 'size', this link returns - the next page of 'size' results. - type: string - previous: - description: >- - If the results are more than one page, this link returns the - previous page of 'size' results. - type: string - last: - description: >- - If more results exist than specified by 'size', this link return the - last page of result. - type: string - error: - type: object - properties: - code: - type: integer - description: - type: string - telephoneNumbers: - type: array - items: - $ref: '#/components/schemas/telephoneNumber' - telephoneNumber: - type: object - properties: - telephoneNumber: - description: Simple Telephone Number. - type: string - webhookSubscriptionTypeEnum: - type: string - enum: - - TOLLFREE_VERIFICATION_STATUS - - MESSAGING_PORTOUT_APPROVAL_STATUS - example: TOLLFREE_VERIFICATION_STATUS - webhookSubscription: - description: >- - Information about a webhook that Bandwidth should send upon the - completion of event customer has subscribed to. - type: object - required: - - callbackUrl - properties: - id: - type: string - example: 7hICGStfAfeGxEq3N0lQwO - accountId: - type: string - example: '1234567' - callbackUrl: - $ref: '#/components/schemas/webhookUrl' - type: - $ref: '#/components/schemas/webhookSubscriptionTypeEnum' - basicAuthentication: - description: >- - Basic authentication credentials are not required, but if present, - both username and password must be provided. - type: object - required: - - username - - password - properties: - username: - type: string - maxLength: 100 - password: - type: string - maxLength: 200 - createdDate: - type: string - format: date-time - example: '2023-05-15T13:56:39.965Z' - modifiedDate: - type: string - format: date-time - example: '2023-05-15T13:56:39.965Z' - webhookUrl: - description: >- - Callback URL to receive status updates from Bandwidth. When a webhook - subscription is registered with Bandwidth under a given account ID, it - will be used to send status updates for all requests submitted under - that account ID. - type: string - format: url - minLength: 0 - maxLength: 2000 - nullable: true - example: https://www.example.com/path/to/resource - pattern: >- - ^$|(https?:\/\/)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,253}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#()?&//=]*) - tfvError: - description: A generic error object. - properties: - type: - type: string - example: Error Type - description: - type: string - example: Error Message - errors: - type: object - description: >- - Each key of this errors object refers to a field of the submitted - object (using dot notation for nested objects), with the field being - a key to an array of one or more errors for that field. - example: - field: error message - type: object - tfvStatus: - type: object - properties: - phoneNumber: - $ref: '#/components/schemas/tfPhoneNumber' - status: - $ref: '#/components/schemas/tfvStatusEnum' - internalTicketNumber: - $ref: '#/components/schemas/internalTicketNumber' - declineReasonDescription: - $ref: '#/components/schemas/declineReasonDescription' - resubmitAllowed: - $ref: '#/components/schemas/resubmitAllowed' - createdDateTime: - type: string - description: Date and time the verification request was created. - format: date-time - example: '2021-06-08T06:45:13.0Z' - modifiedDateTime: - type: string - description: Date and time the verification request was last modified. - format: date-time - example: '2021-06-08T06:45:13.0Z' - submission: - $ref: '#/components/schemas/tfvSubmissionInfo' - blocked: - $ref: '#/components/schemas/blocked' - blockedReason: - $ref: '#/components/schemas/blockedReason' - tfvSubmissionInfo: - type: object - properties: - businessAddress: - $ref: '#/components/schemas/address' - businessContact: - $ref: '#/components/schemas/contact' - messageVolume: - type: integer - description: Estimated monthly volume of messages from the toll-free number. - minimum: 10 - maximum: 10000000 - example: 10000 - useCase: - $ref: '#/components/schemas/useCase' - useCaseSummary: - $ref: '#/components/schemas/useCaseSummary' - productionMessageContent: - $ref: '#/components/schemas/productionMessageContent' - optInWorkflow: - $ref: '#/components/schemas/optInWorkflow' - additionalInformation: - $ref: '#/components/schemas/additionalInformation' - isvReseller: - $ref: '#/components/schemas/isvReseller' - privacyPolicyUrl: - $ref: '#/components/schemas/privacyPolicyUrl' - termsAndConditionsUrl: - $ref: '#/components/schemas/termsAndConditionsUrl' - businessDba: - $ref: '#/components/schemas/businessDba' - businessRegistrationNumber: - $ref: '#/components/schemas/businessRegistrationNumber' - description: >- - US Federal Tax ID Number (EIN) or Canada Business Number (CBN). - Available starting October 1st, 2025. - businessRegistrationType: - $ref: '#/components/schemas/businessRegistrationTypeEnum' - description: >- - The type of business registration number. Available starting October - 1st, 2025. - businessEntityType: - $ref: '#/components/schemas/businessEntityTypeEnum' - description: >- - The type of registered business. If no option is applicable, please - provide "SOLE_PROPRIETOR" as a value. Available starting October - 1st, 2025. - tfvStatusEnum: - type: string - enum: - - VERIFIED - - UNVERIFIED - - PENDING - example: VERIFIED - sharedSecretKey: - description: >- - An ASCII string submitted by the user as a shared secret key for - generating an HMAC header for callbacks. - example: This is my $3cret - maxLength: 64 - minLength: 16 - nullable: true - pattern: ^[ -~]{16,64}$ - type: string - responses: - createMessageResponse: - description: Accepted - content: - application/json: - schema: - $ref: '#/components/schemas/message' - createMultiChannelMessageResponse: - description: Accepted - content: - application/json: - schema: - $ref: '#/components/schemas/createMultiChannelMessageResponse' - listMessagesResponse: - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/messagesList' - getMediaResponse: - description: OK - content: - application/octet-stream: - schema: - type: string - description: Successful Operation - format: binary - listMediaResponse: - description: OK - headers: - Continuation-Token: - description: Continuation token used to retrieve subsequent media. - schema: - type: string - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/media' - messagingBadRequestError: - description: Bad Request - content: - application/json: - schema: - $ref: '#/components/schemas/messagingRequestError' - messagingNotAcceptableError: - description: Not Acceptable - content: - application/json: - schema: - $ref: '#/components/schemas/messagingRequestError' - createMessageBadRequestError: - description: Bad Request - content: - application/json: - schema: - $ref: '#/components/schemas/createMessageRequestError' - messagingUnauthorizedError: - description: Unauthorized - content: - application/json: - schema: - $ref: '#/components/schemas/messagingRequestError' - messagingForbiddenError: - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/messagingRequestError' - messagingNotFoundError: - description: Not Found - content: - application/json: - schema: - $ref: '#/components/schemas/messagingRequestError' - messagingMethodNotAllowedError: - description: Method Not Allowed - content: - application/json: - schema: - $ref: '#/components/schemas/messagingRequestError' - messagingInvalidMediaTypeError: - description: Unsupported Media Type - content: - application/json: - schema: - $ref: '#/components/schemas/messagingRequestError' - messagingTooManyRequestsError: - description: Too Many Requests - content: - application/json: - schema: - $ref: '#/components/schemas/messagingRequestError' - messagingInternalServerError: - description: Internal Server Error - content: - application/json: - schema: - $ref: '#/components/schemas/messagingRequestError' - multiChannelBadRequestError: - description: Bad Request - content: - application/json: - schema: - $ref: '#/components/schemas/multiChannelError' - example: - links: [] - data: null - errors: - - type: request-validation - description: >- - The 'channelList[0].from' field must contain exactly one - telephone number - source: - field: channelList[0].from - multiChannelNotAcceptableError: - description: Not Acceptable - multiChannelUnauthorizedError: - description: Unauthorized - content: - application/json: - schema: - $ref: '#/components/schemas/multiChannelError' - example: - links: [] - data: null - errors: - - type: unauthorized - description: Authentication Failed - source: {} - multiChannelForbiddenError: - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/multiChannelError' - example: - links: [] - data: null - errors: - - type: forbidden - description: Access Denied - source: {} - multiChannelNotFoundError: - description: Not Found - content: - application/json: - schema: - $ref: '#/components/schemas/multiChannelError' - example: - links: [] - data: null - errors: - - type: forbidden - description: Resource not found. - source: {} - multiChannelMethodNotAllowedError: - description: Method Not Allowed - content: - application/json: - schema: - $ref: '#/components/schemas/multiChannelError' - example: - links: [] - data: null - errors: - - type: method-not-allowed - description: Method 'PUT' not supported for this resource. - source: {} - multiChannelInvalidMediaTypeError: - description: Unsupported Media Type - content: - application/json: - schema: - $ref: '#/components/schemas/multiChannelError' - example: - links: [] - data: null - errors: - - type: unsupported-content-type - description: >- - Content-Type 'application/xml;charset=UTF-8' is not supported. - Please use 'application/json' - source: - header: Content-Type - multiChannelTooManyRequestsError: - description: Too Many Requests - content: - application/json: - schema: - $ref: '#/components/schemas/multiChannelError' - example: - links: [] - data: null - errors: - - type: rate-limit-exceeded - description: >- - You have exceeded your rate limit for this endpoint. Please - retry later. - source: {} - multiChannelInternalServerError: - description: Internal Server Error - content: - application/json: - schema: - $ref: '#/components/schemas/multiChannelError' - example: - links: [] - data: null - errors: - - type: internal-server-error - description: Internal server error. No further information available - source: {} - createCallResponse: - description: Created - headers: - Location: - description: The URL for further interactions with this call - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/createCallResponse' - examples: - createCall Response: - $ref: '#/components/examples/createCallResponseExample' - getCallStateResponse: - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/callState' - updateCallResponse: - description: OK - listCallsResponse: - description: OK - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/callState' - getStatisticsResponse: - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/accountStatistics' - updateRecordingResponse: - description: OK - listCallRecordingsResponse: - description: OK - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/callRecordingMetadata' - getCallRecordingResponse: - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/callRecordingMetadata' - downloadRecordingMediaResponse: - description: OK - content: - audio/vnd.wave: - schema: - type: string - format: binary - audio/mpeg: - schema: - type: string - format: binary - getRecordingTranscriptionResponse: - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/recordingTranscriptions' - listTranscriptionsResponse: - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/callTranscriptionMetadataList' - getCallTranscriptionResponse: - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/callTranscriptionResponse' - deleteCallTranscriptionResponse: - description: No Content - listConferencesResponse: - description: OK - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/conference' - examples: - listConferences Response: - $ref: '#/components/examples/listConferencesResponseExample' - getConferenceResponse: - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/conference' - getConferenceMemberResponse: - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/conferenceMember' - listConferenceRecordingsResponse: - description: OK - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/conferenceRecordingMetadata' - getConferenceRecordingResponse: - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/conferenceRecordingMetadata' - voiceBadRequestError: - description: Bad Request - content: - application/json: - schema: - $ref: '#/components/schemas/voiceApiError' - examples: - badRequestErrorExample: - $ref: '#/components/examples/voiceBadRequestErrorExample' - voiceUnauthorizedError: - description: Unauthorized - content: - application/json: - schema: - $ref: '#/components/schemas/voiceApiError' - examples: - unauthorizedErrorExample: - $ref: '#/components/examples/voiceUnauthorizedErrorExample' - voiceForbiddenError: - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/voiceApiError' - examples: - forbiddenErrorExample: - $ref: '#/components/examples/voiceForbiddenErrorExample' - voiceNotFoundError: - description: Not Found - content: - application/json: - schema: - $ref: '#/components/schemas/voiceApiError' - examples: - notFoundErrorExample: - $ref: '#/components/examples/voiceNotFoundErrorExample' - voiceNotAllowedError: - description: Method Not Allowed - content: - application/json: - schema: - $ref: '#/components/schemas/voiceApiError' - examples: - notAllowedErrorExample: - $ref: '#/components/examples/voiceNotAllowedErrorExample' - voiceConflictError: - description: Conflict - content: - application/json: - schema: - $ref: '#/components/schemas/voiceApiError' - examples: - conflictErrorExample: - $ref: '#/components/examples/voiceConflictErrorExample' - voiceUnsupportedMediaTypeError: - description: Unsupported Media Type - content: - application/json: - schema: - $ref: '#/components/schemas/voiceApiError' - examples: - tooManyRequestsErrorExample: - $ref: '#/components/examples/voiceUnsupportedMediaTypeErrorExample' - voiceTooManyRequestsError: - description: Too Many Requests - headers: - Retry-After: - description: When you should try your request again. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/voiceApiError' - examples: - tooManyRequestsErrorExample: - $ref: '#/components/examples/voiceTooManyRequestsErrorExample' - voiceInternalServerError: - description: Internal Server Error - content: - application/json: - schema: - $ref: '#/components/schemas/voiceApiError' - examples: - internalServerErrorExample: - $ref: '#/components/examples/voiceInternalServerErrorExample' - voiceCodeResponse: - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/voiceCodeResponse' - messagingCodeResponse: - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/messagingCodeResponse' - verifyCodeResponse: - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/verifyCodeResponse' - mfaBadRequestError: - description: Bad Request - headers: {} - content: - application/json: - schema: - $ref: '#/components/schemas/mfaRequestError' - mfaUnauthorizedError: - description: Unauthorized - headers: {} - content: - application/json: - schema: - $ref: '#/components/schemas/mfaUnauthorizedRequestError' - mfaForbiddenError: - description: Forbidden - headers: {} - content: - application/json: - schema: - $ref: '#/components/schemas/mfaForbiddenRequestError' - mfaTooManyRequestsError: - description: Too Many Requests - headers: {} - content: - application/json: - schema: - $ref: '#/components/schemas/mfaRequestError' - mfaInternalServerError: - description: Internal Server Error - headers: {} - content: - application/json: - schema: - $ref: '#/components/schemas/mfaRequestError' - createSyncLookupResponse: - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/createSyncLookupResponse' - examples: - lookupCompleteWithDniExample: - $ref: '#/components/examples/lookupCompleteWithDniExample' - lookupCompleteExample: - $ref: '#/components/examples/lookupCompleteExample' - lookupPartialExample: - $ref: '#/components/examples/lookupPartialExample' - lookupFailedExample: - $ref: '#/components/examples/lookupFailedExample' - createAsyncBulkLookupResponse: - description: Accepted - content: - application/json: - schema: - $ref: '#/components/schemas/createAsyncBulkLookupResponse' - examples: - lookupInProgressExample: - $ref: '#/components/examples/lookupInProgressExample' - getAsyncBulkLookupResponse: - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/getAsyncBulkLookupResponse' - examples: - lookupCompleteWithDniExample: - $ref: '#/components/examples/lookupCompleteWithDniExample' - lookupCompleteExample: - $ref: '#/components/examples/lookupCompleteExample' - lookupInProgressExample: - $ref: '#/components/examples/lookupInProgressExample' - lookupPartialExample: - $ref: '#/components/examples/lookupPartialExample' - lookupFailedExample: - $ref: '#/components/examples/lookupFailedExample' - tnLookupDefaultResponse: - description: Bad Request - content: - application/json: - schema: - $ref: '#/components/schemas/lookupErrorResponse' - examples: - badRequest: - $ref: '#/components/examples/badRequestExample' - unauthorized: - $ref: '#/components/examples/unauthorizedExample' - forbidden: - $ref: '#/components/examples/forbiddenExample' - mediaType: - $ref: '#/components/examples/unsupportedMediaTypeExample' - notFound: - $ref: '#/components/examples/notFoundExample' - tooManyRequests: - $ref: '#/components/examples/tooManyRequestsExample' - internalServer: - $ref: '#/components/examples/internalServerErrorExample' - getTollFreeVerificationStatusResponse: - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/tfvStatus' - listWebhookSubscriptionsResponse: - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/webhookSubscriptionsListBody' - createWebhookSubscriptionResponse: - description: Created - content: - application/json: - schema: - $ref: '#/components/schemas/webhookSubscription' - updateWebhookSubscriptionResponse: - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/webhookSubscription' - listTollFreeUseCasesResponse: - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/useCases' - tfvBadRequestResponse: - description: Bad Request - content: - application/json: - schema: - $ref: '#/components/schemas/tfvError' - example: - description: Cannot process request. - type: bad request - noContentResponse: - description: No Content - tfvPostBadRequestResponse: - description: Bad Request - content: - application/json: - schema: - $ref: '#/components/schemas/tfvError' - example: - description: cannot process request. - errors: - businessName: Business name is required. - businessContactEmail: Business contact email is not a valid email address. - optInWorkflowImageURLs: Entries must be a valid array of objects. - tfvUnauthorizedResponse: - description: Unauthorized - content: - application/json: - schema: - $ref: '#/components/schemas/tfvError' - example: - description: Client is providing incorrect or invalid credentials. - type: unauthorized - tfvForbiddenResponse: - description: Forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/tfvError' - example: - description: Client is not authorized for the action. - type: forbidden - tfvNotFoundResponse: - description: Cannot find the requested resource. - content: - application/json: - schema: - $ref: '#/components/schemas/tfvError' - example: - description: Cannot find the requested resource. - type: Not Found - tfvNotAllowedResponse: - description: Method Not Allowed - content: - application/json: - schema: - $ref: '#/components/schemas/tfvError' - example: - description: Method is not allowed. - type: Method Not Allowed - tfvTooManyRequestsResponse: - description: Too Many Requests - content: - application/json: - schema: - $ref: '#/components/schemas/tfvError' - example: - description: Throttling error. Too many requests. - type: Too Many Requests - tfvServerErrorResponse: - description: Internal Server Error - content: - application/json: - schema: - $ref: '#/components/schemas/tfvError' - example: - description: Internal Server Error. - type: Internal Server Error - tfvServiceUnavailableResponse: - description: Service Unavailable - content: - application/json: - schema: - $ref: '#/components/schemas/tfvError' - example: - description: Service Unavailable Error. - type: Service Unavailable - parameters: - accountId: - in: path - name: accountId - required: true - schema: - type: string - description: Your Bandwidth Account ID. - example: '9900000' - mediaId: - in: path - name: mediaId - required: true - description: Media ID to retrieve. - example: 14762070468292kw2fuqty55yp2b2/0/bw.png - schema: - type: string - contentType: - in: header - name: Content-Type - style: simple - explode: false - description: The media type of the entity-body. - example: audio/wav - schema: - type: string - cacheControl: - in: header - name: Cache-Control - style: simple - explode: false - description: >- - General-header field is used to specify directives that MUST be obeyed - by all caching mechanisms along the request/response chain. - example: no-cache - schema: - type: string - continuationToken: - in: header - name: Continuation-Token - description: Continuation token used to retrieve subsequent media. - example: >- - 1XEi2tsFtLo1JbtLwETnM1ZJ+PqAa8w6ENvC5QKvwyrCDYII663Gy5M4s40owR1tjkuWUif6qbWvFtQJR5/ipqbUnfAqL254LKNlPy6tATCzioKSuHuOqgzloDkSwRtX0LtcL2otHS69hK343m+SjdL+vlj71tT39 - schema: - type: string - messageId: - in: query - name: messageId - required: false - description: >- - The ID of the message to search for. Special characters need to be - encoded using URL encoding. Message IDs could come in different formats, - e.g., 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 and - 1589228074636lm4k2je7j7jklbn2 are valid message ID formats. Note that - you must include at least one query parameter. - example: 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 - schema: - type: string - sourceTn: - in: query - name: sourceTn - required: false - description: >- - The phone number that sent the message. Accepted values are: a single - full phone number a comma separated list of full phone numbers (maximum - of 10) or a single partial phone number (minimum of 5 characters e.g. - '%2B1919'). - example: '%2B15554443333' - schema: - type: string - destinationTn: - in: query - name: destinationTn - required: false - description: >- - The phone number that received the message. Accepted values are: a - single full phone number a comma separated list of full phone numbers - (maximum of 10) or a single partial phone number (minimum of 5 - characters e.g. '%2B1919'). - example: '%2B15554443333' - schema: - type: string - messageStatus: - in: query - name: messageStatus - required: false - description: >- - The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED - DELIVERED ACCEPTED UNDELIVERED. - schema: - $ref: '#/components/schemas/messageStatusEnum' - messageDirection: - in: query - name: messageDirection - required: false - description: The direction of the message. One of INBOUND OUTBOUND. - schema: - $ref: '#/components/schemas/listMessageDirectionEnum' - carrierName: - in: query - name: carrierName - required: false - description: >- - The name of the carrier used for this message. Possible values include - but are not limited to Verizon and TMobile. Special characters need to - be encoded using URL encoding (i.e. AT&T should be passed as AT%26T). - example: Verizon - schema: - type: string - messageType: - in: query - name: messageType - required: false - description: The type of message. Either sms or mms. - schema: - $ref: '#/components/schemas/messageTypeEnum' - errorCode: - in: query - name: errorCode - required: false - description: The error code of the message. - example: 9902 - schema: - type: integer - fromDateTime: - in: query - name: fromDateTime - required: false - description: >- - The start of the date range to search in ISO 8601 format. Uses the - message receive time. The date range to search in is currently 14 days. - example: 2022-09-14T18:20:16.000Z - schema: - type: string - toDateTime: - in: query - name: toDateTime - required: false - description: >- - The end of the date range to search in ISO 8601 format. Uses the message - receive time. The date range to search in is currently 14 days. - example: 2022-09-14T18:20:16.000Z - schema: - type: string - campaignId: - in: query - name: campaignId - required: false - description: The campaign ID of the message. - example: CJEUMDK - schema: - type: string - fromBwLatency: - in: query - name: fromBwLatency - required: false - description: >- - The minimum Bandwidth latency of the message in seconds. Only available - for accounts with the Advanced Quality Metrics feature enabled. - example: 5 - schema: - type: integer - bwQueued: - in: query - name: bwQueued - required: false - description: >- - A boolean value indicating whether the message is queued in the - Bandwidth network. - example: true - schema: - type: boolean - product: - in: query - name: product - required: false - description: Messaging product associated with the message. - example: P2P - schema: - $ref: '#/components/schemas/productTypeEnum' - location: - in: query - name: location - required: false - description: Location Id associated with the message. - example: 123ABC - schema: - type: string - carrierQueued: - in: query - name: carrierQueued - required: false - description: >- - A boolean value indicating whether the message is queued in the carrier - network. Only available for OUTBOUND messages from accounts with the - Advanced Quality Metrics feature enabled. - example: true - schema: - type: boolean - fromCarrierLatency: - in: query - name: fromCarrierLatency - required: false - description: >- - The minimum carrier latency of the message in seconds. Only available - for OUTBOUND messages from accounts with the Advanced Quality Metrics - feature enabled. - example: 50 - schema: - type: integer - callingNumberCountryA3: - in: query - name: callingNumberCountryA3 - required: false - description: Calling number country in A3 format. - example: USA - schema: - type: string - calledNumberCountryA3: - in: query - name: calledNumberCountryA3 - required: false - description: Called number country in A3 format. - example: USA - schema: - type: string - fromSegmentCount: - in: query - name: fromSegmentCount - required: false - description: Segment count (start range). - example: 1 - schema: - type: integer - toSegmentCount: - in: query - name: toSegmentCount - required: false - description: Segment count (end range). - example: 3 - schema: - type: integer - fromMessageSize: - in: query - name: fromMessageSize - required: false - description: Message size (start range). - example: 100 - schema: - type: integer - toMessageSize: - in: query - name: toMessageSize - required: false - description: Message size (end range). - example: 120 - schema: - type: integer - sort: - in: query - name: sort - required: false - description: >- - The field and direction to sort by combined with a colon. Direction is - either asc or desc. - example: sourceTn:desc - schema: - type: string - pageToken: - in: query - name: pageToken - required: false - description: A base64 encoded value used for pagination of results. - example: gdEewhcJLQRB5 - schema: - type: string - limit: - in: query - name: limit - required: false - description: >- - The maximum records requested in search result. Default 100. The sum of - limit and after cannot be more than 10000. - schema: - type: integer - example: 50 - limitTotalCount: - in: query - name: limitTotalCount - required: false - description: >- - When set to true, the response's totalCount field will have a maximum - value of 10,000. When set to false, or excluded, this will give an - accurate totalCount of all messages that match the provided filters. If - you are experiencing latency, try using this parameter to limit your - results. - example: true - schema: - type: boolean - callId: - name: callId - in: path - required: true - schema: - type: string - description: Programmable Voice API Call ID. - example: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 - recordingId: - name: recordingId - in: path - required: true - schema: - type: string - description: Programmable Voice API Recording ID. - example: r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 - conferenceId: - name: conferenceId - in: path - required: true - schema: - type: string - description: Programmable Voice API Conference ID. - example: conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9 - memberId: - name: memberId - in: path - required: true - schema: - type: string - description: Programmable Voice API Conference Member ID. - example: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 - transcriptionId: - name: transcriptionId - in: path - required: true - schema: - type: string - description: Programmable Voice API Transcription ID. - example: t-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 - to: - name: to - in: query - required: false - schema: - type: string - description: Filter results by the `to` field. - example: '%2b19195551234' - from: - name: from - in: query - required: false - schema: - type: string - description: Filter results by the `from` field. - example: '%2b19195554321' - name: - name: name - in: query - required: false - schema: - type: string - description: Filter results by the `name` field. - example: my-custom-name - minCreatedTime: - name: minCreatedTime - in: query - required: false - schema: - type: string - description: >- - Filter results to conferences which have a `createdTime` after or at - `minCreatedTime` (in ISO8601 format). - example: '2022-06-21T19:13:21Z' - maxCreatedTime: - name: maxCreatedTime - in: query - required: false - schema: - type: string - description: >- - Filter results to conferences which have a `createdTime` before or at - `maxCreatedTime` (in ISO8601 format). - example: '2022-06-21T19:13:21Z' - minStartTime: - name: minStartTime - in: query - required: false - schema: - type: string - description: >- - Filter results to recordings which have a `startTime` after or including - `minStartTime` (in ISO8601 format). - example: '2022-06-21T19:13:21Z' - maxStartTime: - name: maxStartTime - in: query - required: false - schema: - type: string - description: >- - Filter results to recordings which have a `startTime` before - `maxStartTime` (in ISO8601 format). - example: '2022-06-21T19:13:21Z' - pageSize: - name: pageSize - in: query - required: false - schema: - type: integer - format: int32 - minimum: 1 - maximum: 1000 - default: 1000 - description: Specifies the max number of conferences that will be returned. - example: 500 - minStartTimeCalls: - name: minStartTime - in: query - required: false - schema: - type: string - description: >- - Filter results to calls which have a `startTime` after or including - `minStartTime` (in ISO8601 format). - example: '2022-06-21T19:13:21Z' - maxStartTimeCalls: - name: maxStartTime - in: query - required: false - schema: - type: string - description: >- - Filter results to calls which have a `startTime` before or including - `maxStartTime` (in ISO8601 format). - example: '2022-06-21T19:13:21Z' - pageSizeCalls: - name: pageSize - in: query - required: false - schema: - type: integer - format: int32 - minimum: 1 - maximum: 10000 - default: 1000 - description: Specifies the max number of calls that will be returned. - example: 500 - pageToken1: - name: pageToken - in: query - required: false - schema: - type: string - description: >- - Not intended for explicit use. To use pagination, follow the links in - the `Link` header of the response, as indicated in the endpoint - description. - example: eyJwYWdlVG9rZW4iOiJ0b2tlbiJ9 - disconnectCause: - name: disconnectCause - in: query - required: false - schema: - type: string - description: Filter results to calls with specified call Disconnect Cause. - example: hangup - accountId1: - in: path - name: accountId - required: true - schema: - type: string - description: Your Bandwidth Account ID. - example: '9900000' - requestId: - in: path - name: requestId - required: true - schema: - type: string - format: uuid - description: The phone number lookup request ID from Bandwidth. - example: 004223a0-8b17-41b1-bf81-20732adf5590 - tfPhoneNumberPathParam: - in: path - name: phoneNumber - required: true - schema: - $ref: '#/components/schemas/tfPhoneNumber' - description: Valid Toll-Free telephone number in E.164 format. - example: '+18885555555' - webhookSubscriptionIdPathParam: - in: path - name: id - required: true - schema: - type: string - description: Webhook subscription ID - example: 7bt57JcsVYJrN9K1OcV1Nu - examples: - smsMessageReceivedCallbackExample: - summary: An example of a sms message-received callback body. - value: - time: '2025-01-06T15:43:35.502180Z' - type: message-received - to: '+12345678902' - description: Incoming message received - message: - id: 14762070468292kw2fuqty55yp2b2 - owner: '+12345678902' - applicationId: 93de2206-9669-4e07-948d-329f4b722ee2 - time: '2025-01-06T15:43:34.000000Z' - segmentCount: 1 - direction: in - to: - - '+12345678902' - from: '+12345678901' - text: Hey, check out this SMS! - mmsMessageReceivedCallbackExample: - summary: An example of a mms message-received callback body. - value: - time: '2024-09-14T18:20:45.160744Z' - type: message-received - to: '+12345678902' - description: Incoming message received - message: - id: 14762070468292kw2fuqty55yp2b2 - owner: '+12345678902' - applicationId: 93de2206-9669-4e07-948d-329f4b722ee2 - time: '2024-09-14T18:20:45.160744Z' - segmentCount: 1 - direction: in - to: - - '+12345678902' - - '+12345678903' - from: '+12345678901' - text: Hey, check out the MMS! - media: - - >- - https://messaging.bandwidth.com/api/v2/users/9900902/media/14762070468292kw2fuqty55yp2b2/0/bw.png - messageSendingCallbackExample: - summary: An example of a message-sending callback body. - value: - time: '2024-06-25T18:42:36.979456Z' - type: message-sending - to: '+15554443333' - description: Message is sending to carrier. - message: - id: 1593110555875xo7watq5px6rbe5d - owner: '+15552221111' - applicationId: cfd4fb83-7531-4acc-b471-42d0bb76a65c - time: '2024-06-25T18:42:35.876906Z' - segmentCount: 1 - direction: out - to: - - '+15554443333' - from: '+15552221111' - text: '' - media: - - https://dev.bandwidth.com/images/bandwidth-logo.png - tag: your tag here - smsMessageDeliveredCallbackExample: - summary: An example of a sms message-delivered callback body. - value: - type: message-delivered - time: '2024-09-14T18:20:11.160744Z' - description: Message delivered to carrier. - to: '+12345678902' - message: - id: 14762070468292kw2fuqty55yp2b2 - time: '2024-09-14T18:20:11.160744Z' - to: - - '+12345678902' - from: '+12345678901' - text: '' - applicationId: 93de2206-9669-4e07-948d-329f4b722ee2 - owner: '+12345678902' - direction: out - segmentCount: 1 - mmsMessageDeliveredCallbackExample: - summary: An example of a mms message-delivered callback body. - value: - type: message-delivered - time: '2024-09-14T18:20:24.160544Z' - description: Message delivered to carrier. - to: '+12345678902' - message: - id: 14762070468292kw2fuqty55yp2b2 - time: '2024-09-14T18:20:24.160544Z' - to: - - '+12345678902' - from: '+12345678901' - text: '' - applicationId: 93de2206-9669-4e07-948d-329f4b722ee2 - owner: '+12345678902' - direction: out - segmentCount: 1 - media: - - https://dev.bandwidth.com/images/bandwidth-logo.png - groupMmsMessageDeliveredCallbackExample: - summary: An example of a group mms message-delivered callback body. - value: - type: message-delivered - time: '2024-09-14T18:20:17.160544Z' - description: Message delivered to carrier. - to: '+12345678902' - message: - id: 14762070468292kw2fuqty55yp2b2 - time: '2024-09-14T18:20:17.160544Z' - to: - - '+12345678902' - - '+12345678903' - from: '+12345678901' - text: '' - applicationId: 93de2206-9669-4e07-948d-329f4b722ee2 - owner: '+12345678902' - direction: out - segmentCount: 1 - messageFailedCallbackExample: - summary: An example of a message-failed callback body. - value: - type: message-failed - time: '2024-12-18T16:51:27.704450Z' - description: forbidden to country - to: '+52345678903' - errorCode: 4432 - message: - id: 14762070468292kw2fuqty55yp2b2 - time: '2024-12-18T16:51:27.704450Z' - to: - - '+12345678902' - - '+52345678903' - from: '+12345678901' - text: '' - applicationId: 93de2206-9669-4e07-948d-329f4b722ee2 - media: - - https://dev.bandwidth.com/images/bandwidth-logo.png - owner: '+12345678901' - direction: out - segmentCount: 1 - createCallResponseExample: - summary: Example of a createCall Response - value: - applicationId: 04e88489-df02-4e34-a0ee-27a91849555f - accountId: '9900000' - callId: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 - to: '+19195551234' - from: '+19195554312' - enqueuedTime: '2022-06-16T13:15:07.160Z' - callUrl: >- - https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 - callTimeout: 30 - callbackTimeout: 15 - tag: My custom tag value - answerMethod: POST - answerUrl: https://myServer.example/bandwidth/webhooks/answer - answerFallbackMethod: POST - answerFallbackUrl: https://myServer.example/bandwidth/webhooks/answerFallback - disconnectMethod: POST - disconnectUrl: https://myServer.example/bandwidth/webhooks/disconnect - username: mySecretUsername - password: '*****' - fallbackUsername: mySecretUsername - fallbackPassword: '*****' - priority: 5 - listConferencesResponseExample: - summary: Example of a listConferences Response - value: - - id: conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9 - name: my-conference-name - createdTime: '2022-06-17T22:19:40.375Z' - completedTime: '2022-06-17T22:20:00.000Z' - conferenceEventUrl: https://myServer.example/bandwidth/webhooks/conferenceEvent - conferenceEventMethod: POST - tag: my custom tag - voiceBadRequestErrorExample: - summary: Example of a Bad Request (400) Error - value: - type: validation - description: 'Invalid answerUrl: only http and https are allowed.' - voiceUnauthorizedErrorExample: - summary: Example of an Unauthorized (401) Error - value: - type: validation - description: 'Invalid answerUrl: only http and https are allowed.' - voiceForbiddenErrorExample: - summary: Example of a Forbidden (403) Error - value: - type: validation - description: 'Invalid answerUrl: only http and https are allowed.' - voiceNotFoundErrorExample: - summary: Example of a Not Found (404) Error - value: - type: validation - description: 'Invalid answerUrl: only http and https are allowed.' - voiceNotAllowedErrorExample: - summary: Example of a Not Allowed (405) Error - value: - type: validation - description: 'Invalid answerUrl: only http and https are allowed.' - voiceConflictErrorExample: - summary: Example of a Conflict (409) Error - value: - type: validation - description: 'Invalid answerUrl: only http and https are allowed.' - voiceUnsupportedMediaTypeErrorExample: - summary: Example of an Unsupported Media Type (415) Error - value: - type: validation - description: 'Invalid answerUrl: only http and https are allowed.' - voiceTooManyRequestsErrorExample: - summary: Example of a Too Many Requests (429) Error - value: - type: validation - description: 'Invalid answerUrl: only http and https are allowed.' - voiceInternalServerErrorExample: - summary: Example of an Internal Server (500) Error - value: - type: validation - description: 'Invalid answerUrl: only http and https are allowed.' - singleNumberRequestExample: - summary: Number Lookup Request - value: - phoneNumbers: - - '+19196104423' - multipleNumberRequestExample: - summary: Number Lookup Request for Multiple Numbers - value: - phoneNumbers: - - '+19196104423' - - '+19196104424' - lookupInProgressExample: - summary: Numbers Lookup In Progress - value: - links: - - href: href - rel: rel - method: GET - data: - requestId: 004223a0-8b17-41b1-bf81-20732adf5590 - status: IN_PROGRESS - results: [] - errors: [] - lookupFailedExample: - summary: Numbers Lookup Failed - value: - links: - - href: href - rel: rel - method: GET - data: - requestId: 004223a0-8b17-41b1-bf81-20732adf5590 - status: FAILED - results: [] - errors: - - code: NO-MATCH - description: The following TNs could not be found in the Number Industry data - meta: - phoneNumbers: - - '+13992077164' - message: Invalid TNs - code: 1001 - type: NumberInventory - lookupPartialExample: - summary: Numbers Lookup Partial Complete - value: - links: - - href: href - rel: rel - method: GET - data: - requestId: 004223a0-8b17-41b1-bf81-20732adf5590 - status: PARTIAL_COMPLETE - results: - - phoneNumber: '+19196104423' - lineType: MOBILE - messagingProvider: Verizon Wireless - voiceProvider: Verizon Wireless - countryCodeA3: USA - - phoneNumber: '+19196104424' - lineType: MOBILE - messagingProvider: T-Mobile USA - voiceProvider: T-Mobile USA - countryCodeA3: USA - errors: - - code: NO-MATCH - description: The following TNs could not be found in the Number Industry data - meta: - phoneNumbers: - - '+13992077164' - message: Invalid TNs - code: 1001 - type: NumberInventory - lookupCompleteExample: - summary: Numbers Lookup Complete (without DNI) - value: - links: - - href: href - rel: rel - method: GET - data: - requestId: 004223a0-8b17-41b1-bf81-20732adf5590 - status: COMPLETE - results: - - phoneNumber: '+10072904497' - lineType: MOBILE - messagingProvider: Verizon Wireless - voiceProvider: Verizon Wireless - countryCodeA3: USA - - phoneNumber: '+10072904498' - lineType: MOBILE - messagingProvider: T-Mobile USA - voiceProvider: T-Mobile USA - countryCodeA3: USA - errors: [] - lookupCompleteWithDniExample: - summary: Numbers Lookup Complete (with DNI) - value: - links: - - href: href - rel: rel - method: GET - data: - requestId: 20732adf-bf81-8b17-41b1-004223a05590 - status: COMPLETE - results: - - phoneNumber: '+10072904497' - countryCodeA3: USA - lineType: MOBILE - messagingProvider: T-MOBILE USA INC - voiceProvider: T-MOBILE USA INC - latestMessageDeliveryStatus: ACTIVE - initialMessageDeliveryStatusDate: '2025-05-14' - latestMessageDeliveryStatusDate: '2025-05-18' - - phoneNumber: '+10072904498' - countryCodeA3: USA - lineType: FIXED - voiceProvider: VERIZON - latestMessageDeliveryStatus: DEACTIVATED - initialMessageDeliveryStatusDate: '2025-09-05' - latestMessageDeliveryStatusDate: '2025-09-05' - - phoneNumber: '+10072904499' - lineType: MOBILE - countryCodeA3: USA - messagingProvider: VERIZON - voiceProvider: VERIZON - deactivationReporter: Verizon Wireless - deactivationDate: '2025-09-29 01:23:00' - deactivationEvent: DEACTIVATED - latestMessageDeliveryStatus: UNKNOWN - errors: [] - badRequestExample: - summary: Example Bad Request Error - value: - links: [] - data: {} - errors: - - type: bad-request - description: >- - Bad Request. Ensure that you have set the requestId as a URL path - parameter. - unauthorizedExample: - summary: Unauthorized Error - value: - links: [] - data: {} - errors: - - type: Unauthorized - description: You are not authorized to access this resource. - code: '1' - page: null - forbiddenExample: - summary: Forbidden Error - value: - links: [] - data: {} - errors: - - type: Forbidden - description: You do not have permission to access this resource. - code: '2' - page: null - unsupportedMediaTypeExample: - summary: Unsupported Media Type Error - value: - links: [] - data: {} - errors: - - type: invalid-content-type - description: >- - Invalid content-type. Ensure that your content-type header is set - to application/json. - notFoundExample: - summary: Not Found Error - value: - links: [] - data: {} - errors: - - type: not-found - description: >- - RequestId not found. Ensure that the requestId used in the URL - path is valid and maps to a previous request that was submitted. - tooManyRequestsExample: - summary: Too Many Requests Error - value: - links: [] - data: {} - errors: - - type: rate-limiting - description: >- - Rate limit exceeded. Wait for the time specified in the - Retry-After header before sending another request. - internalServerErrorExample: - summary: Internal Server Error - value: - links: [] - data: {} - errors: - - code: '500' - type: unexpected-error - description: >- - Unexpected error. Please contact Bandwidth Support if your - requests are receiving this status code for an extended period of - time. - requestBodies: - createMessageRequest: - content: - application/json: - schema: - $ref: '#/components/schemas/messageRequest' - required: true - createMultiChannelMessageRequest: - content: - application/json: - schema: - $ref: '#/components/schemas/multiChannelMessageRequest' - required: true - uploadMediaRequest: - content: - application/json: - schema: - type: string - format: binary - application/ogg: - schema: - type: string - format: binary - application/pdf: - schema: - type: string - format: binary - application/rtf: - schema: - type: string - format: binary - application/zip: - schema: - type: string - format: binary - application/x-tar: - schema: - type: string - format: binary - application/xml: - schema: - type: string - format: binary - application/gzip: - schema: - type: string - format: binary - application/x-bzip2: - schema: - type: string - format: binary - application/x-gzip: - schema: - type: string - format: binary - application/smil: - schema: - type: string - format: binary - application/javascript: - schema: - type: string - format: binary - audio/mp4: - schema: - type: string - format: binary - audio/mpeg: - schema: - type: string - format: binary - audio/ogg: - schema: - type: string - format: binary - audio/flac: - schema: - type: string - format: binary - audio/webm: - schema: - type: string - format: binary - audio/wav: - schema: - type: string - format: binary - audio/amr: - schema: - type: string - format: binary - audio/3gpp: - schema: - type: string - format: binary - image/bmp: - schema: - type: string - format: binary - image/gif: - schema: - type: string - format: binary - image/heic: - schema: - type: string - format: binary - image/heif: - schema: - type: string - format: binary - image/jpeg: - schema: - type: string - format: binary - image/pjpeg: - schema: - type: string - format: binary - image/png: - schema: - type: string - format: binary - image/svg+xml: - schema: - type: string - format: binary - image/tiff: - schema: - type: string - format: binary - image/webp: - schema: - type: string - format: binary - image/x-icon: - schema: - type: string - format: binary - text/css: - schema: - type: string - format: binary - text/csv: - schema: - type: string - format: binary - text/calendar: - schema: - type: string - format: binary - text/html: - schema: - type: string - format: binary - text/plain: - schema: - type: string - format: binary - text/javascript: - schema: - type: string - format: binary - text/vcard: - schema: - type: string - format: binary - text/vnd.wap.wml: - schema: - type: string - format: binary - text/xml: - schema: - type: string - format: binary - video/avi: - schema: - type: string - format: binary - video/mp4: - schema: - type: string - format: binary - video/mpeg: - schema: - type: string - format: binary - video/ogg: - schema: - type: string - format: binary - video/quicktime: - schema: - type: string - format: binary - video/webm: - schema: - type: string - format: binary - video/x-ms-wmv: - schema: - type: string - format: binary - video/x-flv: - schema: - type: string - format: binary - required: true - createCallRequest: - description: JSON object containing information to create an outbound call - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/createCall' - updateCallRequest: - description: >- - JSON object containing information to redirect an existing call to a new - BXML document - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/updateCall' - updateCallBxmlRequest: - required: true - content: - application/xml: - schema: - type: string - description: A valid BXML document to replace the call's current BXML. - examples: - speakSentence: - summary: Speak Sentence - value: |- - - - This is a test sentence. - - redirectUrl: - summary: Redirect - value: |- - - - - - updateCallRecordingRequest: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/updateCallRecording' - transcribeRecordingRequest: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/transcribeRecording' - updateConferenceRequest: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/updateConference' - updateConferenceBxmlRequest: - required: true - content: - application/xml: - schema: - type: string - description: A valid BXML document to replace the call's current BXML. - examples: - stopRecording: - summary: Stop Recording - value: |- - - - - - updateConferenceMemberRequest: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/updateConferenceMember' - codeRequest: - description: MFA code request body. - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/codeRequest' - codeVerify: - description: MFA code verify request body. - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/verifyCodeRequest' - createSyncLookupRequest: - description: Synchronous phone number lookup request. - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/syncLookupRequest' - examples: - singleNumberRequestExample: - $ref: '#/components/examples/singleNumberRequestExample' - multipleNumberRequestExample: - $ref: '#/components/examples/multipleNumberRequestExample' - createAsyncBulkLookupRequest: - description: Asynchronous bulk phone number lookup request. - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/asyncLookupRequest' - examples: - multipleNumberRequestExample: - $ref: '#/components/examples/multipleNumberRequestExample' - requestTollFreeVerificationRequest: - description: Request for verification of a toll-free phone number. - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/verificationRequest' - updateTollFreeVerificationRequestRequest: - description: Update a request for verification of a toll-free phone number. - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/tfvSubmissionWrapper' - verificationWebhookRequest: - description: Verification callback status of a toll-free phone number. - required: true - content: - application/json: - schema: - oneOf: - - $ref: '#/components/schemas/verificationWebhook' - - $ref: '#/components/schemas/verificationDenialWebhook' - - $ref: '#/components/schemas/failureWebhook' - - $ref: '#/components/schemas/blockedWebhook' - webhookSubscriptionRequest: - description: >- - Information about a webhook that Bandwidth should send upon the - completion of event customer is trying to subscribe to. - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/webhookSubscriptionRequestSchema' - securitySchemes: - Basic: - type: http - scheme: basic - description: >- - Basic authentication is a simple authentication scheme built into the - HTTP protocol. To use it, send your HTTP requests with an - `Authorization` header that contains the word `Basic` followed by a - space and a Base64-encoded string `username:password`. - - - - Example: `Authorization: Basic ZGVtbZpwQDU1dzByZA==` - OAuth2: - type: oauth2 - flows: - clientCredentials: - tokenUrl: https://api.bandwidth.com/api/v1/oauth2/token - scopes: {} - callbacks: - inboundCallback: - '{inboundCallbackUrl}': - post: - requestBody: - required: true - description: >- -

This Inbound Message Webhook is an envelope containing either a - received (MO) message to your - - message-enabled Bandwidth telephone number or a multichannel - client's response to a suggestion response - - or location request. - -

The payload type will be one of message-received, - suggestion-response, or - location-request-response. - -

Note that suggestion-response and - location-request-response callback types are - pertinent only for RBM messages sent from the - /messages/multiChannel endpoint. - -

Please visit Webhooks

- content: - application/json: - schema: - $ref: '#/components/schemas/inboundCallback' - examples: - smsMessageReceivedCallback: - $ref: '#/components/examples/smsMessageReceivedCallbackExample' - mmsMessageReceivedCallback: - $ref: '#/components/examples/mmsMessageReceivedCallbackExample' - responses: - '200': - description: OK - '202': - description: Accepted - statusCallback: - '{statusCallbackUrl}': - post: - requestBody: - required: true - description: >- -

This Outbound Message Webhook is an envelope containing status - information regarding a message sent (MT) - - from your message-enabled Bandwidth telephone number. -

The payload type will be one of message-sending, message-delivered, message-failed or message-read. -

Note that message-read callbacks are pertinent only for RBM messages sent from the /messages/multiChannel endpoint. -

Please visit Webhooks

- content: - application/json: - schema: - $ref: '#/components/schemas/statusCallback' - examples: - messageSendingCallback: - $ref: '#/components/examples/messageSendingCallbackExample' - smsMessageDeliveredCallback: - $ref: '#/components/examples/smsMessageDeliveredCallbackExample' - mmsMessageDeliveredCallback: - $ref: '#/components/examples/mmsMessageDeliveredCallbackExample' - groupMmsMessageDeliveredCallback: - $ref: >- - #/components/examples/groupMmsMessageDeliveredCallbackExample - messageFailedCallback: - $ref: '#/components/examples/messageFailedCallbackExample' - responses: - '200': - description: OK - '202': - description: Accepted - tfVerificationStatus: - your_url.com/webhookService: - post: - summary: TFV status updates sent to customer's webhook URL. - description: >- - Unique webhook URL provided by customers to which Bandwidth sends a - POST request to notify customer regarding TFV status updates. - operationId: tfvRequest - parameters: - - description: >- - 64-character lowercase hexidecimal HMAC calculated with a shared - secret key, the canonicalized request body, and SHA256. It is - only included when a shared secret key is set through webhook - subscription. - example: ca7b9e9816c90d336f5dca529e733354b81535c7af027b81878ac98afb2dbaa2 - in: header - name: x-bandwidth-signature-hmac-sha256 - schema: - type: string - requestBody: - $ref: '#/components/requestBodies/verificationWebhookRequest' - responses: - '204': - $ref: '#/components/responses/noContentResponse' - '400': - $ref: '#/components/responses/tfvBadRequestResponse' - '401': - $ref: '#/components/responses/tfvUnauthorizedResponse' - '403': - $ref: '#/components/responses/tfvForbiddenResponse' - '404': - $ref: '#/components/responses/tfvNotFoundResponse' - '405': - $ref: '#/components/responses/tfvNotAllowedResponse' - '429': - $ref: '#/components/responses/tfvTooManyRequestsResponse' - '500': - $ref: '#/components/responses/tfvServerErrorResponse' - '503': - $ref: '#/components/responses/tfvServiceUnavailableResponse' diff --git a/bandwidth.yml b/bandwidth.yml new file mode 120000 index 00000000..1cd9c74a --- /dev/null +++ b/bandwidth.yml @@ -0,0 +1 @@ +/Users/smoghe/Documents/api-specs-combine-action/api-specs/bandwidth.yml \ No newline at end of file diff --git a/docs/CreateEndpointRequestBase.md b/docs/CreateEndpointRequestBase.md new file mode 100644 index 00000000..63c36223 --- /dev/null +++ b/docs/CreateEndpointRequestBase.md @@ -0,0 +1,17 @@ + + +# CreateEndpointRequestBase + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**type** | **EndpointTypeEnum** | | | +|**direction** | **EndpointDirectionEnum** | | | +|**eventCallbackUrl** | **URI** | The URL to send event callbacks to. | [optional] | +|**eventFallbackUrl** | **URI** | The URL to send event fallbacks to. | [optional] | +|**tag** | **String** | A tag for the endpoint. | [optional] | + + + diff --git a/docs/CreateEndpointResponse.md b/docs/CreateEndpointResponse.md new file mode 100644 index 00000000..aff840ea --- /dev/null +++ b/docs/CreateEndpointResponse.md @@ -0,0 +1,15 @@ + + +# CreateEndpointResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**links** | [**List<Link1>**](Link1.md) | | | +|**data** | [**CreateEndpointResponseObject**](CreateEndpointResponseObject.md) | | | +|**errors** | [**List<Error1>**](Error1.md) | | | + + + diff --git a/docs/CreateEndpointResponseObject.md b/docs/CreateEndpointResponseObject.md new file mode 100644 index 00000000..4506e590 --- /dev/null +++ b/docs/CreateEndpointResponseObject.md @@ -0,0 +1,20 @@ + + +# CreateEndpointResponseObject + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**endpointId** | **String** | The unique ID of the endpoint. | | +|**type** | **EndpointTypeEnum** | | | +|**status** | **EndpointStatusEnum** | | | +|**creationTimestamp** | **OffsetDateTime** | The time the endpoint was created. In ISO-8601 format. | | +|**expirationTimestamp** | **OffsetDateTime** | The time the endpoint token will expire. In ISO-8601 format. Tokens last 24 hours. | | +|**tag** | **String** | A tag for the endpoint. | [optional] | +|**devices** | [**List<Device>**](Device.md) | | [optional] | +|**token** | **String** | The json web token specific to the endpoint. Used to authenticate the client with the media gateway. | | + + + diff --git a/docs/CreateWebRtcConnectionRequest.md b/docs/CreateWebRtcConnectionRequest.md new file mode 100644 index 00000000..70c3da9e --- /dev/null +++ b/docs/CreateWebRtcConnectionRequest.md @@ -0,0 +1,18 @@ + + +# CreateWebRtcConnectionRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**type** | **EndpointTypeEnum** | | | +|**direction** | **EndpointDirectionEnum** | | | +|**eventCallbackUrl** | **URI** | The URL to send event callbacks to. | [optional] | +|**eventFallbackUrl** | **URI** | The URL to send event fallbacks to. | [optional] | +|**tag** | **String** | A tag for the endpoint. | [optional] | +|**connectionMetadata** | **Object** | | [optional] | + + + diff --git a/docs/Device.md b/docs/Device.md new file mode 100644 index 00000000..f3480867 --- /dev/null +++ b/docs/Device.md @@ -0,0 +1,16 @@ + + +# Device + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**deviceId** | **String** | The unique ID of the device. | | +|**deviceName** | **String** | The name of the device. | [optional] | +|**status** | **DeviceStatusEnum** | | | +|**creationTimestamp** | **OffsetDateTime** | The time the device was created. In ISO-8601 format. | | + + + diff --git a/docs/DeviceStatusEnum.md b/docs/DeviceStatusEnum.md new file mode 100644 index 00000000..555f3745 --- /dev/null +++ b/docs/DeviceStatusEnum.md @@ -0,0 +1,13 @@ + + +# DeviceStatusEnum + +## Enum + + +* `CONNECTED` (value: `"CONNECTED"`) + +* `DISCONNECTED` (value: `"DISCONNECTED"`) + + + diff --git a/docs/Endpoint.md b/docs/Endpoint.md new file mode 100644 index 00000000..645088d7 --- /dev/null +++ b/docs/Endpoint.md @@ -0,0 +1,19 @@ + + +# Endpoint + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**endpointId** | **String** | The unique ID of the endpoint. | | +|**type** | **EndpointTypeEnum** | | | +|**status** | **EndpointStatusEnum** | | | +|**creationTimestamp** | **OffsetDateTime** | The time the endpoint was created. In ISO-8601 format. | | +|**expirationTimestamp** | **OffsetDateTime** | The time the endpoint token will expire. In ISO-8601 format. Tokens last 24 hours. | | +|**tag** | **String** | A tag for the endpoint. | [optional] | +|**devices** | [**List<Device>**](Device.md) | | [optional] | + + + diff --git a/docs/EndpointDirectionEnum.md b/docs/EndpointDirectionEnum.md new file mode 100644 index 00000000..1e74e06e --- /dev/null +++ b/docs/EndpointDirectionEnum.md @@ -0,0 +1,15 @@ + + +# EndpointDirectionEnum + +## Enum + + +* `INBOUND` (value: `"INBOUND"`) + +* `OUTBOUND` (value: `"OUTBOUND"`) + +* `BIDIRECTIONAL` (value: `"BIDIRECTIONAL"`) + + + diff --git a/docs/EndpointEvent.md b/docs/EndpointEvent.md new file mode 100644 index 00000000..5c844cb0 --- /dev/null +++ b/docs/EndpointEvent.md @@ -0,0 +1,22 @@ + + +# EndpointEvent + +An event that occurred on an endpoint. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**endpointId** | **String** | The unique ID of the endpoint. | | +|**type** | **EndpointTypeEnum** | | | +|**status** | **EndpointStatusEnum** | | | +|**creationTimestamp** | **OffsetDateTime** | The time the endpoint was created. In ISO-8601 format. | | +|**expirationTimestamp** | **OffsetDateTime** | The time the endpoint token will expire. In ISO-8601 format. Tokens last 24 hours. | | +|**tag** | **String** | A tag for the endpoint. | [optional] | +|**eventTime** | **OffsetDateTime** | The time the event occurred. In ISO-8601 format. | | +|**eventType** | **EndpointEventTypeEnum** | | | +|**device** | [**Device**](Device.md) | | [optional] | + + + diff --git a/docs/EndpointEventTypeEnum.md b/docs/EndpointEventTypeEnum.md new file mode 100644 index 00000000..c2aedec7 --- /dev/null +++ b/docs/EndpointEventTypeEnum.md @@ -0,0 +1,13 @@ + + +# EndpointEventTypeEnum + +## Enum + + +* `DEVICE_CONNECTED` (value: `"DEVICE_CONNECTED"`) + +* `DEVICE_DISCONNECTED` (value: `"DEVICE_DISCONNECTED"`) + + + diff --git a/docs/EndpointResponse.md b/docs/EndpointResponse.md new file mode 100644 index 00000000..d5615e9c --- /dev/null +++ b/docs/EndpointResponse.md @@ -0,0 +1,15 @@ + + +# EndpointResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**links** | [**List<Link1>**](Link1.md) | | | +|**data** | [**Endpoint**](Endpoint.md) | | | +|**errors** | [**List<Error1>**](Error1.md) | | | + + + diff --git a/docs/EndpointStatusEnum.md b/docs/EndpointStatusEnum.md new file mode 100644 index 00000000..49744c9a --- /dev/null +++ b/docs/EndpointStatusEnum.md @@ -0,0 +1,13 @@ + + +# EndpointStatusEnum + +## Enum + + +* `CONNECTED` (value: `"CONNECTED"`) + +* `DISCONNECTED` (value: `"DISCONNECTED"`) + + + diff --git a/docs/EndpointTypeEnum.md b/docs/EndpointTypeEnum.md new file mode 100644 index 00000000..f4753aaa --- /dev/null +++ b/docs/EndpointTypeEnum.md @@ -0,0 +1,11 @@ + + +# EndpointTypeEnum + +## Enum + + +* `WEBRTC` (value: `"WEBRTC"`) + + + diff --git a/docs/Endpoints.md b/docs/Endpoints.md new file mode 100644 index 00000000..9f50cf22 --- /dev/null +++ b/docs/Endpoints.md @@ -0,0 +1,18 @@ + + +# Endpoints + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**endpointId** | **String** | The unique ID of the endpoint. | | +|**type** | **EndpointTypeEnum** | | | +|**status** | **EndpointStatusEnum** | | | +|**creationTimestamp** | **OffsetDateTime** | The time the endpoint was created. In ISO-8601 format. | | +|**expirationTimestamp** | **OffsetDateTime** | The time the endpoint token will expire. In ISO-8601 format. Tokens last 24 hours. | | +|**tag** | **String** | A tag for the endpoint. | [optional] | + + + diff --git a/docs/EndpointsApi.md b/docs/EndpointsApi.md new file mode 100644 index 00000000..e7fd945f --- /dev/null +++ b/docs/EndpointsApi.md @@ -0,0 +1,429 @@ +# EndpointsApi + +All URIs are relative to *http://localhost* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**createEndpoint**](EndpointsApi.md#createEndpoint) | **POST** /accounts/{accountId}/endpoints | Create Endpoint | +| [**deleteEndpoint**](EndpointsApi.md#deleteEndpoint) | **DELETE** /accounts/{accountId}/endpoints/{endpointId} | Delete Endpoint | +| [**getEndpoint**](EndpointsApi.md#getEndpoint) | **GET** /accounts/{accountId}/endpoints/{endpointId} | Get Endpoint | +| [**listEndpoints**](EndpointsApi.md#listEndpoints) | **GET** /accounts/{accountId}/endpoints | List Endpoints | +| [**updateEndpointBxml**](EndpointsApi.md#updateEndpointBxml) | **PUT** /accounts/{accountId}/endpoints/{endpointId}/bxml | Update Endpoint BXML | + + + +# **createEndpoint** +> CreateEndpointResponse createEndpoint(accountId, body) + +Create Endpoint + +Creates a new Endpoint for the specified account. + +### Example +```java +// Import classes: +import com.bandwidth.sdk.ApiClient; +import com.bandwidth.sdk.ApiException; +import com.bandwidth.sdk.Configuration; +import com.bandwidth.sdk.auth.*; +import com.bandwidth.sdk.models.*; +import com.bandwidth.sdk.api.EndpointsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + EndpointsApi apiInstance = new EndpointsApi(defaultClient); + String accountId = "5500123"; // String | Your Bandwidth Account ID. + CreateWebRtcConnectionRequest body = new CreateWebRtcConnectionRequest(); // CreateWebRtcConnectionRequest | + try { + CreateEndpointResponse result = apiInstance.createEndpoint(accountId, body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling EndpointsApi#createEndpoint"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **accountId** | **String**| Your Bandwidth Account ID. | | +| **body** | **CreateWebRtcConnectionRequest**| | | + +### Return type + +[**CreateEndpointResponse**](CreateEndpointResponse.md) + +### Authorization + +[Basic](../README.md#Basic), [OAuth2](../README.md#OAuth2) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **201** | Created | - | +| **400** | Bad Request | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **404** | Not Found | - | +| **405** | Method Not Allowed | - | +| **415** | Unsupported Media Type | - | +| **429** | Too Many Requests | - | +| **500** | Service Unavailable | - | + + +# **deleteEndpoint** +> deleteEndpoint(accountId, endpointId) + +Delete Endpoint + +Deletes the specified endpoint. If the endpoint is actively streaming media, the media stream will be terminated. + +### Example +```java +// Import classes: +import com.bandwidth.sdk.ApiClient; +import com.bandwidth.sdk.ApiException; +import com.bandwidth.sdk.Configuration; +import com.bandwidth.sdk.auth.*; +import com.bandwidth.sdk.models.*; +import com.bandwidth.sdk.api.EndpointsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + EndpointsApi apiInstance = new EndpointsApi(defaultClient); + String accountId = "5500123"; // String | Your Bandwidth Account ID. + String endpointId = "e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85"; // String | BRTC Endpoint ID. + try { + apiInstance.deleteEndpoint(accountId, endpointId); + } catch (ApiException e) { + System.err.println("Exception when calling EndpointsApi#deleteEndpoint"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **accountId** | **String**| Your Bandwidth Account ID. | | +| **endpointId** | **String**| BRTC Endpoint ID. | | + +### Return type + +null (empty response body) + +### Authorization + +[Basic](../README.md#Basic), [OAuth2](../README.md#OAuth2) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | No Content | - | +| **400** | Bad Request | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **404** | Not Found | - | +| **405** | Method Not Allowed | - | +| **415** | Unsupported Media Type | - | +| **429** | Too Many Requests | - | +| **500** | Service Unavailable | - | + + +# **getEndpoint** +> EndpointResponse getEndpoint(accountId, endpointId) + +Get Endpoint + +Returns information about the specified endpoint. + +### Example +```java +// Import classes: +import com.bandwidth.sdk.ApiClient; +import com.bandwidth.sdk.ApiException; +import com.bandwidth.sdk.Configuration; +import com.bandwidth.sdk.auth.*; +import com.bandwidth.sdk.models.*; +import com.bandwidth.sdk.api.EndpointsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + EndpointsApi apiInstance = new EndpointsApi(defaultClient); + String accountId = "5500123"; // String | Your Bandwidth Account ID. + String endpointId = "e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85"; // String | BRTC Endpoint ID. + try { + EndpointResponse result = apiInstance.getEndpoint(accountId, endpointId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling EndpointsApi#getEndpoint"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **accountId** | **String**| Your Bandwidth Account ID. | | +| **endpointId** | **String**| BRTC Endpoint ID. | | + +### Return type + +[**EndpointResponse**](EndpointResponse.md) + +### Authorization + +[Basic](../README.md#Basic), [OAuth2](../README.md#OAuth2) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **400** | Bad Request | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **404** | Not Found | - | +| **405** | Method Not Allowed | - | +| **415** | Unsupported Media Type | - | +| **429** | Too Many Requests | - | +| **500** | Service Unavailable | - | + + +# **listEndpoints** +> ListEndpointsResponse listEndpoints(accountId, type, status, afterCursor, limit) + +List Endpoints + +Returns a list of endpoints associated with the specified account. + +### Example +```java +// Import classes: +import com.bandwidth.sdk.ApiClient; +import com.bandwidth.sdk.ApiException; +import com.bandwidth.sdk.Configuration; +import com.bandwidth.sdk.auth.*; +import com.bandwidth.sdk.models.*; +import com.bandwidth.sdk.api.EndpointsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + EndpointsApi apiInstance = new EndpointsApi(defaultClient); + String accountId = "5500123"; // String | Your Bandwidth Account ID. + EndpointTypeEnum type = EndpointTypeEnum.fromValue("WEBRTC"); // EndpointTypeEnum | The type of endpoint. + EndpointStatusEnum status = EndpointStatusEnum.fromValue("CONNECTED"); // EndpointStatusEnum | The status of the endpoint. + String afterCursor = "TWF5IHRoZSBmb3JjZSBiZSB3aXRoIHlvdQ=="; // String | The cursor to use for pagination. This is the value of the `next` link in the previous response. + Integer limit = 100; // Integer | The maximum number of endpoints to return in the response. + try { + ListEndpointsResponse result = apiInstance.listEndpoints(accountId, type, status, afterCursor, limit); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling EndpointsApi#listEndpoints"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **accountId** | **String**| Your Bandwidth Account ID. | | +| **type** | [**EndpointTypeEnum**](.md)| The type of endpoint. | [optional] [enum: WEBRTC] | +| **status** | [**EndpointStatusEnum**](.md)| The status of the endpoint. | [optional] [enum: CONNECTED, DISCONNECTED] | +| **afterCursor** | **String**| The cursor to use for pagination. This is the value of the `next` link in the previous response. | [optional] | +| **limit** | **Integer**| The maximum number of endpoints to return in the response. | [optional] [default to 100] | + +### Return type + +[**ListEndpointsResponse**](ListEndpointsResponse.md) + +### Authorization + +[Basic](../README.md#Basic), [OAuth2](../README.md#OAuth2) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **400** | Bad Request | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **404** | Not Found | - | +| **405** | Method Not Allowed | - | +| **415** | Unsupported Media Type | - | +| **429** | Too Many Requests | - | +| **500** | Service Unavailable | - | + + +# **updateEndpointBxml** +> updateEndpointBxml(accountId, endpointId, body) + +Update Endpoint BXML + +Updates the BXML for the specified endpoint. + +### Example +```java +// Import classes: +import com.bandwidth.sdk.ApiClient; +import com.bandwidth.sdk.ApiException; +import com.bandwidth.sdk.Configuration; +import com.bandwidth.sdk.auth.*; +import com.bandwidth.sdk.models.*; +import com.bandwidth.sdk.api.EndpointsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + // Configure OAuth2 access token for authorization: OAuth2 + OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); + OAuth2.setAccessToken("YOUR ACCESS TOKEN"); + + EndpointsApi apiInstance = new EndpointsApi(defaultClient); + String accountId = "5500123"; // String | Your Bandwidth Account ID. + String endpointId = "e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85"; // String | BRTC Endpoint ID. + String body = "body_example"; // String | + try { + apiInstance.updateEndpointBxml(accountId, endpointId, body); + } catch (ApiException e) { + System.err.println("Exception when calling EndpointsApi#updateEndpointBxml"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **accountId** | **String**| Your Bandwidth Account ID. | | +| **endpointId** | **String**| BRTC Endpoint ID. | | +| **body** | **String**| | | + +### Return type + +null (empty response body) + +### Authorization + +[Basic](../README.md#Basic), [OAuth2](../README.md#OAuth2) + +### HTTP request headers + + - **Content-Type**: application/xml + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | No Content | - | +| **400** | Bad Request | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **404** | Not Found | - | +| **405** | Method Not Allowed | - | +| **415** | Unsupported Media Type | - | +| **429** | Too Many Requests | - | +| **500** | Service Unavailable | - | + diff --git a/docs/Error1.md b/docs/Error1.md new file mode 100644 index 00000000..60b9f5a6 --- /dev/null +++ b/docs/Error1.md @@ -0,0 +1,17 @@ + + +# Error1 + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **UUID** | A unique identifier for the error. | | +|**type** | **String** | The type of error. | | +|**description** | **String** | A description of the error. | | +|**code** | **String** | A code that uniquely identifies the error. | | +|**source** | [**Error1Source**](Error1Source.md) | | [optional] | + + + diff --git a/docs/Error1Source.md b/docs/Error1Source.md new file mode 100644 index 00000000..4665f119 --- /dev/null +++ b/docs/Error1Source.md @@ -0,0 +1,16 @@ + + +# Error1Source + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**parameter** | **String** | The URI parameter that caused the error. | [optional] | +|**field** | **String** | The request body field that caused the error. | [optional] | +|**header** | **String** | The header that caused the error. | [optional] | +|**reference** | **String** | The resource ID or path to the resource (or non-existent resource) causing the error. | [optional] | + + + diff --git a/docs/ErrorResponse.md b/docs/ErrorResponse.md new file mode 100644 index 00000000..fa7cb478 --- /dev/null +++ b/docs/ErrorResponse.md @@ -0,0 +1,15 @@ + + +# ErrorResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**links** | [**List<Link1>**](Link1.md) | | | +|**data** | **Object** | | | +|**errors** | [**List<Error1>**](Error1.md) | | | + + + diff --git a/docs/Link1.md b/docs/Link1.md new file mode 100644 index 00000000..e2023ab1 --- /dev/null +++ b/docs/Link1.md @@ -0,0 +1,25 @@ + + +# Link1 + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**href** | **String** | The full URL of the link. | [optional] | +|**rel** | **String** | The relationship of the link to the current resource. | [optional] | +|**method** | [**MethodEnum**](#MethodEnum) | The HTTP method to use when making the request. | [optional] | + + + +## Enum: MethodEnum + +| Name | Value | +|---- | -----| +| GET | "GET" | +| POST | "POST" | +| DELETE | "DELETE" | + + + diff --git a/docs/ListEndpointsResponse.md b/docs/ListEndpointsResponse.md new file mode 100644 index 00000000..cefcc63e --- /dev/null +++ b/docs/ListEndpointsResponse.md @@ -0,0 +1,16 @@ + + +# ListEndpointsResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**links** | [**List<Link1>**](Link1.md) | | | +|**page** | [**Page**](Page.md) | | [optional] | +|**data** | [**List<Endpoints>**](Endpoints.md) | | | +|**errors** | [**List<Error1>**](Error1.md) | | | + + + diff --git a/docs/Page.md b/docs/Page.md new file mode 100644 index 00000000..f3b73f37 --- /dev/null +++ b/docs/Page.md @@ -0,0 +1,16 @@ + + +# Page + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**pageSize** | **Integer** | The number of items per page. | | +|**totalElements** | **Integer** | The total number of items. | [optional] | +|**totalPages** | **Integer** | The total number of pages. | [optional] | +|**pageNumber** | **Integer** | The current page number. | [optional] | + + + diff --git a/docs/SipConnectionMetadata.md b/docs/SipConnectionMetadata.md new file mode 100644 index 00000000..80eae945 --- /dev/null +++ b/docs/SipConnectionMetadata.md @@ -0,0 +1,16 @@ + + +# SipConnectionMetadata + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**ipAddress** | **String** | The IP address of the SIP connection. | [optional] | +|**port** | **Integer** | The port of the SIP connection. | [optional] | +|**credentials** | [**SipCredentials**](SipCredentials.md) | | [optional] | +|**uuiHeader** | **String** | The User-to-User Information header for the SIP connection. | [optional] | + + + diff --git a/docs/SipCredentials.md b/docs/SipCredentials.md new file mode 100644 index 00000000..6b73c986 --- /dev/null +++ b/docs/SipCredentials.md @@ -0,0 +1,14 @@ + + +# SipCredentials + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**username** | **String** | The username for the SIP connection. | [optional] | +|**password** | **String** | The password for the SIP connection. | [optional] | + + + diff --git a/src/main/java/com/bandwidth/sdk/JSON.java b/src/main/java/com/bandwidth/sdk/JSON.java index 518e07dd..6d3b3e5c 100644 --- a/src/main/java/com/bandwidth/sdk/JSON.java +++ b/src/main/java/com/bandwidth/sdk/JSON.java @@ -180,15 +180,27 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new com.bandwidth.sdk.model.CreateAsyncBulkLookupResponseData.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.bandwidth.sdk.model.CreateCall.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.bandwidth.sdk.model.CreateCallResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.bandwidth.sdk.model.CreateEndpointRequestBase.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.bandwidth.sdk.model.CreateEndpointResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.bandwidth.sdk.model.CreateEndpointResponseObject.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.bandwidth.sdk.model.CreateMessageRequestError.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.bandwidth.sdk.model.CreateMultiChannelMessageResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.bandwidth.sdk.model.CreateSyncLookupResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.bandwidth.sdk.model.CreateSyncLookupResponseData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.bandwidth.sdk.model.CreateWebRtcConnectionRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.bandwidth.sdk.model.Device.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.bandwidth.sdk.model.DisconnectCallback.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.bandwidth.sdk.model.Diversion.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.bandwidth.sdk.model.DtmfCallback.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.bandwidth.sdk.model.Endpoint.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.bandwidth.sdk.model.EndpointEvent.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.bandwidth.sdk.model.EndpointResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.bandwidth.sdk.model.Endpoints.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.bandwidth.sdk.model.Error.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.bandwidth.sdk.model.Error1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.bandwidth.sdk.model.Error1Source.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.bandwidth.sdk.model.ErrorObject.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.bandwidth.sdk.model.ErrorResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.bandwidth.sdk.model.ErrorSource.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.bandwidth.sdk.model.FailureWebhook.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.bandwidth.sdk.model.FieldError.CustomTypeAdapterFactory()); @@ -199,8 +211,10 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new com.bandwidth.sdk.model.InboundCallbackMessage.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.bandwidth.sdk.model.InitiateCallback.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.bandwidth.sdk.model.Link.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.bandwidth.sdk.model.Link1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.bandwidth.sdk.model.LinkSchema.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.bandwidth.sdk.model.LinksObject.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.bandwidth.sdk.model.ListEndpointsResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.bandwidth.sdk.model.ListMessageItem.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.bandwidth.sdk.model.LookupErrorResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.bandwidth.sdk.model.LookupErrorSchema.CustomTypeAdapterFactory()); @@ -238,6 +252,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new com.bandwidth.sdk.model.MultiChannelMessageRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.bandwidth.sdk.model.MultiChannelMessageResponseData.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.bandwidth.sdk.model.OptInWorkflow.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.bandwidth.sdk.model.Page.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.bandwidth.sdk.model.PageInfo.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.bandwidth.sdk.model.RbmActionBase.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.bandwidth.sdk.model.RbmActionDial.CustomTypeAdapterFactory()); @@ -258,6 +273,8 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new com.bandwidth.sdk.model.RecordingTranscriptionMetadata.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.bandwidth.sdk.model.RecordingTranscriptions.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.bandwidth.sdk.model.RedirectCallback.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.bandwidth.sdk.model.SipConnectionMetadata.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.bandwidth.sdk.model.SipCredentials.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.bandwidth.sdk.model.SmsMessageContent.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.bandwidth.sdk.model.StatusCallback.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.bandwidth.sdk.model.StatusCallbackMessage.CustomTypeAdapterFactory()); diff --git a/src/main/java/com/bandwidth/sdk/api/EndpointsApi.java b/src/main/java/com/bandwidth/sdk/api/EndpointsApi.java new file mode 100644 index 00000000..807ba1ce --- /dev/null +++ b/src/main/java/com/bandwidth/sdk/api/EndpointsApi.java @@ -0,0 +1,950 @@ +/* + * Bandwidth + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.bandwidth.sdk.api; + +import com.bandwidth.sdk.ApiCallback; +import com.bandwidth.sdk.ApiClient; +import com.bandwidth.sdk.ApiException; +import com.bandwidth.sdk.ApiResponse; +import com.bandwidth.sdk.Configuration; +import com.bandwidth.sdk.Pair; +import com.bandwidth.sdk.ProgressRequestBody; +import com.bandwidth.sdk.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.bandwidth.sdk.model.CreateEndpointResponse; +import com.bandwidth.sdk.model.CreateWebRtcConnectionRequest; +import com.bandwidth.sdk.model.EndpointResponse; +import com.bandwidth.sdk.model.EndpointStatusEnum; +import com.bandwidth.sdk.model.EndpointTypeEnum; +import com.bandwidth.sdk.model.ErrorResponse; +import com.bandwidth.sdk.model.ListEndpointsResponse; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class EndpointsApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public EndpointsApi() { + this(Configuration.getDefaultApiClient()); + } + + public EndpointsApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for createEndpoint + * @param accountId Your Bandwidth Account ID. (required) + * @param body (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + + + + + +
Response Details
Status Code Description Response Headers
201 Created -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
405 Method Not Allowed -
415 Unsupported Media Type -
429 Too Many Requests -
500 Service Unavailable -
+ */ + public okhttp3.Call createEndpointCall(@javax.annotation.Nonnull String accountId, @javax.annotation.Nonnull CreateWebRtcConnectionRequest body, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { "https://api.bandwidth.com/v2" }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/accounts/{accountId}/endpoints" + .replace("{" + "accountId" + "}", localVarApiClient.escapeString(accountId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic", "OAuth2" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createEndpointValidateBeforeCall(@javax.annotation.Nonnull String accountId, @javax.annotation.Nonnull CreateWebRtcConnectionRequest body, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'accountId' is set + if (accountId == null) { + throw new ApiException("Missing the required parameter 'accountId' when calling createEndpoint(Async)"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException("Missing the required parameter 'body' when calling createEndpoint(Async)"); + } + + return createEndpointCall(accountId, body, _callback); + + } + + /** + * Create Endpoint + * Creates a new Endpoint for the specified account. + * @param accountId Your Bandwidth Account ID. (required) + * @param body (required) + * @return CreateEndpointResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + + + + + +
Response Details
Status Code Description Response Headers
201 Created -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
405 Method Not Allowed -
415 Unsupported Media Type -
429 Too Many Requests -
500 Service Unavailable -
+ */ + public CreateEndpointResponse createEndpoint(@javax.annotation.Nonnull String accountId, @javax.annotation.Nonnull CreateWebRtcConnectionRequest body) throws ApiException { + ApiResponse localVarResp = createEndpointWithHttpInfo(accountId, body); + return localVarResp.getData(); + } + + /** + * Create Endpoint + * Creates a new Endpoint for the specified account. + * @param accountId Your Bandwidth Account ID. (required) + * @param body (required) + * @return ApiResponse<CreateEndpointResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + + + + + +
Response Details
Status Code Description Response Headers
201 Created -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
405 Method Not Allowed -
415 Unsupported Media Type -
429 Too Many Requests -
500 Service Unavailable -
+ */ + public ApiResponse createEndpointWithHttpInfo(@javax.annotation.Nonnull String accountId, @javax.annotation.Nonnull CreateWebRtcConnectionRequest body) throws ApiException { + okhttp3.Call localVarCall = createEndpointValidateBeforeCall(accountId, body, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Create Endpoint (asynchronously) + * Creates a new Endpoint for the specified account. + * @param accountId Your Bandwidth Account ID. (required) + * @param body (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + + + + + + +
Response Details
Status Code Description Response Headers
201 Created -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
405 Method Not Allowed -
415 Unsupported Media Type -
429 Too Many Requests -
500 Service Unavailable -
+ */ + public okhttp3.Call createEndpointAsync(@javax.annotation.Nonnull String accountId, @javax.annotation.Nonnull CreateWebRtcConnectionRequest body, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = createEndpointValidateBeforeCall(accountId, body, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for deleteEndpoint + * @param accountId Your Bandwidth Account ID. (required) + * @param endpointId BRTC Endpoint ID. (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + + + + + +
Response Details
Status Code Description Response Headers
204 No Content -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
405 Method Not Allowed -
415 Unsupported Media Type -
429 Too Many Requests -
500 Service Unavailable -
+ */ + public okhttp3.Call deleteEndpointCall(@javax.annotation.Nonnull String accountId, @javax.annotation.Nonnull String endpointId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { "https://api.bandwidth.com/v2" }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/accounts/{accountId}/endpoints/{endpointId}" + .replace("{" + "accountId" + "}", localVarApiClient.escapeString(accountId.toString())) + .replace("{" + "endpointId" + "}", localVarApiClient.escapeString(endpointId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic", "OAuth2" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteEndpointValidateBeforeCall(@javax.annotation.Nonnull String accountId, @javax.annotation.Nonnull String endpointId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'accountId' is set + if (accountId == null) { + throw new ApiException("Missing the required parameter 'accountId' when calling deleteEndpoint(Async)"); + } + + // verify the required parameter 'endpointId' is set + if (endpointId == null) { + throw new ApiException("Missing the required parameter 'endpointId' when calling deleteEndpoint(Async)"); + } + + return deleteEndpointCall(accountId, endpointId, _callback); + + } + + /** + * Delete Endpoint + * Deletes the specified endpoint. If the endpoint is actively streaming media, the media stream will be terminated. + * @param accountId Your Bandwidth Account ID. (required) + * @param endpointId BRTC Endpoint ID. (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + + + + + +
Response Details
Status Code Description Response Headers
204 No Content -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
405 Method Not Allowed -
415 Unsupported Media Type -
429 Too Many Requests -
500 Service Unavailable -
+ */ + public void deleteEndpoint(@javax.annotation.Nonnull String accountId, @javax.annotation.Nonnull String endpointId) throws ApiException { + deleteEndpointWithHttpInfo(accountId, endpointId); + } + + /** + * Delete Endpoint + * Deletes the specified endpoint. If the endpoint is actively streaming media, the media stream will be terminated. + * @param accountId Your Bandwidth Account ID. (required) + * @param endpointId BRTC Endpoint ID. (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + + + + + +
Response Details
Status Code Description Response Headers
204 No Content -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
405 Method Not Allowed -
415 Unsupported Media Type -
429 Too Many Requests -
500 Service Unavailable -
+ */ + public ApiResponse deleteEndpointWithHttpInfo(@javax.annotation.Nonnull String accountId, @javax.annotation.Nonnull String endpointId) throws ApiException { + okhttp3.Call localVarCall = deleteEndpointValidateBeforeCall(accountId, endpointId, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Delete Endpoint (asynchronously) + * Deletes the specified endpoint. If the endpoint is actively streaming media, the media stream will be terminated. + * @param accountId Your Bandwidth Account ID. (required) + * @param endpointId BRTC Endpoint ID. (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + + + + + + +
Response Details
Status Code Description Response Headers
204 No Content -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
405 Method Not Allowed -
415 Unsupported Media Type -
429 Too Many Requests -
500 Service Unavailable -
+ */ + public okhttp3.Call deleteEndpointAsync(@javax.annotation.Nonnull String accountId, @javax.annotation.Nonnull String endpointId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteEndpointValidateBeforeCall(accountId, endpointId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for getEndpoint + * @param accountId Your Bandwidth Account ID. (required) + * @param endpointId BRTC Endpoint ID. (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + + + + + +
Response Details
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
405 Method Not Allowed -
415 Unsupported Media Type -
429 Too Many Requests -
500 Service Unavailable -
+ */ + public okhttp3.Call getEndpointCall(@javax.annotation.Nonnull String accountId, @javax.annotation.Nonnull String endpointId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { "https://api.bandwidth.com/v2" }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/accounts/{accountId}/endpoints/{endpointId}" + .replace("{" + "accountId" + "}", localVarApiClient.escapeString(accountId.toString())) + .replace("{" + "endpointId" + "}", localVarApiClient.escapeString(endpointId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic", "OAuth2" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getEndpointValidateBeforeCall(@javax.annotation.Nonnull String accountId, @javax.annotation.Nonnull String endpointId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'accountId' is set + if (accountId == null) { + throw new ApiException("Missing the required parameter 'accountId' when calling getEndpoint(Async)"); + } + + // verify the required parameter 'endpointId' is set + if (endpointId == null) { + throw new ApiException("Missing the required parameter 'endpointId' when calling getEndpoint(Async)"); + } + + return getEndpointCall(accountId, endpointId, _callback); + + } + + /** + * Get Endpoint + * Returns information about the specified endpoint. + * @param accountId Your Bandwidth Account ID. (required) + * @param endpointId BRTC Endpoint ID. (required) + * @return EndpointResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + + + + + +
Response Details
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
405 Method Not Allowed -
415 Unsupported Media Type -
429 Too Many Requests -
500 Service Unavailable -
+ */ + public EndpointResponse getEndpoint(@javax.annotation.Nonnull String accountId, @javax.annotation.Nonnull String endpointId) throws ApiException { + ApiResponse localVarResp = getEndpointWithHttpInfo(accountId, endpointId); + return localVarResp.getData(); + } + + /** + * Get Endpoint + * Returns information about the specified endpoint. + * @param accountId Your Bandwidth Account ID. (required) + * @param endpointId BRTC Endpoint ID. (required) + * @return ApiResponse<EndpointResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + + + + + +
Response Details
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
405 Method Not Allowed -
415 Unsupported Media Type -
429 Too Many Requests -
500 Service Unavailable -
+ */ + public ApiResponse getEndpointWithHttpInfo(@javax.annotation.Nonnull String accountId, @javax.annotation.Nonnull String endpointId) throws ApiException { + okhttp3.Call localVarCall = getEndpointValidateBeforeCall(accountId, endpointId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get Endpoint (asynchronously) + * Returns information about the specified endpoint. + * @param accountId Your Bandwidth Account ID. (required) + * @param endpointId BRTC Endpoint ID. (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + + + + + + +
Response Details
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
405 Method Not Allowed -
415 Unsupported Media Type -
429 Too Many Requests -
500 Service Unavailable -
+ */ + public okhttp3.Call getEndpointAsync(@javax.annotation.Nonnull String accountId, @javax.annotation.Nonnull String endpointId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getEndpointValidateBeforeCall(accountId, endpointId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for listEndpoints + * @param accountId Your Bandwidth Account ID. (required) + * @param type The type of endpoint. (optional) + * @param status The status of the endpoint. (optional) + * @param afterCursor The cursor to use for pagination. This is the value of the `next` link in the previous response. (optional) + * @param limit The maximum number of endpoints to return in the response. (optional, default to 100) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + + + + + +
Response Details
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
405 Method Not Allowed -
415 Unsupported Media Type -
429 Too Many Requests -
500 Service Unavailable -
+ */ + public okhttp3.Call listEndpointsCall(@javax.annotation.Nonnull String accountId, @javax.annotation.Nullable EndpointTypeEnum type, @javax.annotation.Nullable EndpointStatusEnum status, @javax.annotation.Nullable String afterCursor, @javax.annotation.Nullable Integer limit, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { "https://api.bandwidth.com/v2" }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/accounts/{accountId}/endpoints" + .replace("{" + "accountId" + "}", localVarApiClient.escapeString(accountId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (type != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("type", type)); + } + + if (status != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("status", status)); + } + + if (afterCursor != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("afterCursor", afterCursor)); + } + + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic", "OAuth2" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listEndpointsValidateBeforeCall(@javax.annotation.Nonnull String accountId, @javax.annotation.Nullable EndpointTypeEnum type, @javax.annotation.Nullable EndpointStatusEnum status, @javax.annotation.Nullable String afterCursor, @javax.annotation.Nullable Integer limit, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'accountId' is set + if (accountId == null) { + throw new ApiException("Missing the required parameter 'accountId' when calling listEndpoints(Async)"); + } + + return listEndpointsCall(accountId, type, status, afterCursor, limit, _callback); + + } + + /** + * List Endpoints + * Returns a list of endpoints associated with the specified account. + * @param accountId Your Bandwidth Account ID. (required) + * @param type The type of endpoint. (optional) + * @param status The status of the endpoint. (optional) + * @param afterCursor The cursor to use for pagination. This is the value of the `next` link in the previous response. (optional) + * @param limit The maximum number of endpoints to return in the response. (optional, default to 100) + * @return ListEndpointsResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + + + + + +
Response Details
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
405 Method Not Allowed -
415 Unsupported Media Type -
429 Too Many Requests -
500 Service Unavailable -
+ */ + public ListEndpointsResponse listEndpoints(@javax.annotation.Nonnull String accountId, @javax.annotation.Nullable EndpointTypeEnum type, @javax.annotation.Nullable EndpointStatusEnum status, @javax.annotation.Nullable String afterCursor, @javax.annotation.Nullable Integer limit) throws ApiException { + ApiResponse localVarResp = listEndpointsWithHttpInfo(accountId, type, status, afterCursor, limit); + return localVarResp.getData(); + } + + /** + * List Endpoints + * Returns a list of endpoints associated with the specified account. + * @param accountId Your Bandwidth Account ID. (required) + * @param type The type of endpoint. (optional) + * @param status The status of the endpoint. (optional) + * @param afterCursor The cursor to use for pagination. This is the value of the `next` link in the previous response. (optional) + * @param limit The maximum number of endpoints to return in the response. (optional, default to 100) + * @return ApiResponse<ListEndpointsResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + + + + + +
Response Details
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
405 Method Not Allowed -
415 Unsupported Media Type -
429 Too Many Requests -
500 Service Unavailable -
+ */ + public ApiResponse listEndpointsWithHttpInfo(@javax.annotation.Nonnull String accountId, @javax.annotation.Nullable EndpointTypeEnum type, @javax.annotation.Nullable EndpointStatusEnum status, @javax.annotation.Nullable String afterCursor, @javax.annotation.Nullable Integer limit) throws ApiException { + okhttp3.Call localVarCall = listEndpointsValidateBeforeCall(accountId, type, status, afterCursor, limit, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List Endpoints (asynchronously) + * Returns a list of endpoints associated with the specified account. + * @param accountId Your Bandwidth Account ID. (required) + * @param type The type of endpoint. (optional) + * @param status The status of the endpoint. (optional) + * @param afterCursor The cursor to use for pagination. This is the value of the `next` link in the previous response. (optional) + * @param limit The maximum number of endpoints to return in the response. (optional, default to 100) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + + + + + + +
Response Details
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
405 Method Not Allowed -
415 Unsupported Media Type -
429 Too Many Requests -
500 Service Unavailable -
+ */ + public okhttp3.Call listEndpointsAsync(@javax.annotation.Nonnull String accountId, @javax.annotation.Nullable EndpointTypeEnum type, @javax.annotation.Nullable EndpointStatusEnum status, @javax.annotation.Nullable String afterCursor, @javax.annotation.Nullable Integer limit, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = listEndpointsValidateBeforeCall(accountId, type, status, afterCursor, limit, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for updateEndpointBxml + * @param accountId Your Bandwidth Account ID. (required) + * @param endpointId BRTC Endpoint ID. (required) + * @param body (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + + + + + +
Response Details
Status Code Description Response Headers
204 No Content -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
405 Method Not Allowed -
415 Unsupported Media Type -
429 Too Many Requests -
500 Service Unavailable -
+ */ + public okhttp3.Call updateEndpointBxmlCall(@javax.annotation.Nonnull String accountId, @javax.annotation.Nonnull String endpointId, @javax.annotation.Nonnull String body, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { "https://api.bandwidth.com/v2" }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/accounts/{accountId}/endpoints/{endpointId}/bxml" + .replace("{" + "accountId" + "}", localVarApiClient.escapeString(accountId.toString())) + .replace("{" + "endpointId" + "}", localVarApiClient.escapeString(endpointId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/xml" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic", "OAuth2" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateEndpointBxmlValidateBeforeCall(@javax.annotation.Nonnull String accountId, @javax.annotation.Nonnull String endpointId, @javax.annotation.Nonnull String body, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'accountId' is set + if (accountId == null) { + throw new ApiException("Missing the required parameter 'accountId' when calling updateEndpointBxml(Async)"); + } + + // verify the required parameter 'endpointId' is set + if (endpointId == null) { + throw new ApiException("Missing the required parameter 'endpointId' when calling updateEndpointBxml(Async)"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException("Missing the required parameter 'body' when calling updateEndpointBxml(Async)"); + } + + return updateEndpointBxmlCall(accountId, endpointId, body, _callback); + + } + + /** + * Update Endpoint BXML + * Updates the BXML for the specified endpoint. + * @param accountId Your Bandwidth Account ID. (required) + * @param endpointId BRTC Endpoint ID. (required) + * @param body (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + + + + + +
Response Details
Status Code Description Response Headers
204 No Content -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
405 Method Not Allowed -
415 Unsupported Media Type -
429 Too Many Requests -
500 Service Unavailable -
+ */ + public void updateEndpointBxml(@javax.annotation.Nonnull String accountId, @javax.annotation.Nonnull String endpointId, @javax.annotation.Nonnull String body) throws ApiException { + updateEndpointBxmlWithHttpInfo(accountId, endpointId, body); + } + + /** + * Update Endpoint BXML + * Updates the BXML for the specified endpoint. + * @param accountId Your Bandwidth Account ID. (required) + * @param endpointId BRTC Endpoint ID. (required) + * @param body (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + + + + + +
Response Details
Status Code Description Response Headers
204 No Content -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
405 Method Not Allowed -
415 Unsupported Media Type -
429 Too Many Requests -
500 Service Unavailable -
+ */ + public ApiResponse updateEndpointBxmlWithHttpInfo(@javax.annotation.Nonnull String accountId, @javax.annotation.Nonnull String endpointId, @javax.annotation.Nonnull String body) throws ApiException { + okhttp3.Call localVarCall = updateEndpointBxmlValidateBeforeCall(accountId, endpointId, body, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Update Endpoint BXML (asynchronously) + * Updates the BXML for the specified endpoint. + * @param accountId Your Bandwidth Account ID. (required) + * @param endpointId BRTC Endpoint ID. (required) + * @param body (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + + + + + + +
Response Details
Status Code Description Response Headers
204 No Content -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
405 Method Not Allowed -
415 Unsupported Media Type -
429 Too Many Requests -
500 Service Unavailable -
+ */ + public okhttp3.Call updateEndpointBxmlAsync(@javax.annotation.Nonnull String accountId, @javax.annotation.Nonnull String endpointId, @javax.annotation.Nonnull String body, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = updateEndpointBxmlValidateBeforeCall(accountId, endpointId, body, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/bandwidth/sdk/model/CreateEndpointRequestBase.java b/src/main/java/com/bandwidth/sdk/model/CreateEndpointRequestBase.java new file mode 100644 index 00000000..ad5a33fc --- /dev/null +++ b/src/main/java/com/bandwidth/sdk/model/CreateEndpointRequestBase.java @@ -0,0 +1,412 @@ +/* + * Bandwidth + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.bandwidth.sdk.model; + +import java.util.Objects; +import java.util.Locale; +import com.bandwidth.sdk.model.EndpointDirectionEnum; +import com.bandwidth.sdk.model.EndpointTypeEnum; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.net.URI; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Locale; + +import com.bandwidth.sdk.JSON; + +/** + * CreateEndpointRequestBase + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0") +public class CreateEndpointRequestBase { + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull + private EndpointTypeEnum type; + + public static final String SERIALIZED_NAME_DIRECTION = "direction"; + @SerializedName(SERIALIZED_NAME_DIRECTION) + @javax.annotation.Nonnull + private EndpointDirectionEnum direction; + + public static final String SERIALIZED_NAME_EVENT_CALLBACK_URL = "eventCallbackUrl"; + @SerializedName(SERIALIZED_NAME_EVENT_CALLBACK_URL) + @javax.annotation.Nullable + private URI eventCallbackUrl; + + public static final String SERIALIZED_NAME_EVENT_FALLBACK_URL = "eventFallbackUrl"; + @SerializedName(SERIALIZED_NAME_EVENT_FALLBACK_URL) + @javax.annotation.Nullable + private URI eventFallbackUrl; + + public static final String SERIALIZED_NAME_TAG = "tag"; + @SerializedName(SERIALIZED_NAME_TAG) + @javax.annotation.Nullable + private String tag; + + public CreateEndpointRequestBase() { + } + + public CreateEndpointRequestBase type(@javax.annotation.Nonnull EndpointTypeEnum type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nonnull + public EndpointTypeEnum getType() { + return type; + } + + public void setType(@javax.annotation.Nonnull EndpointTypeEnum type) { + this.type = type; + } + + + public CreateEndpointRequestBase direction(@javax.annotation.Nonnull EndpointDirectionEnum direction) { + this.direction = direction; + return this; + } + + /** + * Get direction + * @return direction + */ + @javax.annotation.Nonnull + public EndpointDirectionEnum getDirection() { + return direction; + } + + public void setDirection(@javax.annotation.Nonnull EndpointDirectionEnum direction) { + this.direction = direction; + } + + + public CreateEndpointRequestBase eventCallbackUrl(@javax.annotation.Nullable URI eventCallbackUrl) { + this.eventCallbackUrl = eventCallbackUrl; + return this; + } + + /** + * The URL to send event callbacks to. + * @return eventCallbackUrl + */ + @javax.annotation.Nullable + public URI getEventCallbackUrl() { + return eventCallbackUrl; + } + + public void setEventCallbackUrl(@javax.annotation.Nullable URI eventCallbackUrl) { + this.eventCallbackUrl = eventCallbackUrl; + } + + + public CreateEndpointRequestBase eventFallbackUrl(@javax.annotation.Nullable URI eventFallbackUrl) { + this.eventFallbackUrl = eventFallbackUrl; + return this; + } + + /** + * The URL to send event fallbacks to. + * @return eventFallbackUrl + */ + @javax.annotation.Nullable + public URI getEventFallbackUrl() { + return eventFallbackUrl; + } + + public void setEventFallbackUrl(@javax.annotation.Nullable URI eventFallbackUrl) { + this.eventFallbackUrl = eventFallbackUrl; + } + + + public CreateEndpointRequestBase tag(@javax.annotation.Nullable String tag) { + this.tag = tag; + return this; + } + + /** + * A tag for the endpoint. + * @return tag + */ + @javax.annotation.Nullable + public String getTag() { + return tag; + } + + public void setTag(@javax.annotation.Nullable String tag) { + this.tag = tag; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the CreateEndpointRequestBase instance itself + */ + public CreateEndpointRequestBase putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateEndpointRequestBase createEndpointRequestBase = (CreateEndpointRequestBase) o; + return Objects.equals(this.type, createEndpointRequestBase.type) && + Objects.equals(this.direction, createEndpointRequestBase.direction) && + Objects.equals(this.eventCallbackUrl, createEndpointRequestBase.eventCallbackUrl) && + Objects.equals(this.eventFallbackUrl, createEndpointRequestBase.eventFallbackUrl) && + Objects.equals(this.tag, createEndpointRequestBase.tag)&& + Objects.equals(this.additionalProperties, createEndpointRequestBase.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(type, direction, eventCallbackUrl, eventFallbackUrl, tag, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateEndpointRequestBase {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" direction: ").append(toIndentedString(direction)).append("\n"); + sb.append(" eventCallbackUrl: ").append(toIndentedString(eventCallbackUrl)).append("\n"); + sb.append(" eventFallbackUrl: ").append(toIndentedString(eventFallbackUrl)).append("\n"); + sb.append(" tag: ").append(toIndentedString(tag)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("type", "direction", "eventCallbackUrl", "eventFallbackUrl", "tag")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("type", "direction")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CreateEndpointRequestBase + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateEndpointRequestBase.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in CreateEndpointRequestBase is not found in the empty JSON string", CreateEndpointRequestBase.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateEndpointRequestBase.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `type` + EndpointTypeEnum.validateJsonElement(jsonObj.get("type")); + // validate the required field `direction` + EndpointDirectionEnum.validateJsonElement(jsonObj.get("direction")); + if ((jsonObj.get("eventCallbackUrl") != null && !jsonObj.get("eventCallbackUrl").isJsonNull()) && !jsonObj.get("eventCallbackUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `eventCallbackUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("eventCallbackUrl").toString())); + } + if ((jsonObj.get("eventFallbackUrl") != null && !jsonObj.get("eventFallbackUrl").isJsonNull()) && !jsonObj.get("eventFallbackUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `eventFallbackUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("eventFallbackUrl").toString())); + } + if ((jsonObj.get("tag") != null && !jsonObj.get("tag").isJsonNull()) && !jsonObj.get("tag").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `tag` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tag").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateEndpointRequestBase.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateEndpointRequestBase' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CreateEndpointRequestBase.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateEndpointRequestBase value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public CreateEndpointRequestBase read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CreateEndpointRequestBase instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CreateEndpointRequestBase given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateEndpointRequestBase + * @throws IOException if the JSON string is invalid with respect to CreateEndpointRequestBase + */ + public static CreateEndpointRequestBase fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateEndpointRequestBase.class); + } + + /** + * Convert an instance of CreateEndpointRequestBase to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/bandwidth/sdk/model/CreateEndpointResponse.java b/src/main/java/com/bandwidth/sdk/model/CreateEndpointResponse.java new file mode 100644 index 00000000..611afcb9 --- /dev/null +++ b/src/main/java/com/bandwidth/sdk/model/CreateEndpointResponse.java @@ -0,0 +1,387 @@ +/* + * Bandwidth + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.bandwidth.sdk.model; + +import java.util.Objects; +import java.util.Locale; +import com.bandwidth.sdk.model.CreateEndpointResponseObject; +import com.bandwidth.sdk.model.Error1; +import com.bandwidth.sdk.model.Link1; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Locale; + +import com.bandwidth.sdk.JSON; + +/** + * CreateEndpointResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0") +public class CreateEndpointResponse { + public static final String SERIALIZED_NAME_LINKS = "links"; + @SerializedName(SERIALIZED_NAME_LINKS) + @javax.annotation.Nonnull + private List links = new ArrayList<>(); + + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private CreateEndpointResponseObject data; + + public static final String SERIALIZED_NAME_ERRORS = "errors"; + @SerializedName(SERIALIZED_NAME_ERRORS) + @javax.annotation.Nonnull + private List errors = new ArrayList<>(); + + public CreateEndpointResponse() { + } + + public CreateEndpointResponse links(@javax.annotation.Nonnull List links) { + this.links = links; + return this; + } + + public CreateEndpointResponse addLinksItem(Link1 linksItem) { + if (this.links == null) { + this.links = new ArrayList<>(); + } + this.links.add(linksItem); + return this; + } + + /** + * Get links + * @return links + */ + @javax.annotation.Nonnull + public List getLinks() { + return links; + } + + public void setLinks(@javax.annotation.Nonnull List links) { + this.links = links; + } + + + public CreateEndpointResponse data(@javax.annotation.Nonnull CreateEndpointResponseObject data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nonnull + public CreateEndpointResponseObject getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull CreateEndpointResponseObject data) { + this.data = data; + } + + + public CreateEndpointResponse errors(@javax.annotation.Nonnull List errors) { + this.errors = errors; + return this; + } + + public CreateEndpointResponse addErrorsItem(Error1 errorsItem) { + if (this.errors == null) { + this.errors = new ArrayList<>(); + } + this.errors.add(errorsItem); + return this; + } + + /** + * Get errors + * @return errors + */ + @javax.annotation.Nonnull + public List getErrors() { + return errors; + } + + public void setErrors(@javax.annotation.Nonnull List errors) { + this.errors = errors; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the CreateEndpointResponse instance itself + */ + public CreateEndpointResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateEndpointResponse createEndpointResponse = (CreateEndpointResponse) o; + return Objects.equals(this.links, createEndpointResponse.links) && + Objects.equals(this.data, createEndpointResponse.data) && + Objects.equals(this.errors, createEndpointResponse.errors)&& + Objects.equals(this.additionalProperties, createEndpointResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(links, data, errors, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateEndpointResponse {\n"); + sb.append(" links: ").append(toIndentedString(links)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" errors: ").append(toIndentedString(errors)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("links", "data", "errors")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("links", "data", "errors")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CreateEndpointResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateEndpointResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in CreateEndpointResponse is not found in the empty JSON string", CreateEndpointResponse.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateEndpointResponse.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the json data is an array + if (!jsonObj.get("links").isJsonArray()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `links` to be an array in the JSON string but got `%s`", jsonObj.get("links").toString())); + } + + JsonArray jsonArraylinks = jsonObj.getAsJsonArray("links"); + // validate the required field `links` (array) + for (int i = 0; i < jsonArraylinks.size(); i++) { + Link1.validateJsonElement(jsonArraylinks.get(i)); + }; + // validate the required field `data` + CreateEndpointResponseObject.validateJsonElement(jsonObj.get("data")); + // ensure the json data is an array + if (!jsonObj.get("errors").isJsonArray()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `errors` to be an array in the JSON string but got `%s`", jsonObj.get("errors").toString())); + } + + JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); + // validate the required field `errors` (array) + for (int i = 0; i < jsonArrayerrors.size(); i++) { + Error1.validateJsonElement(jsonArrayerrors.get(i)); + }; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateEndpointResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateEndpointResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CreateEndpointResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateEndpointResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public CreateEndpointResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CreateEndpointResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CreateEndpointResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateEndpointResponse + * @throws IOException if the JSON string is invalid with respect to CreateEndpointResponse + */ + public static CreateEndpointResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateEndpointResponse.class); + } + + /** + * Convert an instance of CreateEndpointResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/bandwidth/sdk/model/CreateEndpointResponseObject.java b/src/main/java/com/bandwidth/sdk/model/CreateEndpointResponseObject.java new file mode 100644 index 00000000..e951cbac --- /dev/null +++ b/src/main/java/com/bandwidth/sdk/model/CreateEndpointResponseObject.java @@ -0,0 +1,515 @@ +/* + * Bandwidth + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.bandwidth.sdk.model; + +import java.util.Objects; +import java.util.Locale; +import com.bandwidth.sdk.model.Device; +import com.bandwidth.sdk.model.EndpointStatusEnum; +import com.bandwidth.sdk.model.EndpointTypeEnum; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Locale; + +import com.bandwidth.sdk.JSON; + +/** + * CreateEndpointResponseObject + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0") +public class CreateEndpointResponseObject { + public static final String SERIALIZED_NAME_ENDPOINT_ID = "endpointId"; + @SerializedName(SERIALIZED_NAME_ENDPOINT_ID) + @javax.annotation.Nonnull + private String endpointId; + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull + private EndpointTypeEnum type; + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + @javax.annotation.Nonnull + private EndpointStatusEnum status; + + public static final String SERIALIZED_NAME_CREATION_TIMESTAMP = "creationTimestamp"; + @SerializedName(SERIALIZED_NAME_CREATION_TIMESTAMP) + @javax.annotation.Nonnull + private OffsetDateTime creationTimestamp; + + public static final String SERIALIZED_NAME_EXPIRATION_TIMESTAMP = "expirationTimestamp"; + @SerializedName(SERIALIZED_NAME_EXPIRATION_TIMESTAMP) + @javax.annotation.Nonnull + private OffsetDateTime expirationTimestamp; + + public static final String SERIALIZED_NAME_TAG = "tag"; + @SerializedName(SERIALIZED_NAME_TAG) + @javax.annotation.Nullable + private String tag; + + public static final String SERIALIZED_NAME_DEVICES = "devices"; + @SerializedName(SERIALIZED_NAME_DEVICES) + @javax.annotation.Nullable + private List devices = new ArrayList<>(); + + public static final String SERIALIZED_NAME_TOKEN = "token"; + @SerializedName(SERIALIZED_NAME_TOKEN) + @javax.annotation.Nonnull + private String token; + + public CreateEndpointResponseObject() { + } + + public CreateEndpointResponseObject endpointId(@javax.annotation.Nonnull String endpointId) { + this.endpointId = endpointId; + return this; + } + + /** + * The unique ID of the endpoint. + * @return endpointId + */ + @javax.annotation.Nonnull + public String getEndpointId() { + return endpointId; + } + + public void setEndpointId(@javax.annotation.Nonnull String endpointId) { + this.endpointId = endpointId; + } + + + public CreateEndpointResponseObject type(@javax.annotation.Nonnull EndpointTypeEnum type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nonnull + public EndpointTypeEnum getType() { + return type; + } + + public void setType(@javax.annotation.Nonnull EndpointTypeEnum type) { + this.type = type; + } + + + public CreateEndpointResponseObject status(@javax.annotation.Nonnull EndpointStatusEnum status) { + this.status = status; + return this; + } + + /** + * Get status + * @return status + */ + @javax.annotation.Nonnull + public EndpointStatusEnum getStatus() { + return status; + } + + public void setStatus(@javax.annotation.Nonnull EndpointStatusEnum status) { + this.status = status; + } + + + public CreateEndpointResponseObject creationTimestamp(@javax.annotation.Nonnull OffsetDateTime creationTimestamp) { + this.creationTimestamp = creationTimestamp; + return this; + } + + /** + * The time the endpoint was created. In ISO-8601 format. + * @return creationTimestamp + */ + @javax.annotation.Nonnull + public OffsetDateTime getCreationTimestamp() { + return creationTimestamp; + } + + public void setCreationTimestamp(@javax.annotation.Nonnull OffsetDateTime creationTimestamp) { + this.creationTimestamp = creationTimestamp; + } + + + public CreateEndpointResponseObject expirationTimestamp(@javax.annotation.Nonnull OffsetDateTime expirationTimestamp) { + this.expirationTimestamp = expirationTimestamp; + return this; + } + + /** + * The time the endpoint token will expire. In ISO-8601 format. Tokens last 24 hours. + * @return expirationTimestamp + */ + @javax.annotation.Nonnull + public OffsetDateTime getExpirationTimestamp() { + return expirationTimestamp; + } + + public void setExpirationTimestamp(@javax.annotation.Nonnull OffsetDateTime expirationTimestamp) { + this.expirationTimestamp = expirationTimestamp; + } + + + public CreateEndpointResponseObject tag(@javax.annotation.Nullable String tag) { + this.tag = tag; + return this; + } + + /** + * A tag for the endpoint. + * @return tag + */ + @javax.annotation.Nullable + public String getTag() { + return tag; + } + + public void setTag(@javax.annotation.Nullable String tag) { + this.tag = tag; + } + + + public CreateEndpointResponseObject devices(@javax.annotation.Nullable List devices) { + this.devices = devices; + return this; + } + + public CreateEndpointResponseObject addDevicesItem(Device devicesItem) { + if (this.devices == null) { + this.devices = new ArrayList<>(); + } + this.devices.add(devicesItem); + return this; + } + + /** + * Get devices + * @return devices + */ + @javax.annotation.Nullable + public List getDevices() { + return devices; + } + + public void setDevices(@javax.annotation.Nullable List devices) { + this.devices = devices; + } + + + public CreateEndpointResponseObject token(@javax.annotation.Nonnull String token) { + this.token = token; + return this; + } + + /** + * The json web token specific to the endpoint. Used to authenticate the client with the media gateway. + * @return token + */ + @javax.annotation.Nonnull + public String getToken() { + return token; + } + + public void setToken(@javax.annotation.Nonnull String token) { + this.token = token; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the CreateEndpointResponseObject instance itself + */ + public CreateEndpointResponseObject putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateEndpointResponseObject createEndpointResponseObject = (CreateEndpointResponseObject) o; + return Objects.equals(this.endpointId, createEndpointResponseObject.endpointId) && + Objects.equals(this.type, createEndpointResponseObject.type) && + Objects.equals(this.status, createEndpointResponseObject.status) && + Objects.equals(this.creationTimestamp, createEndpointResponseObject.creationTimestamp) && + Objects.equals(this.expirationTimestamp, createEndpointResponseObject.expirationTimestamp) && + Objects.equals(this.tag, createEndpointResponseObject.tag) && + Objects.equals(this.devices, createEndpointResponseObject.devices) && + Objects.equals(this.token, createEndpointResponseObject.token)&& + Objects.equals(this.additionalProperties, createEndpointResponseObject.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(endpointId, type, status, creationTimestamp, expirationTimestamp, tag, devices, token, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateEndpointResponseObject {\n"); + sb.append(" endpointId: ").append(toIndentedString(endpointId)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" creationTimestamp: ").append(toIndentedString(creationTimestamp)).append("\n"); + sb.append(" expirationTimestamp: ").append(toIndentedString(expirationTimestamp)).append("\n"); + sb.append(" tag: ").append(toIndentedString(tag)).append("\n"); + sb.append(" devices: ").append(toIndentedString(devices)).append("\n"); + sb.append(" token: ").append(toIndentedString(token)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("endpointId", "type", "status", "creationTimestamp", "expirationTimestamp", "tag", "devices", "token")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("endpointId", "type", "status", "creationTimestamp", "expirationTimestamp", "token")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CreateEndpointResponseObject + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateEndpointResponseObject.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in CreateEndpointResponseObject is not found in the empty JSON string", CreateEndpointResponseObject.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateEndpointResponseObject.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("endpointId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `endpointId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("endpointId").toString())); + } + // validate the required field `type` + EndpointTypeEnum.validateJsonElement(jsonObj.get("type")); + // validate the required field `status` + EndpointStatusEnum.validateJsonElement(jsonObj.get("status")); + if ((jsonObj.get("tag") != null && !jsonObj.get("tag").isJsonNull()) && !jsonObj.get("tag").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `tag` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tag").toString())); + } + if (jsonObj.get("devices") != null && !jsonObj.get("devices").isJsonNull()) { + JsonArray jsonArraydevices = jsonObj.getAsJsonArray("devices"); + if (jsonArraydevices != null) { + // ensure the json data is an array + if (!jsonObj.get("devices").isJsonArray()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `devices` to be an array in the JSON string but got `%s`", jsonObj.get("devices").toString())); + } + + // validate the optional field `devices` (array) + for (int i = 0; i < jsonArraydevices.size(); i++) { + Device.validateJsonElement(jsonArraydevices.get(i)); + }; + } + } + if (!jsonObj.get("token").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("token").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateEndpointResponseObject.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateEndpointResponseObject' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CreateEndpointResponseObject.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateEndpointResponseObject value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public CreateEndpointResponseObject read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CreateEndpointResponseObject instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CreateEndpointResponseObject given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateEndpointResponseObject + * @throws IOException if the JSON string is invalid with respect to CreateEndpointResponseObject + */ + public static CreateEndpointResponseObject fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateEndpointResponseObject.class); + } + + /** + * Convert an instance of CreateEndpointResponseObject to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/bandwidth/sdk/model/CreateWebRtcConnectionRequest.java b/src/main/java/com/bandwidth/sdk/model/CreateWebRtcConnectionRequest.java new file mode 100644 index 00000000..bef608e2 --- /dev/null +++ b/src/main/java/com/bandwidth/sdk/model/CreateWebRtcConnectionRequest.java @@ -0,0 +1,438 @@ +/* + * Bandwidth + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.bandwidth.sdk.model; + +import java.util.Objects; +import java.util.Locale; +import com.bandwidth.sdk.model.EndpointDirectionEnum; +import com.bandwidth.sdk.model.EndpointTypeEnum; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.net.URI; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Locale; + +import com.bandwidth.sdk.JSON; + +/** + * CreateWebRtcConnectionRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0") +public class CreateWebRtcConnectionRequest { + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull + private EndpointTypeEnum type; + + public static final String SERIALIZED_NAME_DIRECTION = "direction"; + @SerializedName(SERIALIZED_NAME_DIRECTION) + @javax.annotation.Nonnull + private EndpointDirectionEnum direction; + + public static final String SERIALIZED_NAME_EVENT_CALLBACK_URL = "eventCallbackUrl"; + @SerializedName(SERIALIZED_NAME_EVENT_CALLBACK_URL) + @javax.annotation.Nullable + private URI eventCallbackUrl; + + public static final String SERIALIZED_NAME_EVENT_FALLBACK_URL = "eventFallbackUrl"; + @SerializedName(SERIALIZED_NAME_EVENT_FALLBACK_URL) + @javax.annotation.Nullable + private URI eventFallbackUrl; + + public static final String SERIALIZED_NAME_TAG = "tag"; + @SerializedName(SERIALIZED_NAME_TAG) + @javax.annotation.Nullable + private String tag; + + public static final String SERIALIZED_NAME_CONNECTION_METADATA = "connectionMetadata"; + @SerializedName(SERIALIZED_NAME_CONNECTION_METADATA) + @javax.annotation.Nullable + private Object connectionMetadata; + + public CreateWebRtcConnectionRequest() { + } + + public CreateWebRtcConnectionRequest type(@javax.annotation.Nonnull EndpointTypeEnum type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nonnull + public EndpointTypeEnum getType() { + return type; + } + + public void setType(@javax.annotation.Nonnull EndpointTypeEnum type) { + this.type = type; + } + + + public CreateWebRtcConnectionRequest direction(@javax.annotation.Nonnull EndpointDirectionEnum direction) { + this.direction = direction; + return this; + } + + /** + * Get direction + * @return direction + */ + @javax.annotation.Nonnull + public EndpointDirectionEnum getDirection() { + return direction; + } + + public void setDirection(@javax.annotation.Nonnull EndpointDirectionEnum direction) { + this.direction = direction; + } + + + public CreateWebRtcConnectionRequest eventCallbackUrl(@javax.annotation.Nullable URI eventCallbackUrl) { + this.eventCallbackUrl = eventCallbackUrl; + return this; + } + + /** + * The URL to send event callbacks to. + * @return eventCallbackUrl + */ + @javax.annotation.Nullable + public URI getEventCallbackUrl() { + return eventCallbackUrl; + } + + public void setEventCallbackUrl(@javax.annotation.Nullable URI eventCallbackUrl) { + this.eventCallbackUrl = eventCallbackUrl; + } + + + public CreateWebRtcConnectionRequest eventFallbackUrl(@javax.annotation.Nullable URI eventFallbackUrl) { + this.eventFallbackUrl = eventFallbackUrl; + return this; + } + + /** + * The URL to send event fallbacks to. + * @return eventFallbackUrl + */ + @javax.annotation.Nullable + public URI getEventFallbackUrl() { + return eventFallbackUrl; + } + + public void setEventFallbackUrl(@javax.annotation.Nullable URI eventFallbackUrl) { + this.eventFallbackUrl = eventFallbackUrl; + } + + + public CreateWebRtcConnectionRequest tag(@javax.annotation.Nullable String tag) { + this.tag = tag; + return this; + } + + /** + * A tag for the endpoint. + * @return tag + */ + @javax.annotation.Nullable + public String getTag() { + return tag; + } + + public void setTag(@javax.annotation.Nullable String tag) { + this.tag = tag; + } + + + public CreateWebRtcConnectionRequest connectionMetadata(@javax.annotation.Nullable Object connectionMetadata) { + this.connectionMetadata = connectionMetadata; + return this; + } + + /** + * Get connectionMetadata + * @return connectionMetadata + */ + @javax.annotation.Nullable + public Object getConnectionMetadata() { + return connectionMetadata; + } + + public void setConnectionMetadata(@javax.annotation.Nullable Object connectionMetadata) { + this.connectionMetadata = connectionMetadata; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the CreateWebRtcConnectionRequest instance itself + */ + public CreateWebRtcConnectionRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateWebRtcConnectionRequest createWebRtcConnectionRequest = (CreateWebRtcConnectionRequest) o; + return Objects.equals(this.type, createWebRtcConnectionRequest.type) && + Objects.equals(this.direction, createWebRtcConnectionRequest.direction) && + Objects.equals(this.eventCallbackUrl, createWebRtcConnectionRequest.eventCallbackUrl) && + Objects.equals(this.eventFallbackUrl, createWebRtcConnectionRequest.eventFallbackUrl) && + Objects.equals(this.tag, createWebRtcConnectionRequest.tag) && + Objects.equals(this.connectionMetadata, createWebRtcConnectionRequest.connectionMetadata)&& + Objects.equals(this.additionalProperties, createWebRtcConnectionRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(type, direction, eventCallbackUrl, eventFallbackUrl, tag, connectionMetadata, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateWebRtcConnectionRequest {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" direction: ").append(toIndentedString(direction)).append("\n"); + sb.append(" eventCallbackUrl: ").append(toIndentedString(eventCallbackUrl)).append("\n"); + sb.append(" eventFallbackUrl: ").append(toIndentedString(eventFallbackUrl)).append("\n"); + sb.append(" tag: ").append(toIndentedString(tag)).append("\n"); + sb.append(" connectionMetadata: ").append(toIndentedString(connectionMetadata)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("type", "direction", "eventCallbackUrl", "eventFallbackUrl", "tag", "connectionMetadata")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("type", "direction")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CreateWebRtcConnectionRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateWebRtcConnectionRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in CreateWebRtcConnectionRequest is not found in the empty JSON string", CreateWebRtcConnectionRequest.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateWebRtcConnectionRequest.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `type` + EndpointTypeEnum.validateJsonElement(jsonObj.get("type")); + // validate the required field `direction` + EndpointDirectionEnum.validateJsonElement(jsonObj.get("direction")); + if ((jsonObj.get("eventCallbackUrl") != null && !jsonObj.get("eventCallbackUrl").isJsonNull()) && !jsonObj.get("eventCallbackUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `eventCallbackUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("eventCallbackUrl").toString())); + } + if ((jsonObj.get("eventFallbackUrl") != null && !jsonObj.get("eventFallbackUrl").isJsonNull()) && !jsonObj.get("eventFallbackUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `eventFallbackUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("eventFallbackUrl").toString())); + } + if ((jsonObj.get("tag") != null && !jsonObj.get("tag").isJsonNull()) && !jsonObj.get("tag").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `tag` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tag").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateWebRtcConnectionRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateWebRtcConnectionRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CreateWebRtcConnectionRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateWebRtcConnectionRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public CreateWebRtcConnectionRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CreateWebRtcConnectionRequest instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CreateWebRtcConnectionRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateWebRtcConnectionRequest + * @throws IOException if the JSON string is invalid with respect to CreateWebRtcConnectionRequest + */ + public static CreateWebRtcConnectionRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateWebRtcConnectionRequest.class); + } + + /** + * Convert an instance of CreateWebRtcConnectionRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/bandwidth/sdk/model/Device.java b/src/main/java/com/bandwidth/sdk/model/Device.java new file mode 100644 index 00000000..3b1e46b3 --- /dev/null +++ b/src/main/java/com/bandwidth/sdk/model/Device.java @@ -0,0 +1,380 @@ +/* + * Bandwidth + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.bandwidth.sdk.model; + +import java.util.Objects; +import java.util.Locale; +import com.bandwidth.sdk.model.DeviceStatusEnum; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Locale; + +import com.bandwidth.sdk.JSON; + +/** + * Device + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0") +public class Device { + public static final String SERIALIZED_NAME_DEVICE_ID = "deviceId"; + @SerializedName(SERIALIZED_NAME_DEVICE_ID) + @javax.annotation.Nonnull + private String deviceId; + + public static final String SERIALIZED_NAME_DEVICE_NAME = "deviceName"; + @SerializedName(SERIALIZED_NAME_DEVICE_NAME) + @javax.annotation.Nullable + private String deviceName; + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + @javax.annotation.Nonnull + private DeviceStatusEnum status; + + public static final String SERIALIZED_NAME_CREATION_TIMESTAMP = "creationTimestamp"; + @SerializedName(SERIALIZED_NAME_CREATION_TIMESTAMP) + @javax.annotation.Nonnull + private OffsetDateTime creationTimestamp; + + public Device() { + } + + public Device deviceId(@javax.annotation.Nonnull String deviceId) { + this.deviceId = deviceId; + return this; + } + + /** + * The unique ID of the device. + * @return deviceId + */ + @javax.annotation.Nonnull + public String getDeviceId() { + return deviceId; + } + + public void setDeviceId(@javax.annotation.Nonnull String deviceId) { + this.deviceId = deviceId; + } + + + public Device deviceName(@javax.annotation.Nullable String deviceName) { + this.deviceName = deviceName; + return this; + } + + /** + * The name of the device. + * @return deviceName + */ + @javax.annotation.Nullable + public String getDeviceName() { + return deviceName; + } + + public void setDeviceName(@javax.annotation.Nullable String deviceName) { + this.deviceName = deviceName; + } + + + public Device status(@javax.annotation.Nonnull DeviceStatusEnum status) { + this.status = status; + return this; + } + + /** + * Get status + * @return status + */ + @javax.annotation.Nonnull + public DeviceStatusEnum getStatus() { + return status; + } + + public void setStatus(@javax.annotation.Nonnull DeviceStatusEnum status) { + this.status = status; + } + + + public Device creationTimestamp(@javax.annotation.Nonnull OffsetDateTime creationTimestamp) { + this.creationTimestamp = creationTimestamp; + return this; + } + + /** + * The time the device was created. In ISO-8601 format. + * @return creationTimestamp + */ + @javax.annotation.Nonnull + public OffsetDateTime getCreationTimestamp() { + return creationTimestamp; + } + + public void setCreationTimestamp(@javax.annotation.Nonnull OffsetDateTime creationTimestamp) { + this.creationTimestamp = creationTimestamp; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the Device instance itself + */ + public Device putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Device device = (Device) o; + return Objects.equals(this.deviceId, device.deviceId) && + Objects.equals(this.deviceName, device.deviceName) && + Objects.equals(this.status, device.status) && + Objects.equals(this.creationTimestamp, device.creationTimestamp)&& + Objects.equals(this.additionalProperties, device.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(deviceId, deviceName, status, creationTimestamp, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Device {\n"); + sb.append(" deviceId: ").append(toIndentedString(deviceId)).append("\n"); + sb.append(" deviceName: ").append(toIndentedString(deviceName)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" creationTimestamp: ").append(toIndentedString(creationTimestamp)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("deviceId", "deviceName", "status", "creationTimestamp")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("deviceId", "status", "creationTimestamp")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Device + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Device.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in Device is not found in the empty JSON string", Device.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Device.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("deviceId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `deviceId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deviceId").toString())); + } + if ((jsonObj.get("deviceName") != null && !jsonObj.get("deviceName").isJsonNull()) && !jsonObj.get("deviceName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `deviceName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deviceName").toString())); + } + // validate the required field `status` + DeviceStatusEnum.validateJsonElement(jsonObj.get("status")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Device.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Device' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Device.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Device value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public Device read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + Device instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Device given an JSON string + * + * @param jsonString JSON string + * @return An instance of Device + * @throws IOException if the JSON string is invalid with respect to Device + */ + public static Device fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Device.class); + } + + /** + * Convert an instance of Device to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/bandwidth/sdk/model/DeviceStatusEnum.java b/src/main/java/com/bandwidth/sdk/model/DeviceStatusEnum.java new file mode 100644 index 00000000..8fc6fbca --- /dev/null +++ b/src/main/java/com/bandwidth/sdk/model/DeviceStatusEnum.java @@ -0,0 +1,80 @@ +/* + * Bandwidth + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.bandwidth.sdk.model; + +import java.util.Objects; +import java.util.Locale; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import java.util.Locale; +import com.google.gson.TypeAdapter; +import com.google.gson.JsonElement; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets deviceStatusEnum + */ +@JsonAdapter(DeviceStatusEnum.Adapter.class) +public enum DeviceStatusEnum { + + CONNECTED("CONNECTED"), + + DISCONNECTED("DISCONNECTED"); + + private String value; + + DeviceStatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static DeviceStatusEnum fromValue(String value) { + for (DeviceStatusEnum b : DeviceStatusEnum.values()) { + if (b.value.equalsIgnoreCase(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final DeviceStatusEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public DeviceStatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return DeviceStatusEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + DeviceStatusEnum.fromValue(value); + } +} + diff --git a/src/main/java/com/bandwidth/sdk/model/Endpoint.java b/src/main/java/com/bandwidth/sdk/model/Endpoint.java new file mode 100644 index 00000000..1a6e1157 --- /dev/null +++ b/src/main/java/com/bandwidth/sdk/model/Endpoint.java @@ -0,0 +1,486 @@ +/* + * Bandwidth + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.bandwidth.sdk.model; + +import java.util.Objects; +import java.util.Locale; +import com.bandwidth.sdk.model.Device; +import com.bandwidth.sdk.model.EndpointStatusEnum; +import com.bandwidth.sdk.model.EndpointTypeEnum; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Locale; + +import com.bandwidth.sdk.JSON; + +/** + * Endpoint + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0") +public class Endpoint { + public static final String SERIALIZED_NAME_ENDPOINT_ID = "endpointId"; + @SerializedName(SERIALIZED_NAME_ENDPOINT_ID) + @javax.annotation.Nonnull + private String endpointId; + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull + private EndpointTypeEnum type; + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + @javax.annotation.Nonnull + private EndpointStatusEnum status; + + public static final String SERIALIZED_NAME_CREATION_TIMESTAMP = "creationTimestamp"; + @SerializedName(SERIALIZED_NAME_CREATION_TIMESTAMP) + @javax.annotation.Nonnull + private OffsetDateTime creationTimestamp; + + public static final String SERIALIZED_NAME_EXPIRATION_TIMESTAMP = "expirationTimestamp"; + @SerializedName(SERIALIZED_NAME_EXPIRATION_TIMESTAMP) + @javax.annotation.Nonnull + private OffsetDateTime expirationTimestamp; + + public static final String SERIALIZED_NAME_TAG = "tag"; + @SerializedName(SERIALIZED_NAME_TAG) + @javax.annotation.Nullable + private String tag; + + public static final String SERIALIZED_NAME_DEVICES = "devices"; + @SerializedName(SERIALIZED_NAME_DEVICES) + @javax.annotation.Nullable + private List devices = new ArrayList<>(); + + public Endpoint() { + } + + public Endpoint endpointId(@javax.annotation.Nonnull String endpointId) { + this.endpointId = endpointId; + return this; + } + + /** + * The unique ID of the endpoint. + * @return endpointId + */ + @javax.annotation.Nonnull + public String getEndpointId() { + return endpointId; + } + + public void setEndpointId(@javax.annotation.Nonnull String endpointId) { + this.endpointId = endpointId; + } + + + public Endpoint type(@javax.annotation.Nonnull EndpointTypeEnum type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nonnull + public EndpointTypeEnum getType() { + return type; + } + + public void setType(@javax.annotation.Nonnull EndpointTypeEnum type) { + this.type = type; + } + + + public Endpoint status(@javax.annotation.Nonnull EndpointStatusEnum status) { + this.status = status; + return this; + } + + /** + * Get status + * @return status + */ + @javax.annotation.Nonnull + public EndpointStatusEnum getStatus() { + return status; + } + + public void setStatus(@javax.annotation.Nonnull EndpointStatusEnum status) { + this.status = status; + } + + + public Endpoint creationTimestamp(@javax.annotation.Nonnull OffsetDateTime creationTimestamp) { + this.creationTimestamp = creationTimestamp; + return this; + } + + /** + * The time the endpoint was created. In ISO-8601 format. + * @return creationTimestamp + */ + @javax.annotation.Nonnull + public OffsetDateTime getCreationTimestamp() { + return creationTimestamp; + } + + public void setCreationTimestamp(@javax.annotation.Nonnull OffsetDateTime creationTimestamp) { + this.creationTimestamp = creationTimestamp; + } + + + public Endpoint expirationTimestamp(@javax.annotation.Nonnull OffsetDateTime expirationTimestamp) { + this.expirationTimestamp = expirationTimestamp; + return this; + } + + /** + * The time the endpoint token will expire. In ISO-8601 format. Tokens last 24 hours. + * @return expirationTimestamp + */ + @javax.annotation.Nonnull + public OffsetDateTime getExpirationTimestamp() { + return expirationTimestamp; + } + + public void setExpirationTimestamp(@javax.annotation.Nonnull OffsetDateTime expirationTimestamp) { + this.expirationTimestamp = expirationTimestamp; + } + + + public Endpoint tag(@javax.annotation.Nullable String tag) { + this.tag = tag; + return this; + } + + /** + * A tag for the endpoint. + * @return tag + */ + @javax.annotation.Nullable + public String getTag() { + return tag; + } + + public void setTag(@javax.annotation.Nullable String tag) { + this.tag = tag; + } + + + public Endpoint devices(@javax.annotation.Nullable List devices) { + this.devices = devices; + return this; + } + + public Endpoint addDevicesItem(Device devicesItem) { + if (this.devices == null) { + this.devices = new ArrayList<>(); + } + this.devices.add(devicesItem); + return this; + } + + /** + * Get devices + * @return devices + */ + @javax.annotation.Nullable + public List getDevices() { + return devices; + } + + public void setDevices(@javax.annotation.Nullable List devices) { + this.devices = devices; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the Endpoint instance itself + */ + public Endpoint putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Endpoint endpoint = (Endpoint) o; + return Objects.equals(this.endpointId, endpoint.endpointId) && + Objects.equals(this.type, endpoint.type) && + Objects.equals(this.status, endpoint.status) && + Objects.equals(this.creationTimestamp, endpoint.creationTimestamp) && + Objects.equals(this.expirationTimestamp, endpoint.expirationTimestamp) && + Objects.equals(this.tag, endpoint.tag) && + Objects.equals(this.devices, endpoint.devices)&& + Objects.equals(this.additionalProperties, endpoint.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(endpointId, type, status, creationTimestamp, expirationTimestamp, tag, devices, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Endpoint {\n"); + sb.append(" endpointId: ").append(toIndentedString(endpointId)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" creationTimestamp: ").append(toIndentedString(creationTimestamp)).append("\n"); + sb.append(" expirationTimestamp: ").append(toIndentedString(expirationTimestamp)).append("\n"); + sb.append(" tag: ").append(toIndentedString(tag)).append("\n"); + sb.append(" devices: ").append(toIndentedString(devices)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("endpointId", "type", "status", "creationTimestamp", "expirationTimestamp", "tag", "devices")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("endpointId", "type", "status", "creationTimestamp", "expirationTimestamp")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Endpoint + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Endpoint.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in Endpoint is not found in the empty JSON string", Endpoint.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Endpoint.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("endpointId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `endpointId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("endpointId").toString())); + } + // validate the required field `type` + EndpointTypeEnum.validateJsonElement(jsonObj.get("type")); + // validate the required field `status` + EndpointStatusEnum.validateJsonElement(jsonObj.get("status")); + if ((jsonObj.get("tag") != null && !jsonObj.get("tag").isJsonNull()) && !jsonObj.get("tag").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `tag` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tag").toString())); + } + if (jsonObj.get("devices") != null && !jsonObj.get("devices").isJsonNull()) { + JsonArray jsonArraydevices = jsonObj.getAsJsonArray("devices"); + if (jsonArraydevices != null) { + // ensure the json data is an array + if (!jsonObj.get("devices").isJsonArray()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `devices` to be an array in the JSON string but got `%s`", jsonObj.get("devices").toString())); + } + + // validate the optional field `devices` (array) + for (int i = 0; i < jsonArraydevices.size(); i++) { + Device.validateJsonElement(jsonArraydevices.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Endpoint.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Endpoint' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Endpoint.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Endpoint value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public Endpoint read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + Endpoint instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Endpoint given an JSON string + * + * @param jsonString JSON string + * @return An instance of Endpoint + * @throws IOException if the JSON string is invalid with respect to Endpoint + */ + public static Endpoint fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Endpoint.class); + } + + /** + * Convert an instance of Endpoint to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/bandwidth/sdk/model/EndpointDirectionEnum.java b/src/main/java/com/bandwidth/sdk/model/EndpointDirectionEnum.java new file mode 100644 index 00000000..f888df29 --- /dev/null +++ b/src/main/java/com/bandwidth/sdk/model/EndpointDirectionEnum.java @@ -0,0 +1,82 @@ +/* + * Bandwidth + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.bandwidth.sdk.model; + +import java.util.Objects; +import java.util.Locale; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import java.util.Locale; +import com.google.gson.TypeAdapter; +import com.google.gson.JsonElement; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets endpointDirectionEnum + */ +@JsonAdapter(EndpointDirectionEnum.Adapter.class) +public enum EndpointDirectionEnum { + + INBOUND("INBOUND"), + + OUTBOUND("OUTBOUND"), + + BIDIRECTIONAL("BIDIRECTIONAL"); + + private String value; + + EndpointDirectionEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static EndpointDirectionEnum fromValue(String value) { + for (EndpointDirectionEnum b : EndpointDirectionEnum.values()) { + if (b.value.equalsIgnoreCase(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final EndpointDirectionEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public EndpointDirectionEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return EndpointDirectionEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + EndpointDirectionEnum.fromValue(value); + } +} + diff --git a/src/main/java/com/bandwidth/sdk/model/EndpointEvent.java b/src/main/java/com/bandwidth/sdk/model/EndpointEvent.java new file mode 100644 index 00000000..3b3a8b25 --- /dev/null +++ b/src/main/java/com/bandwidth/sdk/model/EndpointEvent.java @@ -0,0 +1,521 @@ +/* + * Bandwidth + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.bandwidth.sdk.model; + +import java.util.Objects; +import java.util.Locale; +import com.bandwidth.sdk.model.Device; +import com.bandwidth.sdk.model.EndpointEventTypeEnum; +import com.bandwidth.sdk.model.EndpointStatusEnum; +import com.bandwidth.sdk.model.EndpointTypeEnum; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Locale; + +import com.bandwidth.sdk.JSON; + +/** + * An event that occurred on an endpoint. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0") +public class EndpointEvent { + public static final String SERIALIZED_NAME_ENDPOINT_ID = "endpointId"; + @SerializedName(SERIALIZED_NAME_ENDPOINT_ID) + @javax.annotation.Nonnull + private String endpointId; + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull + private EndpointTypeEnum type; + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + @javax.annotation.Nonnull + private EndpointStatusEnum status; + + public static final String SERIALIZED_NAME_CREATION_TIMESTAMP = "creationTimestamp"; + @SerializedName(SERIALIZED_NAME_CREATION_TIMESTAMP) + @javax.annotation.Nonnull + private OffsetDateTime creationTimestamp; + + public static final String SERIALIZED_NAME_EXPIRATION_TIMESTAMP = "expirationTimestamp"; + @SerializedName(SERIALIZED_NAME_EXPIRATION_TIMESTAMP) + @javax.annotation.Nonnull + private OffsetDateTime expirationTimestamp; + + public static final String SERIALIZED_NAME_TAG = "tag"; + @SerializedName(SERIALIZED_NAME_TAG) + @javax.annotation.Nullable + private String tag; + + public static final String SERIALIZED_NAME_EVENT_TIME = "eventTime"; + @SerializedName(SERIALIZED_NAME_EVENT_TIME) + @javax.annotation.Nonnull + private OffsetDateTime eventTime; + + public static final String SERIALIZED_NAME_EVENT_TYPE = "eventType"; + @SerializedName(SERIALIZED_NAME_EVENT_TYPE) + @javax.annotation.Nonnull + private EndpointEventTypeEnum eventType; + + public static final String SERIALIZED_NAME_DEVICE = "device"; + @SerializedName(SERIALIZED_NAME_DEVICE) + @javax.annotation.Nullable + private Device device; + + public EndpointEvent() { + } + + public EndpointEvent endpointId(@javax.annotation.Nonnull String endpointId) { + this.endpointId = endpointId; + return this; + } + + /** + * The unique ID of the endpoint. + * @return endpointId + */ + @javax.annotation.Nonnull + public String getEndpointId() { + return endpointId; + } + + public void setEndpointId(@javax.annotation.Nonnull String endpointId) { + this.endpointId = endpointId; + } + + + public EndpointEvent type(@javax.annotation.Nonnull EndpointTypeEnum type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nonnull + public EndpointTypeEnum getType() { + return type; + } + + public void setType(@javax.annotation.Nonnull EndpointTypeEnum type) { + this.type = type; + } + + + public EndpointEvent status(@javax.annotation.Nonnull EndpointStatusEnum status) { + this.status = status; + return this; + } + + /** + * Get status + * @return status + */ + @javax.annotation.Nonnull + public EndpointStatusEnum getStatus() { + return status; + } + + public void setStatus(@javax.annotation.Nonnull EndpointStatusEnum status) { + this.status = status; + } + + + public EndpointEvent creationTimestamp(@javax.annotation.Nonnull OffsetDateTime creationTimestamp) { + this.creationTimestamp = creationTimestamp; + return this; + } + + /** + * The time the endpoint was created. In ISO-8601 format. + * @return creationTimestamp + */ + @javax.annotation.Nonnull + public OffsetDateTime getCreationTimestamp() { + return creationTimestamp; + } + + public void setCreationTimestamp(@javax.annotation.Nonnull OffsetDateTime creationTimestamp) { + this.creationTimestamp = creationTimestamp; + } + + + public EndpointEvent expirationTimestamp(@javax.annotation.Nonnull OffsetDateTime expirationTimestamp) { + this.expirationTimestamp = expirationTimestamp; + return this; + } + + /** + * The time the endpoint token will expire. In ISO-8601 format. Tokens last 24 hours. + * @return expirationTimestamp + */ + @javax.annotation.Nonnull + public OffsetDateTime getExpirationTimestamp() { + return expirationTimestamp; + } + + public void setExpirationTimestamp(@javax.annotation.Nonnull OffsetDateTime expirationTimestamp) { + this.expirationTimestamp = expirationTimestamp; + } + + + public EndpointEvent tag(@javax.annotation.Nullable String tag) { + this.tag = tag; + return this; + } + + /** + * A tag for the endpoint. + * @return tag + */ + @javax.annotation.Nullable + public String getTag() { + return tag; + } + + public void setTag(@javax.annotation.Nullable String tag) { + this.tag = tag; + } + + + public EndpointEvent eventTime(@javax.annotation.Nonnull OffsetDateTime eventTime) { + this.eventTime = eventTime; + return this; + } + + /** + * The time the event occurred. In ISO-8601 format. + * @return eventTime + */ + @javax.annotation.Nonnull + public OffsetDateTime getEventTime() { + return eventTime; + } + + public void setEventTime(@javax.annotation.Nonnull OffsetDateTime eventTime) { + this.eventTime = eventTime; + } + + + public EndpointEvent eventType(@javax.annotation.Nonnull EndpointEventTypeEnum eventType) { + this.eventType = eventType; + return this; + } + + /** + * Get eventType + * @return eventType + */ + @javax.annotation.Nonnull + public EndpointEventTypeEnum getEventType() { + return eventType; + } + + public void setEventType(@javax.annotation.Nonnull EndpointEventTypeEnum eventType) { + this.eventType = eventType; + } + + + public EndpointEvent device(@javax.annotation.Nullable Device device) { + this.device = device; + return this; + } + + /** + * Get device + * @return device + */ + @javax.annotation.Nullable + public Device getDevice() { + return device; + } + + public void setDevice(@javax.annotation.Nullable Device device) { + this.device = device; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the EndpointEvent instance itself + */ + public EndpointEvent putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EndpointEvent endpointEvent = (EndpointEvent) o; + return Objects.equals(this.endpointId, endpointEvent.endpointId) && + Objects.equals(this.type, endpointEvent.type) && + Objects.equals(this.status, endpointEvent.status) && + Objects.equals(this.creationTimestamp, endpointEvent.creationTimestamp) && + Objects.equals(this.expirationTimestamp, endpointEvent.expirationTimestamp) && + Objects.equals(this.tag, endpointEvent.tag) && + Objects.equals(this.eventTime, endpointEvent.eventTime) && + Objects.equals(this.eventType, endpointEvent.eventType) && + Objects.equals(this.device, endpointEvent.device)&& + Objects.equals(this.additionalProperties, endpointEvent.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(endpointId, type, status, creationTimestamp, expirationTimestamp, tag, eventTime, eventType, device, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EndpointEvent {\n"); + sb.append(" endpointId: ").append(toIndentedString(endpointId)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" creationTimestamp: ").append(toIndentedString(creationTimestamp)).append("\n"); + sb.append(" expirationTimestamp: ").append(toIndentedString(expirationTimestamp)).append("\n"); + sb.append(" tag: ").append(toIndentedString(tag)).append("\n"); + sb.append(" eventTime: ").append(toIndentedString(eventTime)).append("\n"); + sb.append(" eventType: ").append(toIndentedString(eventType)).append("\n"); + sb.append(" device: ").append(toIndentedString(device)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("endpointId", "type", "status", "creationTimestamp", "expirationTimestamp", "tag", "eventTime", "eventType", "device")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("endpointId", "type", "status", "creationTimestamp", "expirationTimestamp", "eventTime", "eventType")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to EndpointEvent + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!EndpointEvent.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in EndpointEvent is not found in the empty JSON string", EndpointEvent.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : EndpointEvent.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("endpointId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `endpointId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("endpointId").toString())); + } + // validate the required field `type` + EndpointTypeEnum.validateJsonElement(jsonObj.get("type")); + // validate the required field `status` + EndpointStatusEnum.validateJsonElement(jsonObj.get("status")); + if ((jsonObj.get("tag") != null && !jsonObj.get("tag").isJsonNull()) && !jsonObj.get("tag").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `tag` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tag").toString())); + } + // validate the required field `eventType` + EndpointEventTypeEnum.validateJsonElement(jsonObj.get("eventType")); + // validate the optional field `device` + if (jsonObj.get("device") != null && !jsonObj.get("device").isJsonNull()) { + Device.validateJsonElement(jsonObj.get("device")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!EndpointEvent.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EndpointEvent' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EndpointEvent.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EndpointEvent value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public EndpointEvent read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + EndpointEvent instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of EndpointEvent given an JSON string + * + * @param jsonString JSON string + * @return An instance of EndpointEvent + * @throws IOException if the JSON string is invalid with respect to EndpointEvent + */ + public static EndpointEvent fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EndpointEvent.class); + } + + /** + * Convert an instance of EndpointEvent to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/bandwidth/sdk/model/EndpointEventTypeEnum.java b/src/main/java/com/bandwidth/sdk/model/EndpointEventTypeEnum.java new file mode 100644 index 00000000..c394e7ac --- /dev/null +++ b/src/main/java/com/bandwidth/sdk/model/EndpointEventTypeEnum.java @@ -0,0 +1,80 @@ +/* + * Bandwidth + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.bandwidth.sdk.model; + +import java.util.Objects; +import java.util.Locale; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import java.util.Locale; +import com.google.gson.TypeAdapter; +import com.google.gson.JsonElement; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets endpointEventTypeEnum + */ +@JsonAdapter(EndpointEventTypeEnum.Adapter.class) +public enum EndpointEventTypeEnum { + + DEVICE_CONNECTED("DEVICE_CONNECTED"), + + DEVICE_DISCONNECTED("DEVICE_DISCONNECTED"); + + private String value; + + EndpointEventTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static EndpointEventTypeEnum fromValue(String value) { + for (EndpointEventTypeEnum b : EndpointEventTypeEnum.values()) { + if (b.value.equalsIgnoreCase(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final EndpointEventTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public EndpointEventTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return EndpointEventTypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + EndpointEventTypeEnum.fromValue(value); + } +} + diff --git a/src/main/java/com/bandwidth/sdk/model/EndpointResponse.java b/src/main/java/com/bandwidth/sdk/model/EndpointResponse.java new file mode 100644 index 00000000..3cb5e4b3 --- /dev/null +++ b/src/main/java/com/bandwidth/sdk/model/EndpointResponse.java @@ -0,0 +1,387 @@ +/* + * Bandwidth + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.bandwidth.sdk.model; + +import java.util.Objects; +import java.util.Locale; +import com.bandwidth.sdk.model.Endpoint; +import com.bandwidth.sdk.model.Error1; +import com.bandwidth.sdk.model.Link1; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Locale; + +import com.bandwidth.sdk.JSON; + +/** + * EndpointResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0") +public class EndpointResponse { + public static final String SERIALIZED_NAME_LINKS = "links"; + @SerializedName(SERIALIZED_NAME_LINKS) + @javax.annotation.Nonnull + private List links = new ArrayList<>(); + + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private Endpoint data; + + public static final String SERIALIZED_NAME_ERRORS = "errors"; + @SerializedName(SERIALIZED_NAME_ERRORS) + @javax.annotation.Nonnull + private List errors = new ArrayList<>(); + + public EndpointResponse() { + } + + public EndpointResponse links(@javax.annotation.Nonnull List links) { + this.links = links; + return this; + } + + public EndpointResponse addLinksItem(Link1 linksItem) { + if (this.links == null) { + this.links = new ArrayList<>(); + } + this.links.add(linksItem); + return this; + } + + /** + * Get links + * @return links + */ + @javax.annotation.Nonnull + public List getLinks() { + return links; + } + + public void setLinks(@javax.annotation.Nonnull List links) { + this.links = links; + } + + + public EndpointResponse data(@javax.annotation.Nonnull Endpoint data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nonnull + public Endpoint getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull Endpoint data) { + this.data = data; + } + + + public EndpointResponse errors(@javax.annotation.Nonnull List errors) { + this.errors = errors; + return this; + } + + public EndpointResponse addErrorsItem(Error1 errorsItem) { + if (this.errors == null) { + this.errors = new ArrayList<>(); + } + this.errors.add(errorsItem); + return this; + } + + /** + * Get errors + * @return errors + */ + @javax.annotation.Nonnull + public List getErrors() { + return errors; + } + + public void setErrors(@javax.annotation.Nonnull List errors) { + this.errors = errors; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the EndpointResponse instance itself + */ + public EndpointResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EndpointResponse endpointResponse = (EndpointResponse) o; + return Objects.equals(this.links, endpointResponse.links) && + Objects.equals(this.data, endpointResponse.data) && + Objects.equals(this.errors, endpointResponse.errors)&& + Objects.equals(this.additionalProperties, endpointResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(links, data, errors, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EndpointResponse {\n"); + sb.append(" links: ").append(toIndentedString(links)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" errors: ").append(toIndentedString(errors)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("links", "data", "errors")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("links", "data", "errors")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to EndpointResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!EndpointResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in EndpointResponse is not found in the empty JSON string", EndpointResponse.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : EndpointResponse.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the json data is an array + if (!jsonObj.get("links").isJsonArray()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `links` to be an array in the JSON string but got `%s`", jsonObj.get("links").toString())); + } + + JsonArray jsonArraylinks = jsonObj.getAsJsonArray("links"); + // validate the required field `links` (array) + for (int i = 0; i < jsonArraylinks.size(); i++) { + Link1.validateJsonElement(jsonArraylinks.get(i)); + }; + // validate the required field `data` + Endpoint.validateJsonElement(jsonObj.get("data")); + // ensure the json data is an array + if (!jsonObj.get("errors").isJsonArray()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `errors` to be an array in the JSON string but got `%s`", jsonObj.get("errors").toString())); + } + + JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); + // validate the required field `errors` (array) + for (int i = 0; i < jsonArrayerrors.size(); i++) { + Error1.validateJsonElement(jsonArrayerrors.get(i)); + }; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!EndpointResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EndpointResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EndpointResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EndpointResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public EndpointResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + EndpointResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of EndpointResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of EndpointResponse + * @throws IOException if the JSON string is invalid with respect to EndpointResponse + */ + public static EndpointResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EndpointResponse.class); + } + + /** + * Convert an instance of EndpointResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/bandwidth/sdk/model/EndpointStatusEnum.java b/src/main/java/com/bandwidth/sdk/model/EndpointStatusEnum.java new file mode 100644 index 00000000..29a90e1f --- /dev/null +++ b/src/main/java/com/bandwidth/sdk/model/EndpointStatusEnum.java @@ -0,0 +1,80 @@ +/* + * Bandwidth + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.bandwidth.sdk.model; + +import java.util.Objects; +import java.util.Locale; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import java.util.Locale; +import com.google.gson.TypeAdapter; +import com.google.gson.JsonElement; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets endpointStatusEnum + */ +@JsonAdapter(EndpointStatusEnum.Adapter.class) +public enum EndpointStatusEnum { + + CONNECTED("CONNECTED"), + + DISCONNECTED("DISCONNECTED"); + + private String value; + + EndpointStatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static EndpointStatusEnum fromValue(String value) { + for (EndpointStatusEnum b : EndpointStatusEnum.values()) { + if (b.value.equalsIgnoreCase(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final EndpointStatusEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public EndpointStatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return EndpointStatusEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + EndpointStatusEnum.fromValue(value); + } +} + diff --git a/src/main/java/com/bandwidth/sdk/model/EndpointTypeEnum.java b/src/main/java/com/bandwidth/sdk/model/EndpointTypeEnum.java new file mode 100644 index 00000000..08f86bd5 --- /dev/null +++ b/src/main/java/com/bandwidth/sdk/model/EndpointTypeEnum.java @@ -0,0 +1,78 @@ +/* + * Bandwidth + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.bandwidth.sdk.model; + +import java.util.Objects; +import java.util.Locale; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import java.util.Locale; +import com.google.gson.TypeAdapter; +import com.google.gson.JsonElement; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets endpointTypeEnum + */ +@JsonAdapter(EndpointTypeEnum.Adapter.class) +public enum EndpointTypeEnum { + + WEBRTC("WEBRTC"); + + private String value; + + EndpointTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static EndpointTypeEnum fromValue(String value) { + for (EndpointTypeEnum b : EndpointTypeEnum.values()) { + if (b.value.equalsIgnoreCase(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final EndpointTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public EndpointTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return EndpointTypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + EndpointTypeEnum.fromValue(value); + } +} + diff --git a/src/main/java/com/bandwidth/sdk/model/Endpoints.java b/src/main/java/com/bandwidth/sdk/model/Endpoints.java new file mode 100644 index 00000000..4a04e333 --- /dev/null +++ b/src/main/java/com/bandwidth/sdk/model/Endpoints.java @@ -0,0 +1,435 @@ +/* + * Bandwidth + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.bandwidth.sdk.model; + +import java.util.Objects; +import java.util.Locale; +import com.bandwidth.sdk.model.EndpointStatusEnum; +import com.bandwidth.sdk.model.EndpointTypeEnum; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Locale; + +import com.bandwidth.sdk.JSON; + +/** + * Endpoints + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0") +public class Endpoints { + public static final String SERIALIZED_NAME_ENDPOINT_ID = "endpointId"; + @SerializedName(SERIALIZED_NAME_ENDPOINT_ID) + @javax.annotation.Nonnull + private String endpointId; + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull + private EndpointTypeEnum type; + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + @javax.annotation.Nonnull + private EndpointStatusEnum status; + + public static final String SERIALIZED_NAME_CREATION_TIMESTAMP = "creationTimestamp"; + @SerializedName(SERIALIZED_NAME_CREATION_TIMESTAMP) + @javax.annotation.Nonnull + private OffsetDateTime creationTimestamp; + + public static final String SERIALIZED_NAME_EXPIRATION_TIMESTAMP = "expirationTimestamp"; + @SerializedName(SERIALIZED_NAME_EXPIRATION_TIMESTAMP) + @javax.annotation.Nonnull + private OffsetDateTime expirationTimestamp; + + public static final String SERIALIZED_NAME_TAG = "tag"; + @SerializedName(SERIALIZED_NAME_TAG) + @javax.annotation.Nullable + private String tag; + + public Endpoints() { + } + + public Endpoints endpointId(@javax.annotation.Nonnull String endpointId) { + this.endpointId = endpointId; + return this; + } + + /** + * The unique ID of the endpoint. + * @return endpointId + */ + @javax.annotation.Nonnull + public String getEndpointId() { + return endpointId; + } + + public void setEndpointId(@javax.annotation.Nonnull String endpointId) { + this.endpointId = endpointId; + } + + + public Endpoints type(@javax.annotation.Nonnull EndpointTypeEnum type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nonnull + public EndpointTypeEnum getType() { + return type; + } + + public void setType(@javax.annotation.Nonnull EndpointTypeEnum type) { + this.type = type; + } + + + public Endpoints status(@javax.annotation.Nonnull EndpointStatusEnum status) { + this.status = status; + return this; + } + + /** + * Get status + * @return status + */ + @javax.annotation.Nonnull + public EndpointStatusEnum getStatus() { + return status; + } + + public void setStatus(@javax.annotation.Nonnull EndpointStatusEnum status) { + this.status = status; + } + + + public Endpoints creationTimestamp(@javax.annotation.Nonnull OffsetDateTime creationTimestamp) { + this.creationTimestamp = creationTimestamp; + return this; + } + + /** + * The time the endpoint was created. In ISO-8601 format. + * @return creationTimestamp + */ + @javax.annotation.Nonnull + public OffsetDateTime getCreationTimestamp() { + return creationTimestamp; + } + + public void setCreationTimestamp(@javax.annotation.Nonnull OffsetDateTime creationTimestamp) { + this.creationTimestamp = creationTimestamp; + } + + + public Endpoints expirationTimestamp(@javax.annotation.Nonnull OffsetDateTime expirationTimestamp) { + this.expirationTimestamp = expirationTimestamp; + return this; + } + + /** + * The time the endpoint token will expire. In ISO-8601 format. Tokens last 24 hours. + * @return expirationTimestamp + */ + @javax.annotation.Nonnull + public OffsetDateTime getExpirationTimestamp() { + return expirationTimestamp; + } + + public void setExpirationTimestamp(@javax.annotation.Nonnull OffsetDateTime expirationTimestamp) { + this.expirationTimestamp = expirationTimestamp; + } + + + public Endpoints tag(@javax.annotation.Nullable String tag) { + this.tag = tag; + return this; + } + + /** + * A tag for the endpoint. + * @return tag + */ + @javax.annotation.Nullable + public String getTag() { + return tag; + } + + public void setTag(@javax.annotation.Nullable String tag) { + this.tag = tag; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the Endpoints instance itself + */ + public Endpoints putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Endpoints endpoints = (Endpoints) o; + return Objects.equals(this.endpointId, endpoints.endpointId) && + Objects.equals(this.type, endpoints.type) && + Objects.equals(this.status, endpoints.status) && + Objects.equals(this.creationTimestamp, endpoints.creationTimestamp) && + Objects.equals(this.expirationTimestamp, endpoints.expirationTimestamp) && + Objects.equals(this.tag, endpoints.tag)&& + Objects.equals(this.additionalProperties, endpoints.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(endpointId, type, status, creationTimestamp, expirationTimestamp, tag, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Endpoints {\n"); + sb.append(" endpointId: ").append(toIndentedString(endpointId)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" creationTimestamp: ").append(toIndentedString(creationTimestamp)).append("\n"); + sb.append(" expirationTimestamp: ").append(toIndentedString(expirationTimestamp)).append("\n"); + sb.append(" tag: ").append(toIndentedString(tag)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("endpointId", "type", "status", "creationTimestamp", "expirationTimestamp", "tag")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("endpointId", "type", "status", "creationTimestamp", "expirationTimestamp")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Endpoints + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Endpoints.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in Endpoints is not found in the empty JSON string", Endpoints.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Endpoints.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("endpointId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `endpointId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("endpointId").toString())); + } + // validate the required field `type` + EndpointTypeEnum.validateJsonElement(jsonObj.get("type")); + // validate the required field `status` + EndpointStatusEnum.validateJsonElement(jsonObj.get("status")); + if ((jsonObj.get("tag") != null && !jsonObj.get("tag").isJsonNull()) && !jsonObj.get("tag").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `tag` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tag").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Endpoints.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Endpoints' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Endpoints.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Endpoints value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public Endpoints read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + Endpoints instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Endpoints given an JSON string + * + * @param jsonString JSON string + * @return An instance of Endpoints + * @throws IOException if the JSON string is invalid with respect to Endpoints + */ + public static Endpoints fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Endpoints.class); + } + + /** + * Convert an instance of Endpoints to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/bandwidth/sdk/model/Error1.java b/src/main/java/com/bandwidth/sdk/model/Error1.java new file mode 100644 index 00000000..0f1595f5 --- /dev/null +++ b/src/main/java/com/bandwidth/sdk/model/Error1.java @@ -0,0 +1,414 @@ +/* + * Bandwidth + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.bandwidth.sdk.model; + +import java.util.Objects; +import java.util.Locale; +import com.bandwidth.sdk.model.Error1Source; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import java.util.UUID; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Locale; + +import com.bandwidth.sdk.JSON; + +/** + * Error1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0") +public class Error1 { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nonnull + private UUID id; + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull + private String type; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nonnull + private String description; + + public static final String SERIALIZED_NAME_CODE = "code"; + @SerializedName(SERIALIZED_NAME_CODE) + @javax.annotation.Nonnull + private String code; + + public static final String SERIALIZED_NAME_SOURCE = "source"; + @SerializedName(SERIALIZED_NAME_SOURCE) + @javax.annotation.Nullable + private Error1Source source; + + public Error1() { + } + + public Error1 id(@javax.annotation.Nonnull UUID id) { + this.id = id; + return this; + } + + /** + * A unique identifier for the error. + * @return id + */ + @javax.annotation.Nonnull + public UUID getId() { + return id; + } + + public void setId(@javax.annotation.Nonnull UUID id) { + this.id = id; + } + + + public Error1 type(@javax.annotation.Nonnull String type) { + this.type = type; + return this; + } + + /** + * The type of error. + * @return type + */ + @javax.annotation.Nonnull + public String getType() { + return type; + } + + public void setType(@javax.annotation.Nonnull String type) { + this.type = type; + } + + + public Error1 description(@javax.annotation.Nonnull String description) { + this.description = description; + return this; + } + + /** + * A description of the error. + * @return description + */ + @javax.annotation.Nonnull + public String getDescription() { + return description; + } + + public void setDescription(@javax.annotation.Nonnull String description) { + this.description = description; + } + + + public Error1 code(@javax.annotation.Nonnull String code) { + this.code = code; + return this; + } + + /** + * A code that uniquely identifies the error. + * @return code + */ + @javax.annotation.Nonnull + public String getCode() { + return code; + } + + public void setCode(@javax.annotation.Nonnull String code) { + this.code = code; + } + + + public Error1 source(@javax.annotation.Nullable Error1Source source) { + this.source = source; + return this; + } + + /** + * Get source + * @return source + */ + @javax.annotation.Nullable + public Error1Source getSource() { + return source; + } + + public void setSource(@javax.annotation.Nullable Error1Source source) { + this.source = source; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the Error1 instance itself + */ + public Error1 putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Error1 error1 = (Error1) o; + return Objects.equals(this.id, error1.id) && + Objects.equals(this.type, error1.type) && + Objects.equals(this.description, error1.description) && + Objects.equals(this.code, error1.code) && + Objects.equals(this.source, error1.source)&& + Objects.equals(this.additionalProperties, error1.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, description, code, source, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Error1 {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" source: ").append(toIndentedString(source)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("id", "type", "description", "code", "source")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("id", "type", "description", "code")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Error1 + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Error1.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in Error1 is not found in the empty JSON string", Error1.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Error1.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + if (!jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); + } + if (!jsonObj.get("code").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("code").toString())); + } + // validate the optional field `source` + if (jsonObj.get("source") != null && !jsonObj.get("source").isJsonNull()) { + Error1Source.validateJsonElement(jsonObj.get("source")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Error1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Error1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Error1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Error1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public Error1 read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + Error1 instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Error1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of Error1 + * @throws IOException if the JSON string is invalid with respect to Error1 + */ + public static Error1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Error1.class); + } + + /** + * Convert an instance of Error1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/bandwidth/sdk/model/Error1Source.java b/src/main/java/com/bandwidth/sdk/model/Error1Source.java new file mode 100644 index 00000000..d0bc96ac --- /dev/null +++ b/src/main/java/com/bandwidth/sdk/model/Error1Source.java @@ -0,0 +1,375 @@ +/* + * Bandwidth + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.bandwidth.sdk.model; + +import java.util.Objects; +import java.util.Locale; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Locale; + +import com.bandwidth.sdk.JSON; + +/** + * Error1Source + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0") +public class Error1Source { + public static final String SERIALIZED_NAME_PARAMETER = "parameter"; + @SerializedName(SERIALIZED_NAME_PARAMETER) + @javax.annotation.Nullable + private String parameter; + + public static final String SERIALIZED_NAME_FIELD = "field"; + @SerializedName(SERIALIZED_NAME_FIELD) + @javax.annotation.Nullable + private String field; + + public static final String SERIALIZED_NAME_HEADER = "header"; + @SerializedName(SERIALIZED_NAME_HEADER) + @javax.annotation.Nullable + private String header; + + public static final String SERIALIZED_NAME_REFERENCE = "reference"; + @SerializedName(SERIALIZED_NAME_REFERENCE) + @javax.annotation.Nullable + private String reference; + + public Error1Source() { + } + + public Error1Source parameter(@javax.annotation.Nullable String parameter) { + this.parameter = parameter; + return this; + } + + /** + * The URI parameter that caused the error. + * @return parameter + */ + @javax.annotation.Nullable + public String getParameter() { + return parameter; + } + + public void setParameter(@javax.annotation.Nullable String parameter) { + this.parameter = parameter; + } + + + public Error1Source field(@javax.annotation.Nullable String field) { + this.field = field; + return this; + } + + /** + * The request body field that caused the error. + * @return field + */ + @javax.annotation.Nullable + public String getField() { + return field; + } + + public void setField(@javax.annotation.Nullable String field) { + this.field = field; + } + + + public Error1Source header(@javax.annotation.Nullable String header) { + this.header = header; + return this; + } + + /** + * The header that caused the error. + * @return header + */ + @javax.annotation.Nullable + public String getHeader() { + return header; + } + + public void setHeader(@javax.annotation.Nullable String header) { + this.header = header; + } + + + public Error1Source reference(@javax.annotation.Nullable String reference) { + this.reference = reference; + return this; + } + + /** + * The resource ID or path to the resource (or non-existent resource) causing the error. + * @return reference + */ + @javax.annotation.Nullable + public String getReference() { + return reference; + } + + public void setReference(@javax.annotation.Nullable String reference) { + this.reference = reference; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the Error1Source instance itself + */ + public Error1Source putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Error1Source error1Source = (Error1Source) o; + return Objects.equals(this.parameter, error1Source.parameter) && + Objects.equals(this.field, error1Source.field) && + Objects.equals(this.header, error1Source.header) && + Objects.equals(this.reference, error1Source.reference)&& + Objects.equals(this.additionalProperties, error1Source.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(parameter, field, header, reference, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Error1Source {\n"); + sb.append(" parameter: ").append(toIndentedString(parameter)).append("\n"); + sb.append(" field: ").append(toIndentedString(field)).append("\n"); + sb.append(" header: ").append(toIndentedString(header)).append("\n"); + sb.append(" reference: ").append(toIndentedString(reference)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("parameter", "field", "header", "reference")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(0); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Error1Source + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Error1Source.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in Error1Source is not found in the empty JSON string", Error1Source.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("parameter") != null && !jsonObj.get("parameter").isJsonNull()) && !jsonObj.get("parameter").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `parameter` to be a primitive type in the JSON string but got `%s`", jsonObj.get("parameter").toString())); + } + if ((jsonObj.get("field") != null && !jsonObj.get("field").isJsonNull()) && !jsonObj.get("field").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `field` to be a primitive type in the JSON string but got `%s`", jsonObj.get("field").toString())); + } + if ((jsonObj.get("header") != null && !jsonObj.get("header").isJsonNull()) && !jsonObj.get("header").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `header` to be a primitive type in the JSON string but got `%s`", jsonObj.get("header").toString())); + } + if ((jsonObj.get("reference") != null && !jsonObj.get("reference").isJsonNull()) && !jsonObj.get("reference").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `reference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("reference").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Error1Source.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Error1Source' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Error1Source.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Error1Source value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public Error1Source read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + Error1Source instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Error1Source given an JSON string + * + * @param jsonString JSON string + * @return An instance of Error1Source + * @throws IOException if the JSON string is invalid with respect to Error1Source + */ + public static Error1Source fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Error1Source.class); + } + + /** + * Convert an instance of Error1Source to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/bandwidth/sdk/model/ErrorResponse.java b/src/main/java/com/bandwidth/sdk/model/ErrorResponse.java new file mode 100644 index 00000000..8c59b063 --- /dev/null +++ b/src/main/java/com/bandwidth/sdk/model/ErrorResponse.java @@ -0,0 +1,384 @@ +/* + * Bandwidth + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.bandwidth.sdk.model; + +import java.util.Objects; +import java.util.Locale; +import com.bandwidth.sdk.model.Error1; +import com.bandwidth.sdk.model.Link1; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Locale; + +import com.bandwidth.sdk.JSON; + +/** + * ErrorResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0") +public class ErrorResponse { + public static final String SERIALIZED_NAME_LINKS = "links"; + @SerializedName(SERIALIZED_NAME_LINKS) + @javax.annotation.Nonnull + private List links = new ArrayList<>(); + + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nullable + private Object data; + + public static final String SERIALIZED_NAME_ERRORS = "errors"; + @SerializedName(SERIALIZED_NAME_ERRORS) + @javax.annotation.Nonnull + private List errors = new ArrayList<>(); + + public ErrorResponse() { + } + + public ErrorResponse links(@javax.annotation.Nonnull List links) { + this.links = links; + return this; + } + + public ErrorResponse addLinksItem(Link1 linksItem) { + if (this.links == null) { + this.links = new ArrayList<>(); + } + this.links.add(linksItem); + return this; + } + + /** + * Get links + * @return links + */ + @javax.annotation.Nonnull + public List getLinks() { + return links; + } + + public void setLinks(@javax.annotation.Nonnull List links) { + this.links = links; + } + + + public ErrorResponse data(@javax.annotation.Nullable Object data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nullable + public Object getData() { + return data; + } + + public void setData(@javax.annotation.Nullable Object data) { + this.data = data; + } + + + public ErrorResponse errors(@javax.annotation.Nonnull List errors) { + this.errors = errors; + return this; + } + + public ErrorResponse addErrorsItem(Error1 errorsItem) { + if (this.errors == null) { + this.errors = new ArrayList<>(); + } + this.errors.add(errorsItem); + return this; + } + + /** + * Get errors + * @return errors + */ + @javax.annotation.Nonnull + public List getErrors() { + return errors; + } + + public void setErrors(@javax.annotation.Nonnull List errors) { + this.errors = errors; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ErrorResponse instance itself + */ + public ErrorResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ErrorResponse errorResponse = (ErrorResponse) o; + return Objects.equals(this.links, errorResponse.links) && + Objects.equals(this.data, errorResponse.data) && + Objects.equals(this.errors, errorResponse.errors)&& + Objects.equals(this.additionalProperties, errorResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(links, data, errors, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ErrorResponse {\n"); + sb.append(" links: ").append(toIndentedString(links)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" errors: ").append(toIndentedString(errors)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("links", "data", "errors")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("links", "data", "errors")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ErrorResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ErrorResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in ErrorResponse is not found in the empty JSON string", ErrorResponse.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ErrorResponse.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the json data is an array + if (!jsonObj.get("links").isJsonArray()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `links` to be an array in the JSON string but got `%s`", jsonObj.get("links").toString())); + } + + JsonArray jsonArraylinks = jsonObj.getAsJsonArray("links"); + // validate the required field `links` (array) + for (int i = 0; i < jsonArraylinks.size(); i++) { + Link1.validateJsonElement(jsonArraylinks.get(i)); + }; + // ensure the json data is an array + if (!jsonObj.get("errors").isJsonArray()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `errors` to be an array in the JSON string but got `%s`", jsonObj.get("errors").toString())); + } + + JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); + // validate the required field `errors` (array) + for (int i = 0; i < jsonArrayerrors.size(); i++) { + Error1.validateJsonElement(jsonArrayerrors.get(i)); + }; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ErrorResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ErrorResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ErrorResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ErrorResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ErrorResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ErrorResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ErrorResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of ErrorResponse + * @throws IOException if the JSON string is invalid with respect to ErrorResponse + */ + public static ErrorResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ErrorResponse.class); + } + + /** + * Convert an instance of ErrorResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/bandwidth/sdk/model/Link1.java b/src/main/java/com/bandwidth/sdk/model/Link1.java new file mode 100644 index 00000000..46428c5e --- /dev/null +++ b/src/main/java/com/bandwidth/sdk/model/Link1.java @@ -0,0 +1,404 @@ +/* + * Bandwidth + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.bandwidth.sdk.model; + +import java.util.Objects; +import java.util.Locale; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Locale; + +import com.bandwidth.sdk.JSON; + +/** + * Link1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0") +public class Link1 { + public static final String SERIALIZED_NAME_HREF = "href"; + @SerializedName(SERIALIZED_NAME_HREF) + @javax.annotation.Nullable + private String href; + + public static final String SERIALIZED_NAME_REL = "rel"; + @SerializedName(SERIALIZED_NAME_REL) + @javax.annotation.Nullable + private String rel; + + /** + * The HTTP method to use when making the request. + */ + @JsonAdapter(MethodEnum.Adapter.class) + public enum MethodEnum { + GET("GET"), + + POST("POST"), + + DELETE("DELETE"); + + private String value; + + MethodEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static MethodEnum fromValue(String value) { + for (MethodEnum b : MethodEnum.values()) { + if (b.value.equalsIgnoreCase(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final MethodEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public MethodEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return MethodEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + MethodEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_METHOD = "method"; + @SerializedName(SERIALIZED_NAME_METHOD) + @javax.annotation.Nullable + private MethodEnum method; + + public Link1() { + } + + public Link1 href(@javax.annotation.Nullable String href) { + this.href = href; + return this; + } + + /** + * The full URL of the link. + * @return href + */ + @javax.annotation.Nullable + public String getHref() { + return href; + } + + public void setHref(@javax.annotation.Nullable String href) { + this.href = href; + } + + + public Link1 rel(@javax.annotation.Nullable String rel) { + this.rel = rel; + return this; + } + + /** + * The relationship of the link to the current resource. + * @return rel + */ + @javax.annotation.Nullable + public String getRel() { + return rel; + } + + public void setRel(@javax.annotation.Nullable String rel) { + this.rel = rel; + } + + + public Link1 method(@javax.annotation.Nullable MethodEnum method) { + this.method = method; + return this; + } + + /** + * The HTTP method to use when making the request. + * @return method + */ + @javax.annotation.Nullable + public MethodEnum getMethod() { + return method; + } + + public void setMethod(@javax.annotation.Nullable MethodEnum method) { + this.method = method; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the Link1 instance itself + */ + public Link1 putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Link1 link1 = (Link1) o; + return Objects.equals(this.href, link1.href) && + Objects.equals(this.rel, link1.rel) && + Objects.equals(this.method, link1.method)&& + Objects.equals(this.additionalProperties, link1.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(href, rel, method, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Link1 {\n"); + sb.append(" href: ").append(toIndentedString(href)).append("\n"); + sb.append(" rel: ").append(toIndentedString(rel)).append("\n"); + sb.append(" method: ").append(toIndentedString(method)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("href", "rel", "method")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(0); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Link1 + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Link1.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in Link1 is not found in the empty JSON string", Link1.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("href") != null && !jsonObj.get("href").isJsonNull()) && !jsonObj.get("href").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `href` to be a primitive type in the JSON string but got `%s`", jsonObj.get("href").toString())); + } + if ((jsonObj.get("rel") != null && !jsonObj.get("rel").isJsonNull()) && !jsonObj.get("rel").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `rel` to be a primitive type in the JSON string but got `%s`", jsonObj.get("rel").toString())); + } + if ((jsonObj.get("method") != null && !jsonObj.get("method").isJsonNull()) && !jsonObj.get("method").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `method` to be a primitive type in the JSON string but got `%s`", jsonObj.get("method").toString())); + } + // validate the optional field `method` + if (jsonObj.get("method") != null && !jsonObj.get("method").isJsonNull()) { + MethodEnum.validateJsonElement(jsonObj.get("method")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Link1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Link1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Link1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Link1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public Link1 read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + Link1 instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Link1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of Link1 + * @throws IOException if the JSON string is invalid with respect to Link1 + */ + public static Link1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Link1.class); + } + + /** + * Convert an instance of Link1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/bandwidth/sdk/model/ListEndpointsResponse.java b/src/main/java/com/bandwidth/sdk/model/ListEndpointsResponse.java new file mode 100644 index 00000000..b343746a --- /dev/null +++ b/src/main/java/com/bandwidth/sdk/model/ListEndpointsResponse.java @@ -0,0 +1,434 @@ +/* + * Bandwidth + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.bandwidth.sdk.model; + +import java.util.Objects; +import java.util.Locale; +import com.bandwidth.sdk.model.Endpoints; +import com.bandwidth.sdk.model.Error1; +import com.bandwidth.sdk.model.Link1; +import com.bandwidth.sdk.model.Page; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Locale; + +import com.bandwidth.sdk.JSON; + +/** + * ListEndpointsResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0") +public class ListEndpointsResponse { + public static final String SERIALIZED_NAME_LINKS = "links"; + @SerializedName(SERIALIZED_NAME_LINKS) + @javax.annotation.Nonnull + private List links = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PAGE = "page"; + @SerializedName(SERIALIZED_NAME_PAGE) + @javax.annotation.Nullable + private Page page; + + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private List data = new ArrayList<>(); + + public static final String SERIALIZED_NAME_ERRORS = "errors"; + @SerializedName(SERIALIZED_NAME_ERRORS) + @javax.annotation.Nonnull + private List errors = new ArrayList<>(); + + public ListEndpointsResponse() { + } + + public ListEndpointsResponse links(@javax.annotation.Nonnull List links) { + this.links = links; + return this; + } + + public ListEndpointsResponse addLinksItem(Link1 linksItem) { + if (this.links == null) { + this.links = new ArrayList<>(); + } + this.links.add(linksItem); + return this; + } + + /** + * Get links + * @return links + */ + @javax.annotation.Nonnull + public List getLinks() { + return links; + } + + public void setLinks(@javax.annotation.Nonnull List links) { + this.links = links; + } + + + public ListEndpointsResponse page(@javax.annotation.Nullable Page page) { + this.page = page; + return this; + } + + /** + * Get page + * @return page + */ + @javax.annotation.Nullable + public Page getPage() { + return page; + } + + public void setPage(@javax.annotation.Nullable Page page) { + this.page = page; + } + + + public ListEndpointsResponse data(@javax.annotation.Nonnull List data) { + this.data = data; + return this; + } + + public ListEndpointsResponse addDataItem(Endpoints dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nonnull + public List getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull List data) { + this.data = data; + } + + + public ListEndpointsResponse errors(@javax.annotation.Nonnull List errors) { + this.errors = errors; + return this; + } + + public ListEndpointsResponse addErrorsItem(Error1 errorsItem) { + if (this.errors == null) { + this.errors = new ArrayList<>(); + } + this.errors.add(errorsItem); + return this; + } + + /** + * Get errors + * @return errors + */ + @javax.annotation.Nonnull + public List getErrors() { + return errors; + } + + public void setErrors(@javax.annotation.Nonnull List errors) { + this.errors = errors; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ListEndpointsResponse instance itself + */ + public ListEndpointsResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListEndpointsResponse listEndpointsResponse = (ListEndpointsResponse) o; + return Objects.equals(this.links, listEndpointsResponse.links) && + Objects.equals(this.page, listEndpointsResponse.page) && + Objects.equals(this.data, listEndpointsResponse.data) && + Objects.equals(this.errors, listEndpointsResponse.errors)&& + Objects.equals(this.additionalProperties, listEndpointsResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(links, page, data, errors, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListEndpointsResponse {\n"); + sb.append(" links: ").append(toIndentedString(links)).append("\n"); + sb.append(" page: ").append(toIndentedString(page)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" errors: ").append(toIndentedString(errors)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("links", "page", "data", "errors")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("links", "data", "errors")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ListEndpointsResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ListEndpointsResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in ListEndpointsResponse is not found in the empty JSON string", ListEndpointsResponse.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ListEndpointsResponse.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the json data is an array + if (!jsonObj.get("links").isJsonArray()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `links` to be an array in the JSON string but got `%s`", jsonObj.get("links").toString())); + } + + JsonArray jsonArraylinks = jsonObj.getAsJsonArray("links"); + // validate the required field `links` (array) + for (int i = 0; i < jsonArraylinks.size(); i++) { + Link1.validateJsonElement(jsonArraylinks.get(i)); + }; + // validate the optional field `page` + if (jsonObj.get("page") != null && !jsonObj.get("page").isJsonNull()) { + Page.validateJsonElement(jsonObj.get("page")); + } + // ensure the json data is an array + if (!jsonObj.get("data").isJsonArray()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `data` to be an array in the JSON string but got `%s`", jsonObj.get("data").toString())); + } + + JsonArray jsonArraydata = jsonObj.getAsJsonArray("data"); + // validate the required field `data` (array) + for (int i = 0; i < jsonArraydata.size(); i++) { + Endpoints.validateJsonElement(jsonArraydata.get(i)); + }; + // ensure the json data is an array + if (!jsonObj.get("errors").isJsonArray()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `errors` to be an array in the JSON string but got `%s`", jsonObj.get("errors").toString())); + } + + JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); + // validate the required field `errors` (array) + for (int i = 0; i < jsonArrayerrors.size(); i++) { + Error1.validateJsonElement(jsonArrayerrors.get(i)); + }; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ListEndpointsResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ListEndpointsResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ListEndpointsResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ListEndpointsResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ListEndpointsResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ListEndpointsResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ListEndpointsResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of ListEndpointsResponse + * @throws IOException if the JSON string is invalid with respect to ListEndpointsResponse + */ + public static ListEndpointsResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ListEndpointsResponse.class); + } + + /** + * Convert an instance of ListEndpointsResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/bandwidth/sdk/model/Page.java b/src/main/java/com/bandwidth/sdk/model/Page.java new file mode 100644 index 00000000..659aced4 --- /dev/null +++ b/src/main/java/com/bandwidth/sdk/model/Page.java @@ -0,0 +1,374 @@ +/* + * Bandwidth + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.bandwidth.sdk.model; + +import java.util.Objects; +import java.util.Locale; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Locale; + +import com.bandwidth.sdk.JSON; + +/** + * Page + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0") +public class Page { + public static final String SERIALIZED_NAME_PAGE_SIZE = "pageSize"; + @SerializedName(SERIALIZED_NAME_PAGE_SIZE) + @javax.annotation.Nonnull + private Integer pageSize; + + public static final String SERIALIZED_NAME_TOTAL_ELEMENTS = "totalElements"; + @SerializedName(SERIALIZED_NAME_TOTAL_ELEMENTS) + @javax.annotation.Nullable + private Integer totalElements; + + public static final String SERIALIZED_NAME_TOTAL_PAGES = "totalPages"; + @SerializedName(SERIALIZED_NAME_TOTAL_PAGES) + @javax.annotation.Nullable + private Integer totalPages; + + public static final String SERIALIZED_NAME_PAGE_NUMBER = "pageNumber"; + @SerializedName(SERIALIZED_NAME_PAGE_NUMBER) + @javax.annotation.Nullable + private Integer pageNumber; + + public Page() { + } + + public Page pageSize(@javax.annotation.Nonnull Integer pageSize) { + this.pageSize = pageSize; + return this; + } + + /** + * The number of items per page. + * minimum: 0 + * @return pageSize + */ + @javax.annotation.Nonnull + public Integer getPageSize() { + return pageSize; + } + + public void setPageSize(@javax.annotation.Nonnull Integer pageSize) { + this.pageSize = pageSize; + } + + + public Page totalElements(@javax.annotation.Nullable Integer totalElements) { + this.totalElements = totalElements; + return this; + } + + /** + * The total number of items. + * minimum: 0 + * @return totalElements + */ + @javax.annotation.Nullable + public Integer getTotalElements() { + return totalElements; + } + + public void setTotalElements(@javax.annotation.Nullable Integer totalElements) { + this.totalElements = totalElements; + } + + + public Page totalPages(@javax.annotation.Nullable Integer totalPages) { + this.totalPages = totalPages; + return this; + } + + /** + * The total number of pages. + * minimum: 0 + * @return totalPages + */ + @javax.annotation.Nullable + public Integer getTotalPages() { + return totalPages; + } + + public void setTotalPages(@javax.annotation.Nullable Integer totalPages) { + this.totalPages = totalPages; + } + + + public Page pageNumber(@javax.annotation.Nullable Integer pageNumber) { + this.pageNumber = pageNumber; + return this; + } + + /** + * The current page number. + * minimum: 0 + * @return pageNumber + */ + @javax.annotation.Nullable + public Integer getPageNumber() { + return pageNumber; + } + + public void setPageNumber(@javax.annotation.Nullable Integer pageNumber) { + this.pageNumber = pageNumber; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the Page instance itself + */ + public Page putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Page page = (Page) o; + return Objects.equals(this.pageSize, page.pageSize) && + Objects.equals(this.totalElements, page.totalElements) && + Objects.equals(this.totalPages, page.totalPages) && + Objects.equals(this.pageNumber, page.pageNumber)&& + Objects.equals(this.additionalProperties, page.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(pageSize, totalElements, totalPages, pageNumber, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Page {\n"); + sb.append(" pageSize: ").append(toIndentedString(pageSize)).append("\n"); + sb.append(" totalElements: ").append(toIndentedString(totalElements)).append("\n"); + sb.append(" totalPages: ").append(toIndentedString(totalPages)).append("\n"); + sb.append(" pageNumber: ").append(toIndentedString(pageNumber)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("pageSize", "totalElements", "totalPages", "pageNumber")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("pageSize")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Page + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Page.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in Page is not found in the empty JSON string", Page.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Page.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Page.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Page' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Page.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Page value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public Page read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + Page instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Page given an JSON string + * + * @param jsonString JSON string + * @return An instance of Page + * @throws IOException if the JSON string is invalid with respect to Page + */ + public static Page fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Page.class); + } + + /** + * Convert an instance of Page to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/bandwidth/sdk/model/SipConnectionMetadata.java b/src/main/java/com/bandwidth/sdk/model/SipConnectionMetadata.java new file mode 100644 index 00000000..c2434be1 --- /dev/null +++ b/src/main/java/com/bandwidth/sdk/model/SipConnectionMetadata.java @@ -0,0 +1,374 @@ +/* + * Bandwidth + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.bandwidth.sdk.model; + +import java.util.Objects; +import java.util.Locale; +import com.bandwidth.sdk.model.SipCredentials; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Locale; + +import com.bandwidth.sdk.JSON; + +/** + * SipConnectionMetadata + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0") +public class SipConnectionMetadata { + public static final String SERIALIZED_NAME_IP_ADDRESS = "ipAddress"; + @SerializedName(SERIALIZED_NAME_IP_ADDRESS) + @javax.annotation.Nullable + private String ipAddress; + + public static final String SERIALIZED_NAME_PORT = "port"; + @SerializedName(SERIALIZED_NAME_PORT) + @javax.annotation.Nullable + private Integer port; + + public static final String SERIALIZED_NAME_CREDENTIALS = "credentials"; + @SerializedName(SERIALIZED_NAME_CREDENTIALS) + @javax.annotation.Nullable + private SipCredentials credentials; + + public static final String SERIALIZED_NAME_UUI_HEADER = "uuiHeader"; + @SerializedName(SERIALIZED_NAME_UUI_HEADER) + @javax.annotation.Nullable + private String uuiHeader; + + public SipConnectionMetadata() { + } + + public SipConnectionMetadata ipAddress(@javax.annotation.Nullable String ipAddress) { + this.ipAddress = ipAddress; + return this; + } + + /** + * The IP address of the SIP connection. + * @return ipAddress + */ + @javax.annotation.Nullable + public String getIpAddress() { + return ipAddress; + } + + public void setIpAddress(@javax.annotation.Nullable String ipAddress) { + this.ipAddress = ipAddress; + } + + + public SipConnectionMetadata port(@javax.annotation.Nullable Integer port) { + this.port = port; + return this; + } + + /** + * The port of the SIP connection. + * @return port + */ + @javax.annotation.Nullable + public Integer getPort() { + return port; + } + + public void setPort(@javax.annotation.Nullable Integer port) { + this.port = port; + } + + + public SipConnectionMetadata credentials(@javax.annotation.Nullable SipCredentials credentials) { + this.credentials = credentials; + return this; + } + + /** + * Get credentials + * @return credentials + */ + @javax.annotation.Nullable + public SipCredentials getCredentials() { + return credentials; + } + + public void setCredentials(@javax.annotation.Nullable SipCredentials credentials) { + this.credentials = credentials; + } + + + public SipConnectionMetadata uuiHeader(@javax.annotation.Nullable String uuiHeader) { + this.uuiHeader = uuiHeader; + return this; + } + + /** + * The User-to-User Information header for the SIP connection. + * @return uuiHeader + */ + @javax.annotation.Nullable + public String getUuiHeader() { + return uuiHeader; + } + + public void setUuiHeader(@javax.annotation.Nullable String uuiHeader) { + this.uuiHeader = uuiHeader; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SipConnectionMetadata instance itself + */ + public SipConnectionMetadata putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SipConnectionMetadata sipConnectionMetadata = (SipConnectionMetadata) o; + return Objects.equals(this.ipAddress, sipConnectionMetadata.ipAddress) && + Objects.equals(this.port, sipConnectionMetadata.port) && + Objects.equals(this.credentials, sipConnectionMetadata.credentials) && + Objects.equals(this.uuiHeader, sipConnectionMetadata.uuiHeader)&& + Objects.equals(this.additionalProperties, sipConnectionMetadata.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(ipAddress, port, credentials, uuiHeader, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SipConnectionMetadata {\n"); + sb.append(" ipAddress: ").append(toIndentedString(ipAddress)).append("\n"); + sb.append(" port: ").append(toIndentedString(port)).append("\n"); + sb.append(" credentials: ").append(toIndentedString(credentials)).append("\n"); + sb.append(" uuiHeader: ").append(toIndentedString(uuiHeader)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("ipAddress", "port", "credentials", "uuiHeader")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(0); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SipConnectionMetadata + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SipConnectionMetadata.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in SipConnectionMetadata is not found in the empty JSON string", SipConnectionMetadata.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("ipAddress") != null && !jsonObj.get("ipAddress").isJsonNull()) && !jsonObj.get("ipAddress").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `ipAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ipAddress").toString())); + } + // validate the optional field `credentials` + if (jsonObj.get("credentials") != null && !jsonObj.get("credentials").isJsonNull()) { + SipCredentials.validateJsonElement(jsonObj.get("credentials")); + } + if ((jsonObj.get("uuiHeader") != null && !jsonObj.get("uuiHeader").isJsonNull()) && !jsonObj.get("uuiHeader").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `uuiHeader` to be a primitive type in the JSON string but got `%s`", jsonObj.get("uuiHeader").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SipConnectionMetadata.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SipConnectionMetadata' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SipConnectionMetadata.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SipConnectionMetadata value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SipConnectionMetadata read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SipConnectionMetadata instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SipConnectionMetadata given an JSON string + * + * @param jsonString JSON string + * @return An instance of SipConnectionMetadata + * @throws IOException if the JSON string is invalid with respect to SipConnectionMetadata + */ + public static SipConnectionMetadata fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SipConnectionMetadata.class); + } + + /** + * Convert an instance of SipConnectionMetadata to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/bandwidth/sdk/model/SipCredentials.java b/src/main/java/com/bandwidth/sdk/model/SipCredentials.java new file mode 100644 index 00000000..7db8bc71 --- /dev/null +++ b/src/main/java/com/bandwidth/sdk/model/SipCredentials.java @@ -0,0 +1,317 @@ +/* + * Bandwidth + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.bandwidth.sdk.model; + +import java.util.Objects; +import java.util.Locale; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Locale; + +import com.bandwidth.sdk.JSON; + +/** + * SipCredentials + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0") +public class SipCredentials { + public static final String SERIALIZED_NAME_USERNAME = "username"; + @SerializedName(SERIALIZED_NAME_USERNAME) + @javax.annotation.Nullable + private String username; + + public static final String SERIALIZED_NAME_PASSWORD = "password"; + @SerializedName(SERIALIZED_NAME_PASSWORD) + @javax.annotation.Nullable + private String password; + + public SipCredentials() { + } + + public SipCredentials username(@javax.annotation.Nullable String username) { + this.username = username; + return this; + } + + /** + * The username for the SIP connection. + * @return username + */ + @javax.annotation.Nullable + public String getUsername() { + return username; + } + + public void setUsername(@javax.annotation.Nullable String username) { + this.username = username; + } + + + public SipCredentials password(@javax.annotation.Nullable String password) { + this.password = password; + return this; + } + + /** + * The password for the SIP connection. + * @return password + */ + @javax.annotation.Nullable + public String getPassword() { + return password; + } + + public void setPassword(@javax.annotation.Nullable String password) { + this.password = password; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SipCredentials instance itself + */ + public SipCredentials putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SipCredentials sipCredentials = (SipCredentials) o; + return Objects.equals(this.username, sipCredentials.username) && + Objects.equals(this.password, sipCredentials.password)&& + Objects.equals(this.additionalProperties, sipCredentials.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(username, password, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SipCredentials {\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("username", "password")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(0); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SipCredentials + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SipCredentials.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in SipCredentials is not found in the empty JSON string", SipCredentials.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("username") != null && !jsonObj.get("username").isJsonNull()) && !jsonObj.get("username").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString())); + } + if ((jsonObj.get("password") != null && !jsonObj.get("password").isJsonNull()) && !jsonObj.get("password").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `password` to be a primitive type in the JSON string but got `%s`", jsonObj.get("password").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SipCredentials.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SipCredentials' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SipCredentials.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SipCredentials value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SipCredentials read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SipCredentials instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SipCredentials given an JSON string + * + * @param jsonString JSON string + * @return An instance of SipCredentials + * @throws IOException if the JSON string is invalid with respect to SipCredentials + */ + public static SipCredentials fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SipCredentials.class); + } + + /** + * Convert an instance of SipCredentials to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + From 3ce703ce72fc569f6d4110b5284cba1931344ab7 Mon Sep 17 00:00:00 2001 From: Sudhanshu Moghe Date: Thu, 11 Dec 2025 10:48:31 -0500 Subject: [PATCH 2/7] Implement feature X to enhance user experience and optimize performance --- bandwidth.yml | 9491 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 9490 insertions(+), 1 deletion(-) mode change 120000 => 100644 bandwidth.yml diff --git a/bandwidth.yml b/bandwidth.yml deleted file mode 120000 index 1cd9c74a..00000000 --- a/bandwidth.yml +++ /dev/null @@ -1 +0,0 @@ -/Users/smoghe/Documents/api-specs-combine-action/api-specs/bandwidth.yml \ No newline at end of file diff --git a/bandwidth.yml b/bandwidth.yml new file mode 100644 index 00000000..d5d32cf9 --- /dev/null +++ b/bandwidth.yml @@ -0,0 +1,9490 @@ +openapi: 3.0.3 +info: + title: Bandwidth + description: Bandwidth's Communication APIs + contact: + name: Bandwidth + url: https://dev.bandwidth.com + email: letstalk@bandwidth.com + version: 1.0.0 +security: + - Basic: [] + - OAuth2: [] +tags: + - name: Messages + - name: Media + - name: Multi-Channel + - name: Calls + - name: Conferences + - name: Recordings + - name: Statistics + - name: Transcriptions + - name: MFA + - name: Phone Number Lookup + - name: Toll-Free Verification + - name: Endpoints +paths: + /users/{accountId}/media: + get: + summary: List Media + description: Gets a list of your media files. No query parameters are supported. + operationId: listMedia + tags: + - Media + parameters: + - $ref: '#/components/parameters/accountId' + - $ref: '#/components/parameters/continuationToken' + responses: + '200': + $ref: '#/components/responses/listMediaResponse' + '400': + $ref: '#/components/responses/messagingBadRequestError' + '401': + $ref: '#/components/responses/messagingUnauthorizedError' + '403': + $ref: '#/components/responses/messagingForbiddenError' + '404': + $ref: '#/components/responses/messagingNotFoundError' + '406': + $ref: '#/components/responses/messagingNotAcceptableError' + '415': + $ref: '#/components/responses/messagingInvalidMediaTypeError' + '429': + $ref: '#/components/responses/messagingTooManyRequestsError' + '500': + $ref: '#/components/responses/messagingInternalServerError' + servers: &ref_0 + - url: https://messaging.bandwidth.com/api/v2 + description: Production + /users/{accountId}/media/{mediaId}: + get: + summary: Get Media + description: Downloads a media file you previously uploaded. + operationId: getMedia + tags: + - Media + parameters: + - $ref: '#/components/parameters/accountId' + - $ref: '#/components/parameters/mediaId' + responses: + '200': + $ref: '#/components/responses/getMediaResponse' + '400': + $ref: '#/components/responses/messagingBadRequestError' + '401': + $ref: '#/components/responses/messagingUnauthorizedError' + '403': + $ref: '#/components/responses/messagingForbiddenError' + '404': + $ref: '#/components/responses/messagingNotFoundError' + '406': + $ref: '#/components/responses/messagingNotAcceptableError' + '415': + $ref: '#/components/responses/messagingInvalidMediaTypeError' + '429': + $ref: '#/components/responses/messagingTooManyRequestsError' + '500': + $ref: '#/components/responses/messagingInternalServerError' + put: + summary: Upload Media + description: >- + Upload a file. You may add headers to the request in order to provide + some control to your media file. + + + If a file is uploaded with the same name as a file that already exists + under this account, the previous file will be overwritten. + + + A list of supported media types can be found + [here](https://support.bandwidth.com/hc/en-us/articles/360014128994-What-MMS-file-types-are-supported-). + operationId: uploadMedia + tags: + - Media + parameters: + - $ref: '#/components/parameters/accountId' + - $ref: '#/components/parameters/mediaId' + - $ref: '#/components/parameters/contentType' + - $ref: '#/components/parameters/cacheControl' + requestBody: + $ref: '#/components/requestBodies/uploadMediaRequest' + responses: + '204': + description: No Content + '400': + $ref: '#/components/responses/messagingBadRequestError' + '401': + $ref: '#/components/responses/messagingUnauthorizedError' + '403': + $ref: '#/components/responses/messagingForbiddenError' + '404': + $ref: '#/components/responses/messagingNotFoundError' + '406': + $ref: '#/components/responses/messagingNotAcceptableError' + '415': + $ref: '#/components/responses/messagingInvalidMediaTypeError' + '429': + $ref: '#/components/responses/messagingTooManyRequestsError' + '500': + $ref: '#/components/responses/messagingInternalServerError' + delete: + summary: Delete Media + description: |- + Deletes a media file from Bandwidth API server. Make sure you don't have + any application scripts still using the media before you delete. + + If you accidentally delete a media file you can immediately upload a new + file with the same name. + operationId: deleteMedia + tags: + - Media + parameters: + - $ref: '#/components/parameters/accountId' + - $ref: '#/components/parameters/mediaId' + responses: + '204': + description: No Content + '400': + $ref: '#/components/responses/messagingBadRequestError' + '401': + $ref: '#/components/responses/messagingUnauthorizedError' + '403': + $ref: '#/components/responses/messagingForbiddenError' + '404': + $ref: '#/components/responses/messagingNotFoundError' + '406': + $ref: '#/components/responses/messagingNotAcceptableError' + '415': + $ref: '#/components/responses/messagingInvalidMediaTypeError' + '429': + $ref: '#/components/responses/messagingTooManyRequestsError' + '500': + $ref: '#/components/responses/messagingInternalServerError' + servers: *ref_0 + /users/{accountId}/messages: + get: + summary: List Messages + description: Returns a list of messages based on query parameters. + operationId: listMessages + tags: + - Messages + parameters: + - $ref: '#/components/parameters/accountId' + - $ref: '#/components/parameters/messageId' + - $ref: '#/components/parameters/sourceTn' + - $ref: '#/components/parameters/destinationTn' + - $ref: '#/components/parameters/messageStatus' + - $ref: '#/components/parameters/messageDirection' + - $ref: '#/components/parameters/carrierName' + - $ref: '#/components/parameters/messageType' + - $ref: '#/components/parameters/errorCode' + - $ref: '#/components/parameters/fromDateTime' + - $ref: '#/components/parameters/toDateTime' + - $ref: '#/components/parameters/campaignId' + - $ref: '#/components/parameters/fromBwLatency' + - $ref: '#/components/parameters/bwQueued' + - $ref: '#/components/parameters/product' + - $ref: '#/components/parameters/location' + - $ref: '#/components/parameters/carrierQueued' + - $ref: '#/components/parameters/fromCarrierLatency' + - $ref: '#/components/parameters/callingNumberCountryA3' + - $ref: '#/components/parameters/calledNumberCountryA3' + - $ref: '#/components/parameters/fromSegmentCount' + - $ref: '#/components/parameters/toSegmentCount' + - $ref: '#/components/parameters/fromMessageSize' + - $ref: '#/components/parameters/toMessageSize' + - $ref: '#/components/parameters/sort' + - $ref: '#/components/parameters/pageToken' + - $ref: '#/components/parameters/limit' + - $ref: '#/components/parameters/limitTotalCount' + responses: + '200': + $ref: '#/components/responses/listMessagesResponse' + '400': + $ref: '#/components/responses/messagingBadRequestError' + '401': + $ref: '#/components/responses/messagingUnauthorizedError' + '403': + $ref: '#/components/responses/messagingForbiddenError' + '404': + $ref: '#/components/responses/messagingNotFoundError' + '415': + $ref: '#/components/responses/messagingInvalidMediaTypeError' + '429': + $ref: '#/components/responses/messagingTooManyRequestsError' + '500': + $ref: '#/components/responses/messagingInternalServerError' + post: + summary: Create Message + description: >- + Endpoint for sending text messages and picture messages using V2 + messaging. + operationId: createMessage + tags: + - Messages + parameters: + - $ref: '#/components/parameters/accountId' + requestBody: + $ref: '#/components/requestBodies/createMessageRequest' + responses: + '202': + $ref: '#/components/responses/createMessageResponse' + '400': + $ref: '#/components/responses/createMessageBadRequestError' + '401': + $ref: '#/components/responses/messagingUnauthorizedError' + '403': + $ref: '#/components/responses/messagingForbiddenError' + '404': + $ref: '#/components/responses/messagingNotFoundError' + '405': + $ref: '#/components/responses/messagingMethodNotAllowedError' + '406': + $ref: '#/components/responses/messagingNotAcceptableError' + '415': + $ref: '#/components/responses/messagingInvalidMediaTypeError' + '429': + $ref: '#/components/responses/messagingTooManyRequestsError' + '500': + $ref: '#/components/responses/messagingInternalServerError' + callbacks: + statusCallback: + $ref: '#/components/callbacks/statusCallback' + servers: *ref_0 + /users/{accountId}/messages/multiChannel: + post: + summary: Create Multi-Channel Message + description: Endpoint for sending Multi-Channel messages. + operationId: createMultiChannelMessage + parameters: + - $ref: '#/components/parameters/accountId' + tags: + - Multi-Channel + requestBody: + $ref: '#/components/requestBodies/createMultiChannelMessageRequest' + responses: + '202': + $ref: '#/components/responses/createMultiChannelMessageResponse' + '400': + $ref: '#/components/responses/multiChannelBadRequestError' + '401': + $ref: '#/components/responses/multiChannelUnauthorizedError' + '403': + $ref: '#/components/responses/multiChannelForbiddenError' + '404': + $ref: '#/components/responses/multiChannelNotFoundError' + '405': + $ref: '#/components/responses/multiChannelMethodNotAllowedError' + '406': + $ref: '#/components/responses/multiChannelNotAcceptableError' + '415': + $ref: '#/components/responses/multiChannelInvalidMediaTypeError' + '429': + $ref: '#/components/responses/multiChannelTooManyRequestsError' + '500': + $ref: '#/components/responses/multiChannelInternalServerError' + callbacks: + statusCallback: + $ref: '#/components/callbacks/statusCallback' + x-badges: + - name: Beta + color: '#076EA8' + servers: *ref_0 + /accounts/{accountId}/calls: + post: + tags: + - Calls + summary: Create Call + description: >- + Creates an outbound phone call. + + + All calls are initially queued. Your outbound calls will initiated at a + specific dequeueing rate, enabling your application to "fire and forget" + when creating calls. Queued calls may not be modified until they are + dequeued and placed, but may be removed from your queue on demand. + + + Please note: Calls submitted to your queue will be placed + approximately in order, but exact ordering is not guaranteed. + operationId: createCall + parameters: + - $ref: '#/components/parameters/accountId' + requestBody: + $ref: '#/components/requestBodies/createCallRequest' + responses: + '201': + $ref: '#/components/responses/createCallResponse' + '400': + $ref: '#/components/responses/voiceBadRequestError' + '401': + $ref: '#/components/responses/voiceUnauthorizedError' + '403': + $ref: '#/components/responses/voiceForbiddenError' + '404': + $ref: '#/components/responses/voiceNotFoundError' + '405': + $ref: '#/components/responses/voiceNotAllowedError' + '415': + $ref: '#/components/responses/voiceUnsupportedMediaTypeError' + '429': + $ref: '#/components/responses/voiceTooManyRequestsError' + '500': + $ref: '#/components/responses/voiceInternalServerError' + get: + tags: + - Calls + summary: Get Calls + description: >- + Returns a max of 10000 calls, sorted by `createdTime` from oldest to + newest. + + + **NOTE:** If the number of calls in the account is bigger than + `pageSize`, a `Link` header (with format `<{url}>; rel="next"`) will be + returned in the response. The url can be used to retrieve the next page + of call records. + + Also, call information is kept for 7 days after the calls are hung up. + If you attempt to retrieve information for a call that is older than 7 + days, you will get an empty array [] in response. + operationId: listCalls + parameters: + - $ref: '#/components/parameters/accountId' + - $ref: '#/components/parameters/to' + - $ref: '#/components/parameters/from' + - $ref: '#/components/parameters/minStartTimeCalls' + - $ref: '#/components/parameters/maxStartTimeCalls' + - $ref: '#/components/parameters/disconnectCause' + - $ref: '#/components/parameters/pageSizeCalls' + - $ref: '#/components/parameters/pageToken1' + responses: + '200': + $ref: '#/components/responses/listCallsResponse' + '400': + $ref: '#/components/responses/voiceBadRequestError' + '401': + $ref: '#/components/responses/voiceUnauthorizedError' + '403': + $ref: '#/components/responses/voiceForbiddenError' + '404': + $ref: '#/components/responses/voiceNotFoundError' + '405': + $ref: '#/components/responses/voiceNotAllowedError' + '415': + $ref: '#/components/responses/voiceUnsupportedMediaTypeError' + '429': + $ref: '#/components/responses/voiceTooManyRequestsError' + '500': + $ref: '#/components/responses/voiceInternalServerError' + servers: &ref_1 + - url: https://voice.bandwidth.com/api/v2 + description: Production + /accounts/{accountId}/calls/{callId}: + get: + tags: + - Calls + summary: Get Call State Information + description: >- + Retrieve the current state of a specific call. This information is + near-realtime, so it may take a few minutes for your call to be + accessible using this endpoint. + + + **Note**: Call information is kept for 7 days after the calls are hung + up. If you attempt to retrieve information for a call that is older than + 7 days, you will get an HTTP 404 response. + operationId: getCallState + parameters: + - $ref: '#/components/parameters/accountId' + - $ref: '#/components/parameters/callId' + responses: + '200': + $ref: '#/components/responses/getCallStateResponse' + '400': + $ref: '#/components/responses/voiceBadRequestError' + '401': + $ref: '#/components/responses/voiceUnauthorizedError' + '403': + $ref: '#/components/responses/voiceForbiddenError' + '404': + $ref: '#/components/responses/voiceNotFoundError' + '405': + $ref: '#/components/responses/voiceNotAllowedError' + '415': + $ref: '#/components/responses/voiceUnsupportedMediaTypeError' + '429': + $ref: '#/components/responses/voiceTooManyRequestsError' + '500': + $ref: '#/components/responses/voiceInternalServerError' + post: + tags: + - Calls + summary: Update Call + description: >- + Interrupts and redirects a call to a different URL that should return a + BXML document. + operationId: updateCall + parameters: + - $ref: '#/components/parameters/accountId' + - $ref: '#/components/parameters/callId' + requestBody: + $ref: '#/components/requestBodies/updateCallRequest' + responses: + '200': + $ref: '#/components/responses/updateCallResponse' + '400': + $ref: '#/components/responses/voiceBadRequestError' + '401': + $ref: '#/components/responses/voiceUnauthorizedError' + '403': + $ref: '#/components/responses/voiceForbiddenError' + '404': + $ref: '#/components/responses/voiceNotFoundError' + '405': + $ref: '#/components/responses/voiceNotAllowedError' + '409': + $ref: '#/components/responses/voiceConflictError' + '415': + $ref: '#/components/responses/voiceUnsupportedMediaTypeError' + '429': + $ref: '#/components/responses/voiceTooManyRequestsError' + '500': + $ref: '#/components/responses/voiceInternalServerError' + servers: *ref_1 + /accounts/{accountId}/calls/{callId}/bxml: + put: + tags: + - Calls + summary: Update Call BXML + description: Interrupts and replaces an active call's BXML document. + operationId: updateCallBxml + parameters: + - $ref: '#/components/parameters/accountId' + - $ref: '#/components/parameters/callId' + requestBody: + $ref: '#/components/requestBodies/updateCallBxmlRequest' + responses: + '204': + description: Call BXML was successfully replaced. + '400': + $ref: '#/components/responses/voiceBadRequestError' + '401': + $ref: '#/components/responses/voiceUnauthorizedError' + '403': + $ref: '#/components/responses/voiceForbiddenError' + '404': + $ref: '#/components/responses/voiceNotFoundError' + '405': + $ref: '#/components/responses/voiceNotAllowedError' + '409': + $ref: '#/components/responses/voiceConflictError' + '415': + $ref: '#/components/responses/voiceUnsupportedMediaTypeError' + '429': + $ref: '#/components/responses/voiceTooManyRequestsError' + '500': + $ref: '#/components/responses/voiceInternalServerError' + servers: *ref_1 + /accounts/{accountId}/conferences: + get: + tags: + - Conferences + summary: Get Conferences + description: >- + Returns a max of 1000 conferences, sorted by `createdTime` from oldest + to newest. + + + **NOTE:** If the number of conferences in the account is bigger than + `pageSize`, a `Link` header (with format `<{url}>; rel="next"`) will be + returned in the response. The url can be used to retrieve the next page + of conference records. + operationId: listConferences + parameters: + - $ref: '#/components/parameters/accountId' + - $ref: '#/components/parameters/name' + - $ref: '#/components/parameters/minCreatedTime' + - $ref: '#/components/parameters/maxCreatedTime' + - $ref: '#/components/parameters/pageSize' + - $ref: '#/components/parameters/pageToken1' + responses: + '200': + $ref: '#/components/responses/listConferencesResponse' + '400': + $ref: '#/components/responses/voiceBadRequestError' + '401': + $ref: '#/components/responses/voiceUnauthorizedError' + '403': + $ref: '#/components/responses/voiceForbiddenError' + '404': + $ref: '#/components/responses/voiceNotFoundError' + '405': + $ref: '#/components/responses/voiceNotAllowedError' + '415': + $ref: '#/components/responses/voiceUnsupportedMediaTypeError' + '429': + $ref: '#/components/responses/voiceTooManyRequestsError' + '500': + $ref: '#/components/responses/voiceInternalServerError' + servers: *ref_1 + /accounts/{accountId}/conferences/{conferenceId}: + get: + tags: + - Conferences + summary: Get Conference Information + description: Returns information about the specified conference. + operationId: getConference + parameters: + - $ref: '#/components/parameters/accountId' + - $ref: '#/components/parameters/conferenceId' + responses: + '200': + $ref: '#/components/responses/getConferenceResponse' + '400': + $ref: '#/components/responses/voiceBadRequestError' + '401': + $ref: '#/components/responses/voiceUnauthorizedError' + '403': + $ref: '#/components/responses/voiceForbiddenError' + '404': + $ref: '#/components/responses/voiceNotFoundError' + '405': + $ref: '#/components/responses/voiceNotAllowedError' + '415': + $ref: '#/components/responses/voiceUnsupportedMediaTypeError' + '429': + $ref: '#/components/responses/voiceTooManyRequestsError' + '500': + $ref: '#/components/responses/voiceInternalServerError' + post: + tags: + - Conferences + summary: Update Conference + description: Update the conference state. + operationId: updateConference + parameters: + - $ref: '#/components/parameters/accountId' + - $ref: '#/components/parameters/conferenceId' + requestBody: + $ref: '#/components/requestBodies/updateConferenceRequest' + responses: + '204': + description: Conference was successfully modified. + '400': + $ref: '#/components/responses/voiceBadRequestError' + '401': + $ref: '#/components/responses/voiceUnauthorizedError' + '403': + $ref: '#/components/responses/voiceForbiddenError' + '404': + $ref: '#/components/responses/voiceNotFoundError' + '405': + $ref: '#/components/responses/voiceNotAllowedError' + '415': + $ref: '#/components/responses/voiceUnsupportedMediaTypeError' + '429': + $ref: '#/components/responses/voiceTooManyRequestsError' + '500': + $ref: '#/components/responses/voiceInternalServerError' + servers: *ref_1 + /accounts/{accountId}/conferences/{conferenceId}/bxml: + put: + tags: + - Conferences + summary: Update Conference BXML + description: Update the conference BXML document. + operationId: updateConferenceBxml + parameters: + - $ref: '#/components/parameters/accountId' + - $ref: '#/components/parameters/conferenceId' + requestBody: + $ref: '#/components/requestBodies/updateConferenceBxmlRequest' + responses: + '204': + description: Conference successfully modified. + '400': + $ref: '#/components/responses/voiceBadRequestError' + '401': + $ref: '#/components/responses/voiceUnauthorizedError' + '403': + $ref: '#/components/responses/voiceForbiddenError' + '404': + $ref: '#/components/responses/voiceNotFoundError' + '405': + $ref: '#/components/responses/voiceNotAllowedError' + '415': + $ref: '#/components/responses/voiceUnsupportedMediaTypeError' + '429': + $ref: '#/components/responses/voiceTooManyRequestsError' + '500': + $ref: '#/components/responses/voiceInternalServerError' + servers: *ref_1 + /accounts/{accountId}/conferences/{conferenceId}/members/{memberId}: + get: + tags: + - Conferences + summary: Get Conference Member + description: Returns information about the specified conference member. + operationId: getConferenceMember + parameters: + - $ref: '#/components/parameters/accountId' + - $ref: '#/components/parameters/conferenceId' + - $ref: '#/components/parameters/memberId' + responses: + '200': + $ref: '#/components/responses/getConferenceMemberResponse' + '400': + $ref: '#/components/responses/voiceBadRequestError' + '401': + $ref: '#/components/responses/voiceUnauthorizedError' + '403': + $ref: '#/components/responses/voiceForbiddenError' + '404': + $ref: '#/components/responses/voiceNotFoundError' + '405': + $ref: '#/components/responses/voiceNotAllowedError' + '415': + $ref: '#/components/responses/voiceUnsupportedMediaTypeError' + '429': + $ref: '#/components/responses/voiceTooManyRequestsError' + '500': + $ref: '#/components/responses/voiceInternalServerError' + put: + tags: + - Conferences + summary: Update Conference Member + description: Updates settings for a particular conference member. + operationId: updateConferenceMember + parameters: + - $ref: '#/components/parameters/accountId' + - $ref: '#/components/parameters/conferenceId' + - $ref: '#/components/parameters/memberId' + requestBody: + $ref: '#/components/requestBodies/updateConferenceMemberRequest' + responses: + '204': + description: Conference member was successfully modified. + '400': + $ref: '#/components/responses/voiceBadRequestError' + '401': + $ref: '#/components/responses/voiceUnauthorizedError' + '403': + $ref: '#/components/responses/voiceForbiddenError' + '404': + $ref: '#/components/responses/voiceNotFoundError' + '405': + $ref: '#/components/responses/voiceNotAllowedError' + '415': + $ref: '#/components/responses/voiceUnsupportedMediaTypeError' + '429': + $ref: '#/components/responses/voiceTooManyRequestsError' + '500': + $ref: '#/components/responses/voiceInternalServerError' + servers: *ref_1 + /accounts/{accountId}/conferences/{conferenceId}/recordings: + get: + tags: + - Conferences + summary: Get Conference Recordings + description: >- + Returns a (potentially empty) list of metadata for the recordings that + took place during the specified conference. + operationId: listConferenceRecordings + parameters: + - $ref: '#/components/parameters/accountId' + - $ref: '#/components/parameters/conferenceId' + responses: + '200': + $ref: '#/components/responses/listConferenceRecordingsResponse' + '400': + $ref: '#/components/responses/voiceBadRequestError' + '401': + $ref: '#/components/responses/voiceUnauthorizedError' + '403': + $ref: '#/components/responses/voiceForbiddenError' + '404': + $ref: '#/components/responses/voiceNotFoundError' + '405': + $ref: '#/components/responses/voiceNotAllowedError' + '415': + $ref: '#/components/responses/voiceUnsupportedMediaTypeError' + '429': + $ref: '#/components/responses/voiceTooManyRequestsError' + '500': + $ref: '#/components/responses/voiceInternalServerError' + servers: *ref_1 + /accounts/{accountId}/conferences/{conferenceId}/recordings/{recordingId}: + get: + tags: + - Conferences + summary: Get Conference Recording Information + description: Returns metadata for the specified recording. + operationId: getConferenceRecording + parameters: + - $ref: '#/components/parameters/accountId' + - $ref: '#/components/parameters/conferenceId' + - $ref: '#/components/parameters/recordingId' + responses: + '200': + $ref: '#/components/responses/getConferenceRecordingResponse' + '400': + $ref: '#/components/responses/voiceBadRequestError' + '401': + $ref: '#/components/responses/voiceUnauthorizedError' + '403': + $ref: '#/components/responses/voiceForbiddenError' + '404': + $ref: '#/components/responses/voiceNotFoundError' + '405': + $ref: '#/components/responses/voiceNotAllowedError' + '415': + $ref: '#/components/responses/voiceUnsupportedMediaTypeError' + '429': + $ref: '#/components/responses/voiceTooManyRequestsError' + '500': + $ref: '#/components/responses/voiceInternalServerError' + servers: *ref_1 + /accounts/{accountId}/conferences/{conferenceId}/recordings/{recordingId}/media: + get: + tags: + - Conferences + summary: Download Conference Recording + description: Downloads the specified recording file. + operationId: downloadConferenceRecording + parameters: + - $ref: '#/components/parameters/accountId' + - $ref: '#/components/parameters/conferenceId' + - $ref: '#/components/parameters/recordingId' + responses: + '200': + $ref: '#/components/responses/downloadRecordingMediaResponse' + '400': + $ref: '#/components/responses/voiceBadRequestError' + '401': + $ref: '#/components/responses/voiceUnauthorizedError' + '403': + $ref: '#/components/responses/voiceForbiddenError' + '404': + $ref: '#/components/responses/voiceNotFoundError' + '405': + $ref: '#/components/responses/voiceNotAllowedError' + '415': + $ref: '#/components/responses/voiceUnsupportedMediaTypeError' + '429': + $ref: '#/components/responses/voiceTooManyRequestsError' + '500': + $ref: '#/components/responses/voiceInternalServerError' + servers: *ref_1 + /accounts/{accountId}/recordings: + get: + tags: + - Recordings + summary: Get Call Recordings + description: >- + Returns a list of metadata for the recordings associated with the + + specified account. The list can be filtered by the optional from, to, + minStartTime, + + and maxStartTime arguments. The list is capped at 1000 entries and may + be + + empty if no recordings match the specified criteria. + operationId: listAccountCallRecordings + parameters: + - $ref: '#/components/parameters/accountId' + - $ref: '#/components/parameters/to' + - $ref: '#/components/parameters/from' + - $ref: '#/components/parameters/minStartTime' + - $ref: '#/components/parameters/maxStartTime' + responses: + '200': + $ref: '#/components/responses/listCallRecordingsResponse' + '400': + $ref: '#/components/responses/voiceBadRequestError' + '401': + $ref: '#/components/responses/voiceUnauthorizedError' + '403': + $ref: '#/components/responses/voiceForbiddenError' + '404': + $ref: '#/components/responses/voiceNotFoundError' + '405': + $ref: '#/components/responses/voiceNotAllowedError' + '415': + $ref: '#/components/responses/voiceUnsupportedMediaTypeError' + '429': + $ref: '#/components/responses/voiceTooManyRequestsError' + '500': + $ref: '#/components/responses/voiceInternalServerError' + servers: *ref_1 + /accounts/{accountId}/calls/{callId}/recording: + put: + tags: + - Recordings + summary: Update Recording + description: Pause or resume a recording on an active phone call. + operationId: updateCallRecordingState + parameters: + - $ref: '#/components/parameters/accountId' + - $ref: '#/components/parameters/callId' + requestBody: + $ref: '#/components/requestBodies/updateCallRecordingRequest' + responses: + '200': + $ref: '#/components/responses/updateRecordingResponse' + '400': + $ref: '#/components/responses/voiceBadRequestError' + '401': + $ref: '#/components/responses/voiceUnauthorizedError' + '403': + $ref: '#/components/responses/voiceForbiddenError' + '404': + $ref: '#/components/responses/voiceNotFoundError' + '405': + $ref: '#/components/responses/voiceNotAllowedError' + '415': + $ref: '#/components/responses/voiceUnsupportedMediaTypeError' + '429': + $ref: '#/components/responses/voiceTooManyRequestsError' + '500': + $ref: '#/components/responses/voiceInternalServerError' + servers: *ref_1 + /accounts/{accountId}/calls/{callId}/recordings: + get: + tags: + - Recordings + summary: List Call Recordings + description: |- + Returns a (potentially empty) list of metadata for the recordings + that took place during the specified call. + operationId: listCallRecordings + parameters: + - $ref: '#/components/parameters/accountId' + - $ref: '#/components/parameters/callId' + responses: + '200': + $ref: '#/components/responses/listCallRecordingsResponse' + '400': + $ref: '#/components/responses/voiceBadRequestError' + '401': + $ref: '#/components/responses/voiceUnauthorizedError' + '403': + $ref: '#/components/responses/voiceForbiddenError' + '404': + $ref: '#/components/responses/voiceNotFoundError' + '405': + $ref: '#/components/responses/voiceNotAllowedError' + '415': + $ref: '#/components/responses/voiceUnsupportedMediaTypeError' + '429': + $ref: '#/components/responses/voiceTooManyRequestsError' + '500': + $ref: '#/components/responses/voiceInternalServerError' + servers: *ref_1 + /accounts/{accountId}/calls/{callId}/recordings/{recordingId}: + get: + tags: + - Recordings + summary: Get Call Recording + description: Returns metadata for the specified recording. + operationId: getCallRecording + parameters: + - $ref: '#/components/parameters/accountId' + - $ref: '#/components/parameters/callId' + - $ref: '#/components/parameters/recordingId' + responses: + '200': + $ref: '#/components/responses/getCallRecordingResponse' + '400': + $ref: '#/components/responses/voiceBadRequestError' + '401': + $ref: '#/components/responses/voiceUnauthorizedError' + '403': + $ref: '#/components/responses/voiceForbiddenError' + '404': + $ref: '#/components/responses/voiceNotFoundError' + '405': + $ref: '#/components/responses/voiceNotAllowedError' + '415': + $ref: '#/components/responses/voiceUnsupportedMediaTypeError' + '429': + $ref: '#/components/responses/voiceTooManyRequestsError' + '500': + $ref: '#/components/responses/voiceInternalServerError' + delete: + tags: + - Recordings + summary: Delete Recording + description: >- + Delete the recording information, media and transcription. + + + Note: After the deletion is requested and a `204` is returned, neither + the recording metadata nor the actual media nor its transcription will + be accessible anymore. However, the media of the specified recording is + not deleted immediately. This deletion process, while transparent and + irreversible, can take an additional 24 to 48 hours. + operationId: deleteRecording + parameters: + - $ref: '#/components/parameters/accountId' + - $ref: '#/components/parameters/callId' + - $ref: '#/components/parameters/recordingId' + responses: + '204': + description: Recording was deleted. + '400': + $ref: '#/components/responses/voiceBadRequestError' + '401': + $ref: '#/components/responses/voiceUnauthorizedError' + '403': + $ref: '#/components/responses/voiceForbiddenError' + '404': + $ref: '#/components/responses/voiceNotFoundError' + '405': + $ref: '#/components/responses/voiceNotAllowedError' + '415': + $ref: '#/components/responses/voiceUnsupportedMediaTypeError' + '429': + $ref: '#/components/responses/voiceTooManyRequestsError' + '500': + $ref: '#/components/responses/voiceInternalServerError' + servers: *ref_1 + /accounts/{accountId}/calls/{callId}/recordings/{recordingId}/media: + get: + tags: + - Recordings + summary: Download Recording + description: Downloads the specified recording. + operationId: downloadCallRecording + parameters: + - $ref: '#/components/parameters/accountId' + - $ref: '#/components/parameters/callId' + - $ref: '#/components/parameters/recordingId' + responses: + '200': + $ref: '#/components/responses/downloadRecordingMediaResponse' + '400': + $ref: '#/components/responses/voiceBadRequestError' + '401': + $ref: '#/components/responses/voiceUnauthorizedError' + '403': + $ref: '#/components/responses/voiceForbiddenError' + '404': + $ref: '#/components/responses/voiceNotFoundError' + '405': + $ref: '#/components/responses/voiceNotAllowedError' + '415': + $ref: '#/components/responses/voiceUnsupportedMediaTypeError' + '429': + $ref: '#/components/responses/voiceTooManyRequestsError' + '500': + $ref: '#/components/responses/voiceInternalServerError' + delete: + tags: + - Recordings + summary: Delete Recording Media + description: Deletes the specified recording's media. + operationId: deleteRecordingMedia + parameters: + - $ref: '#/components/parameters/accountId' + - $ref: '#/components/parameters/callId' + - $ref: '#/components/parameters/recordingId' + responses: + '204': + description: The recording media was successfully deleted. + '400': + $ref: '#/components/responses/voiceBadRequestError' + '401': + $ref: '#/components/responses/voiceUnauthorizedError' + '403': + $ref: '#/components/responses/voiceForbiddenError' + '404': + $ref: '#/components/responses/voiceNotFoundError' + '405': + $ref: '#/components/responses/voiceNotAllowedError' + '415': + $ref: '#/components/responses/voiceUnsupportedMediaTypeError' + '429': + $ref: '#/components/responses/voiceTooManyRequestsError' + '500': + $ref: '#/components/responses/voiceInternalServerError' + servers: *ref_1 + /accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription: + get: + tags: + - Recordings + summary: Get Transcription + description: >- + Downloads the specified transcription. + + If the recording was multi-channel, then there will be 2 transcripts. + + The caller/called party transcript will be the first item while + [``](/docs/voice/bxml/playAudio) and + [``](/docs/voice/bxml/speakSentence) transcript will be + the second item. + + During a [``](/docs/voice/bxml/transfer) the A-leg transcript + will be the first item while the B-leg transcript will be the second + item. + operationId: getRecordingTranscription + parameters: + - $ref: '#/components/parameters/accountId' + - $ref: '#/components/parameters/callId' + - $ref: '#/components/parameters/recordingId' + responses: + '200': + $ref: '#/components/responses/getRecordingTranscriptionResponse' + '400': + $ref: '#/components/responses/voiceBadRequestError' + '401': + $ref: '#/components/responses/voiceUnauthorizedError' + '403': + $ref: '#/components/responses/voiceForbiddenError' + '404': + $ref: '#/components/responses/voiceNotFoundError' + '405': + $ref: '#/components/responses/voiceNotAllowedError' + '415': + $ref: '#/components/responses/voiceUnsupportedMediaTypeError' + '429': + $ref: '#/components/responses/voiceTooManyRequestsError' + '500': + $ref: '#/components/responses/voiceInternalServerError' + post: + tags: + - Recordings + summary: Create Transcription Request + description: >- + Generate the transcription for a specific recording. Transcription + + can succeed only for recordings of length greater than 500 milliseconds + and + + less than 4 hours. + operationId: transcribeCallRecording + parameters: + - $ref: '#/components/parameters/accountId' + - $ref: '#/components/parameters/callId' + - $ref: '#/components/parameters/recordingId' + requestBody: + $ref: '#/components/requestBodies/transcribeRecordingRequest' + responses: + '204': + description: Transcription was successfully requested. + '400': + $ref: '#/components/responses/voiceBadRequestError' + '401': + $ref: '#/components/responses/voiceUnauthorizedError' + '403': + $ref: '#/components/responses/voiceForbiddenError' + '404': + $ref: '#/components/responses/voiceNotFoundError' + '405': + $ref: '#/components/responses/voiceNotAllowedError' + '415': + $ref: '#/components/responses/voiceUnsupportedMediaTypeError' + '429': + $ref: '#/components/responses/voiceTooManyRequestsError' + '500': + $ref: '#/components/responses/voiceInternalServerError' + delete: + tags: + - Recordings + summary: Delete Transcription + description: >- + Deletes the specified recording's transcription. + + + Note: After the deletion is requested and a `204` is returned, the + transcription will not be accessible anymore. However, it is not deleted + immediately. This deletion process, while transparent and irreversible, + can take an additional 24 to 48 hours. + operationId: deleteRecordingTranscription + parameters: + - $ref: '#/components/parameters/accountId' + - $ref: '#/components/parameters/callId' + - $ref: '#/components/parameters/recordingId' + responses: + '204': + description: The transcription was successfully deleted. + '400': + $ref: '#/components/responses/voiceBadRequestError' + '401': + $ref: '#/components/responses/voiceUnauthorizedError' + '403': + $ref: '#/components/responses/voiceForbiddenError' + '404': + $ref: '#/components/responses/voiceNotFoundError' + '405': + $ref: '#/components/responses/voiceNotAllowedError' + '415': + $ref: '#/components/responses/voiceUnsupportedMediaTypeError' + '429': + $ref: '#/components/responses/voiceTooManyRequestsError' + '500': + $ref: '#/components/responses/voiceInternalServerError' + servers: *ref_1 + /accounts/{accountId}/statistics: + get: + tags: + - Statistics + summary: Get Account Statistics + description: Returns details about the current state of the account. + operationId: getStatistics + parameters: + - $ref: '#/components/parameters/accountId' + responses: + '200': + $ref: '#/components/responses/getStatisticsResponse' + '400': + $ref: '#/components/responses/voiceBadRequestError' + '401': + $ref: '#/components/responses/voiceUnauthorizedError' + '403': + $ref: '#/components/responses/voiceForbiddenError' + '404': + $ref: '#/components/responses/voiceNotFoundError' + '405': + $ref: '#/components/responses/voiceNotAllowedError' + '415': + $ref: '#/components/responses/voiceUnsupportedMediaTypeError' + '429': + $ref: '#/components/responses/voiceTooManyRequestsError' + '500': + $ref: '#/components/responses/voiceInternalServerError' + servers: *ref_1 + /accounts/{accountId}/calls/{callId}/transcriptions: + get: + tags: + - Transcriptions + summary: List Real-time Transcriptions + description: >- + List the transcriptions created on this call via + [startTranscription](/docs/voice/bxml/startTranscription). + operationId: listRealTimeTranscriptions + parameters: + - $ref: '#/components/parameters/accountId' + - $ref: '#/components/parameters/callId' + responses: + '200': + $ref: '#/components/responses/listTranscriptionsResponse' + '400': + $ref: '#/components/responses/voiceBadRequestError' + '401': + $ref: '#/components/responses/voiceUnauthorizedError' + '403': + $ref: '#/components/responses/voiceForbiddenError' + '404': + $ref: '#/components/responses/voiceNotFoundError' + '405': + $ref: '#/components/responses/voiceNotAllowedError' + '415': + $ref: '#/components/responses/voiceUnsupportedMediaTypeError' + '429': + $ref: '#/components/responses/voiceTooManyRequestsError' + '500': + $ref: '#/components/responses/voiceInternalServerError' + servers: *ref_1 + /accounts/{accountId}/calls/{callId}/transcriptions/{transcriptionId}: + get: + tags: + - Transcriptions + summary: Get Real-time Transcription + description: >- + Retrieve the specified transcription that was created on this call via + [startTranscription](/docs/voice/bxml/startTranscription). + operationId: getRealTimeTranscription + parameters: + - $ref: '#/components/parameters/accountId' + - $ref: '#/components/parameters/callId' + - $ref: '#/components/parameters/transcriptionId' + responses: + '200': + $ref: '#/components/responses/getCallTranscriptionResponse' + '400': + $ref: '#/components/responses/voiceBadRequestError' + '401': + $ref: '#/components/responses/voiceUnauthorizedError' + '403': + $ref: '#/components/responses/voiceForbiddenError' + '404': + $ref: '#/components/responses/voiceNotFoundError' + '405': + $ref: '#/components/responses/voiceNotAllowedError' + '415': + $ref: '#/components/responses/voiceUnsupportedMediaTypeError' + '429': + $ref: '#/components/responses/voiceTooManyRequestsError' + '500': + $ref: '#/components/responses/voiceInternalServerError' + delete: + tags: + - Transcriptions + summary: Delete Real-time Transcription + description: >- + Delete the specified transcription that was created on this call via + [startTranscription](/docs/voice/bxml/startTranscription). + + + Note: After the deletion is requested and a `200` is returned, the + transcription will not be accessible anymore. However, it is not deleted + immediately. This deletion process, while transparent and irreversible, + can take an additional 24 to 48 hours. + operationId: deleteRealTimeTranscription + parameters: + - $ref: '#/components/parameters/accountId' + - $ref: '#/components/parameters/callId' + - $ref: '#/components/parameters/transcriptionId' + responses: + '200': + $ref: '#/components/responses/deleteCallTranscriptionResponse' + '400': + $ref: '#/components/responses/voiceBadRequestError' + '401': + $ref: '#/components/responses/voiceUnauthorizedError' + '403': + $ref: '#/components/responses/voiceForbiddenError' + '404': + $ref: '#/components/responses/voiceNotFoundError' + '405': + $ref: '#/components/responses/voiceNotAllowedError' + '415': + $ref: '#/components/responses/voiceUnsupportedMediaTypeError' + '429': + $ref: '#/components/responses/voiceTooManyRequestsError' + '500': + $ref: '#/components/responses/voiceInternalServerError' + servers: *ref_1 + /accounts/{accountId}/code/voice: + post: + tags: + - MFA + summary: Voice Authentication Code + description: Send an MFA Code via a phone call. + operationId: generateVoiceCode + parameters: + - $ref: '#/components/parameters/accountId' + requestBody: + $ref: '#/components/requestBodies/codeRequest' + responses: + '200': + $ref: '#/components/responses/voiceCodeResponse' + '400': + $ref: '#/components/responses/mfaBadRequestError' + '401': + $ref: '#/components/responses/mfaUnauthorizedError' + '403': + $ref: '#/components/responses/mfaForbiddenError' + '500': + $ref: '#/components/responses/mfaInternalServerError' + servers: &ref_2 + - url: https://mfa.bandwidth.com/api/v1 + description: Production + /accounts/{accountId}/code/messaging: + post: + tags: + - MFA + summary: Messaging Authentication Code + description: Send an MFA code via text message (SMS). + operationId: generateMessagingCode + parameters: + - $ref: '#/components/parameters/accountId' + requestBody: + $ref: '#/components/requestBodies/codeRequest' + responses: + '200': + $ref: '#/components/responses/messagingCodeResponse' + '400': + $ref: '#/components/responses/mfaBadRequestError' + '401': + $ref: '#/components/responses/mfaUnauthorizedError' + '403': + $ref: '#/components/responses/mfaForbiddenError' + '500': + $ref: '#/components/responses/mfaInternalServerError' + servers: *ref_2 + /accounts/{accountId}/code/verify: + post: + tags: + - MFA + summary: Verify Authentication Code + description: Verify a previously sent MFA code. + operationId: verifyCode + parameters: + - $ref: '#/components/parameters/accountId' + requestBody: + $ref: '#/components/requestBodies/codeVerify' + responses: + '200': + $ref: '#/components/responses/verifyCodeResponse' + '400': + $ref: '#/components/responses/mfaBadRequestError' + '401': + $ref: '#/components/responses/mfaUnauthorizedError' + '403': + $ref: '#/components/responses/mfaForbiddenError' + '429': + $ref: '#/components/responses/mfaTooManyRequestsError' + '500': + $ref: '#/components/responses/mfaInternalServerError' + servers: *ref_2 + /accounts/{accountId}/phoneNumberLookup: + post: + summary: Create Synchronous Number Lookup + description: >- + Creates a synchronous phone number lookup request. Maximum of 100 + telephone numbers per request. + operationId: createSyncLookup + tags: + - Phone Number Lookup + parameters: + - $ref: '#/components/parameters/accountId1' + requestBody: + $ref: '#/components/requestBodies/createSyncLookupRequest' + responses: + '200': + $ref: '#/components/responses/createSyncLookupResponse' + default: + $ref: '#/components/responses/tnLookupDefaultResponse' + servers: &ref_3 + - url: https://api.bandwidth.com/v2 + description: Production + /accounts/{accountId}/phoneNumberLookup/bulk: + post: + summary: Create Asynchronous Bulk Number Lookup + description: >- + Creates an asynchronous bulk phone number lookup request. Maximum of + 15,000 telephone numbers per request. Use the [Get Asynchronous Bulk + Number Lookup](#tag/Phone-Number-Lookup/operation/getAsyncBulkLookup) + endpoint to check the status of the request and view the results. + operationId: createAsyncBulkLookup + tags: + - Phone Number Lookup + parameters: + - $ref: '#/components/parameters/accountId1' + requestBody: + $ref: '#/components/requestBodies/createAsyncBulkLookupRequest' + responses: + '202': + $ref: '#/components/responses/createAsyncBulkLookupResponse' + default: + $ref: '#/components/responses/tnLookupDefaultResponse' + servers: *ref_3 + /accounts/{accountId}/phoneNumberLookup/bulk/{requestId}: + get: + summary: Get Asynchronous Bulk Number Lookup + description: >- + Get an existing [Asynchronous Bulk Number + Lookup](#tag/Phone-Number-Lookup/operation/createAsyncBulkLookup). Use + this endpoint to check the status of the request and view the results. + operationId: getAsyncBulkLookup + tags: + - Phone Number Lookup + parameters: + - $ref: '#/components/parameters/accountId1' + - $ref: '#/components/parameters/requestId' + responses: + '200': + $ref: '#/components/responses/getAsyncBulkLookupResponse' + default: + $ref: '#/components/responses/tnLookupDefaultResponse' + servers: *ref_3 + /accounts/{accountId}/tollFreeVerification: + post: + tags: + - Toll-Free Verification + summary: Request Toll-Free Verification + description: Submit a request for verification of a toll-free phone number. + operationId: requestTollFreeVerification + parameters: + - $ref: '#/components/parameters/accountId' + requestBody: + $ref: '#/components/requestBodies/requestTollFreeVerificationRequest' + responses: + '202': + description: Accepted + '400': + $ref: '#/components/responses/tfvPostBadRequestResponse' + '401': + $ref: '#/components/responses/tfvUnauthorizedResponse' + '403': + $ref: '#/components/responses/tfvForbiddenResponse' + '405': + $ref: '#/components/responses/tfvNotAllowedResponse' + '429': + $ref: '#/components/responses/tfvTooManyRequestsResponse' + '500': + $ref: '#/components/responses/tfvServerErrorResponse' + '503': + $ref: '#/components/responses/tfvServiceUnavailableResponse' + callbacks: + tfVerificationStatus: + $ref: '#/components/callbacks/tfVerificationStatus' + servers: &ref_4 + - url: https://api.bandwidth.com/api/v2 + description: Production + /accounts/{accountId}/phoneNumbers/{phoneNumber}/tollFreeVerification: + get: + tags: + - Toll-Free Verification + summary: Get Toll-Free Verification Status + description: >- + Gets the verification status for a phone number that is provisioned to + your account. + + Submission information will be appended to the response if it is + available. + operationId: getTollFreeVerificationStatus + parameters: + - $ref: '#/components/parameters/accountId' + - $ref: '#/components/parameters/tfPhoneNumberPathParam' + responses: + '200': + $ref: '#/components/responses/getTollFreeVerificationStatusResponse' + '400': + $ref: '#/components/responses/tfvBadRequestResponse' + '401': + $ref: '#/components/responses/tfvUnauthorizedResponse' + '403': + $ref: '#/components/responses/tfvForbiddenResponse' + '404': + $ref: '#/components/responses/tfvNotFoundResponse' + '405': + $ref: '#/components/responses/tfvNotAllowedResponse' + '429': + $ref: '#/components/responses/tfvTooManyRequestsResponse' + '500': + $ref: '#/components/responses/tfvServerErrorResponse' + '503': + $ref: '#/components/responses/tfvServiceUnavailableResponse' + put: + tags: + - Toll-Free Verification + summary: Update Toll-Free Verification Request + description: >- + Updates a toll-free verification request. + + Submissions are only eligible for resubmission for 7 days within being + processed and if resubmission is allowed (resubmitAllowed field is + true). + operationId: updateTollFreeVerificationRequest + parameters: + - $ref: '#/components/parameters/accountId' + - $ref: '#/components/parameters/tfPhoneNumberPathParam' + requestBody: + $ref: '#/components/requestBodies/updateTollFreeVerificationRequestRequest' + responses: + '202': + description: Accepted + '400': + $ref: '#/components/responses/tfvPostBadRequestResponse' + '401': + $ref: '#/components/responses/tfvUnauthorizedResponse' + '403': + $ref: '#/components/responses/tfvForbiddenResponse' + '405': + $ref: '#/components/responses/tfvNotAllowedResponse' + '429': + $ref: '#/components/responses/tfvTooManyRequestsResponse' + '500': + $ref: '#/components/responses/tfvServerErrorResponse' + '503': + $ref: '#/components/responses/tfvServiceUnavailableResponse' + callbacks: + tfVerificationStatus: + $ref: '#/components/callbacks/tfVerificationStatus' + delete: + description: Delete a toll-free verification submission for a toll-free number. + operationId: deleteVerificationRequest + parameters: + - $ref: '#/components/parameters/accountId' + - $ref: '#/components/parameters/tfPhoneNumberPathParam' + responses: + '204': + $ref: '#/components/responses/noContentResponse' + '400': + $ref: '#/components/responses/tfvBadRequestResponse' + '401': + $ref: '#/components/responses/tfvUnauthorizedResponse' + '403': + $ref: '#/components/responses/tfvForbiddenResponse' + '404': + $ref: '#/components/responses/tfvNotFoundResponse' + '405': + $ref: '#/components/responses/tfvNotAllowedResponse' + '429': + $ref: '#/components/responses/tfvTooManyRequestsResponse' + '500': + $ref: '#/components/responses/tfvServerErrorResponse' + '503': + $ref: '#/components/responses/tfvServiceUnavailableResponse' + summary: Delete a Toll-Free Verification Submission + tags: + - Toll-Free Verification + servers: *ref_4 + /accounts/{accountId}/tollFreeVerification/webhooks/subscriptions: + get: + tags: + - Toll-Free Verification + summary: List Webhook Subscriptions + description: >- + Lists all webhook subscriptions that are registered to receive status + updates for the toll-free verification requests submitted under this + account (password will not be returned through this API + + If `basicAuthentication` is defined, the `password` property of that + object will be null). + operationId: listWebhookSubscriptions + parameters: + - $ref: '#/components/parameters/accountId' + responses: + '200': + $ref: '#/components/responses/listWebhookSubscriptionsResponse' + '400': + $ref: '#/components/responses/tfvPostBadRequestResponse' + '401': + $ref: '#/components/responses/tfvUnauthorizedResponse' + '403': + $ref: '#/components/responses/tfvForbiddenResponse' + '405': + $ref: '#/components/responses/tfvNotAllowedResponse' + '429': + $ref: '#/components/responses/tfvTooManyRequestsResponse' + '500': + $ref: '#/components/responses/tfvServerErrorResponse' + '503': + $ref: '#/components/responses/tfvServiceUnavailableResponse' + post: + tags: + - Toll-Free Verification + summary: Create Webhook Subscription + description: >- + Create a new webhook subscription (this webhook will be called for every + update on every submission). + + In addition to a `callbackUrl`, this subscription can provide optional + HTTP basic authentication credentials (a username and a password). + + The returned subscription object will contain an ID that can be used to + modify or delete the subscription at a later time. + operationId: createWebhookSubscription + parameters: + - $ref: '#/components/parameters/accountId' + requestBody: + $ref: '#/components/requestBodies/webhookSubscriptionRequest' + responses: + '201': + $ref: '#/components/responses/createWebhookSubscriptionResponse' + '400': + $ref: '#/components/responses/tfvBadRequestResponse' + '401': + $ref: '#/components/responses/tfvUnauthorizedResponse' + '403': + $ref: '#/components/responses/tfvForbiddenResponse' + '404': + $ref: '#/components/responses/tfvNotFoundResponse' + '405': + $ref: '#/components/responses/tfvNotAllowedResponse' + '429': + $ref: '#/components/responses/tfvTooManyRequestsResponse' + '500': + $ref: '#/components/responses/tfvServerErrorResponse' + '503': + $ref: '#/components/responses/tfvServiceUnavailableResponse' + servers: *ref_4 + /accounts/{accountId}/tollFreeVerification/webhooks/subscriptions/{id}: + delete: + tags: + - Toll-Free Verification + summary: Delete Webhook Subscription + description: Delete a webhook subscription by ID. + operationId: deleteWebhookSubscription + parameters: + - $ref: '#/components/parameters/accountId' + - $ref: '#/components/parameters/webhookSubscriptionIdPathParam' + responses: + '204': + $ref: '#/components/responses/noContentResponse' + '400': + $ref: '#/components/responses/tfvBadRequestResponse' + '401': + $ref: '#/components/responses/tfvUnauthorizedResponse' + '403': + $ref: '#/components/responses/tfvForbiddenResponse' + '404': + $ref: '#/components/responses/tfvNotFoundResponse' + '405': + $ref: '#/components/responses/tfvNotAllowedResponse' + '429': + $ref: '#/components/responses/tfvTooManyRequestsResponse' + '500': + $ref: '#/components/responses/tfvServerErrorResponse' + '503': + $ref: '#/components/responses/tfvServiceUnavailableResponse' + put: + tags: + - Toll-Free Verification + summary: Update Webhook Subscription + description: >- + Update an existing webhook subscription (`callbackUrl` and + `basicAuthentication` can be updated). + operationId: updateWebhookSubscription + parameters: + - $ref: '#/components/parameters/accountId' + - $ref: '#/components/parameters/webhookSubscriptionIdPathParam' + requestBody: + $ref: '#/components/requestBodies/webhookSubscriptionRequest' + responses: + '200': + $ref: '#/components/responses/updateWebhookSubscriptionResponse' + '400': + $ref: '#/components/responses/tfvBadRequestResponse' + '401': + $ref: '#/components/responses/tfvUnauthorizedResponse' + '403': + $ref: '#/components/responses/tfvForbiddenResponse' + '404': + $ref: '#/components/responses/tfvNotFoundResponse' + '405': + $ref: '#/components/responses/tfvNotAllowedResponse' + '429': + $ref: '#/components/responses/tfvTooManyRequestsResponse' + '500': + $ref: '#/components/responses/tfvServerErrorResponse' + '503': + $ref: '#/components/responses/tfvServiceUnavailableResponse' + servers: *ref_4 + /tollFreeVerification/useCases: + get: + tags: + - Toll-Free Verification + summary: List Toll-Free Use Cases + description: Lists valid toll-free use cases. + operationId: listTollFreeUseCases + responses: + '200': + $ref: '#/components/responses/listTollFreeUseCasesResponse' + '400': + $ref: '#/components/responses/tfvBadRequestResponse' + '401': + $ref: '#/components/responses/tfvUnauthorizedResponse' + '403': + $ref: '#/components/responses/tfvForbiddenResponse' + '404': + $ref: '#/components/responses/tfvNotFoundResponse' + '405': + $ref: '#/components/responses/tfvNotAllowedResponse' + '429': + $ref: '#/components/responses/tfvTooManyRequestsResponse' + '500': + $ref: '#/components/responses/tfvServerErrorResponse' + '503': + $ref: '#/components/responses/tfvServiceUnavailableResponse' + servers: *ref_4 + /accounts/{accountId}/endpoints: + get: + tags: + - Endpoints + summary: List Endpoints + description: Returns a list of endpoints associated with the specified account. + operationId: listEndpoints + parameters: + - $ref: '#/components/parameters/accountId2' + - $ref: '#/components/parameters/endpointType' + - $ref: '#/components/parameters/endpointStatus' + - $ref: '#/components/parameters/afterCursor' + - $ref: '#/components/parameters/limit1' + responses: + '200': + $ref: '#/components/responses/listEndpointsResponse' + '400': + $ref: '#/components/responses/badRequestErrorResponse' + '401': + $ref: '#/components/responses/unauthorizedErrorResponse' + '403': + $ref: '#/components/responses/forbiddenErrorResponse' + '404': + $ref: '#/components/responses/notFoundErrorResponse' + '405': + $ref: '#/components/responses/methodNotAllowedErrorResponse' + '415': + $ref: '#/components/responses/unsupportedMediaTypeErrorResponse' + '429': + $ref: '#/components/responses/tooManyRequestsErrorResponse' + '500': + $ref: '#/components/responses/serviceUnavailableErrorResponse' + post: + tags: + - Endpoints + summary: Create Endpoint + description: Creates a new Endpoint for the specified account. + operationId: createEndpoint + parameters: + - $ref: '#/components/parameters/accountId2' + requestBody: + $ref: '#/components/requestBodies/createEndpointRequest' + responses: + '201': + $ref: '#/components/responses/createEndpointResponse' + '400': + $ref: '#/components/responses/badRequestErrorResponse' + '401': + $ref: '#/components/responses/unauthorizedErrorResponse' + '403': + $ref: '#/components/responses/forbiddenErrorResponse' + '404': + $ref: '#/components/responses/notFoundErrorResponse' + '405': + $ref: '#/components/responses/methodNotAllowedErrorResponse' + '415': + $ref: '#/components/responses/unsupportedMediaTypeErrorResponse' + '429': + $ref: '#/components/responses/tooManyRequestsErrorResponse' + '500': + $ref: '#/components/responses/serviceUnavailableErrorResponse' + callbacks: + endpointEventCallback: + $ref: '#/components/callbacks/endpointEvent' + servers: &ref_5 + - url: https://api.bandwidth.com/v2 + description: Production + /accounts/{accountId}/endpoints/{endpointId}: + get: + tags: + - Endpoints + summary: Get Endpoint + description: Returns information about the specified endpoint. + operationId: getEndpoint + parameters: + - $ref: '#/components/parameters/accountId2' + - $ref: '#/components/parameters/endpointId' + responses: + '200': + $ref: '#/components/responses/getEndpointResponse' + '400': + $ref: '#/components/responses/badRequestErrorResponse' + '401': + $ref: '#/components/responses/unauthorizedErrorResponse' + '403': + $ref: '#/components/responses/forbiddenErrorResponse' + '404': + $ref: '#/components/responses/notFoundErrorResponse' + '405': + $ref: '#/components/responses/methodNotAllowedErrorResponse' + '415': + $ref: '#/components/responses/unsupportedMediaTypeErrorResponse' + '429': + $ref: '#/components/responses/tooManyRequestsErrorResponse' + '500': + $ref: '#/components/responses/serviceUnavailableErrorResponse' + delete: + tags: + - Endpoints + summary: Delete Endpoint + description: >- + Deletes the specified endpoint. If the endpoint is actively streaming + media, the media stream will be terminated. + operationId: deleteEndpoint + parameters: + - $ref: '#/components/parameters/accountId2' + - $ref: '#/components/parameters/endpointId' + responses: + '204': + description: No Content + '400': + $ref: '#/components/responses/badRequestErrorResponse' + '401': + $ref: '#/components/responses/unauthorizedErrorResponse' + '403': + $ref: '#/components/responses/forbiddenErrorResponse' + '404': + $ref: '#/components/responses/notFoundErrorResponse' + '405': + $ref: '#/components/responses/methodNotAllowedErrorResponse' + '415': + $ref: '#/components/responses/unsupportedMediaTypeErrorResponse' + '429': + $ref: '#/components/responses/tooManyRequestsErrorResponse' + '500': + $ref: '#/components/responses/serviceUnavailableErrorResponse' + servers: *ref_5 + /accounts/{accountId}/endpoints/{endpointId}/bxml: + put: + tags: + - Endpoints + summary: Update Endpoint BXML + description: Updates the BXML for the specified endpoint. + operationId: updateEndpointBxml + parameters: + - $ref: '#/components/parameters/accountId2' + - $ref: '#/components/parameters/endpointId' + requestBody: + $ref: '#/components/requestBodies/updateEndpointBxmlRequest' + responses: + '204': + description: No Content + '400': + $ref: '#/components/responses/badRequestErrorResponse' + '401': + $ref: '#/components/responses/unauthorizedErrorResponse' + '403': + $ref: '#/components/responses/forbiddenErrorResponse' + '404': + $ref: '#/components/responses/notFoundErrorResponse' + '405': + $ref: '#/components/responses/methodNotAllowedErrorResponse' + '415': + $ref: '#/components/responses/unsupportedMediaTypeErrorResponse' + '429': + $ref: '#/components/responses/tooManyRequestsErrorResponse' + '500': + $ref: '#/components/responses/serviceUnavailableErrorResponse' + servers: *ref_5 +components: + schemas: + applicationId: + type: string + description: >- + The ID of the Application your from number or senderId is associated + with in the Bandwidth Phone Number Dashboard. + example: 93de2206-9669-4e07-948d-329f4b722ee2 + priorityEnum: + type: string + description: >- + Specifies the message's sending priority with respect to other messages + in your account. For best results and optimal throughput, reserve the + 'high' priority setting for critical messages only. + enum: + - default + - high + example: default + messageStatusEnum: + type: string + description: >- + The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED + DELIVERED ACCEPTED UNDELIVERED. + enum: + - RECEIVED + - QUEUED + - SENDING + - SENT + - FAILED + - DELIVERED + - ACCEPTED + - UNDELIVERED + example: RECEIVED + listMessageDirectionEnum: + type: string + description: The direction of the message. One of INBOUND OUTBOUND. + enum: + - INBOUND + - OUTBOUND + example: INBOUND + messageDirectionEnum: + type: string + description: The direction of the message. One of in out. + enum: + - in + - out + example: in + messageTypeEnum: + type: string + description: The type of message. Either SMS or MMS. + enum: + - sms + - mms + - rcs + example: sms + productTypeEnum: + type: string + description: The type of product associated with the message. + enum: + - LOCAL_A2P + - P2P + - SHORT_CODE_REACH + - TOLL_FREE + - HOSTED_SHORT_CODE + - ALPHA_NUMERIC + - RBM_MEDIA + - RBM_RICH + - RBM_CONVERSATIONAL + example: P2P + fieldError: + type: object + properties: + fieldName: + type: string + description: The name of the field that contains the error + example: from + description: + type: string + description: The error associated with the field + example: >- + '+invalid' must be replaced with a valid E164 formatted telephone + number + messagesList: + title: MessagesList + type: object + properties: + totalCount: + type: integer + description: >- + The total number of messages matched by the search. When the request + has limitTotalCount set to true this value is limited to 10,000. + example: 100 + pageInfo: + $ref: '#/components/schemas/pageInfo' + messages: + type: array + items: + $ref: '#/components/schemas/listMessageItem' + listMessageItem: + title: listMessageItem + type: object + properties: + messageId: + type: string + description: The message id + example: 1589228074636lm4k2je7j7jklbn2 + accountId: + type: string + description: The account id associated with this message. + example: '9900000' + sourceTn: + type: string + description: The source phone number of the message. + example: '+15554443333' + destinationTn: + type: string + description: The recipient phone number of the message. + example: '+15554442222' + messageStatus: + $ref: '#/components/schemas/messageStatusEnum' + messageDirection: + $ref: '#/components/schemas/listMessageDirectionEnum' + messageType: + $ref: '#/components/schemas/messageTypeEnum' + segmentCount: + $ref: '#/components/schemas/segmentCount' + errorCode: + type: integer + description: The numeric error code of the message. + example: 9902 + receiveTime: + type: string + format: date-time + description: The ISO 8601 datetime of the message. + example: 2020-04-07T14:03:07.000Z + carrierName: + type: string + nullable: true + description: >- + The name of the carrier. Not currently supported for MMS coming + soon. + example: other + messageSize: + type: integer + description: The size of the message including message content and headers. + nullable: true + example: 27 + messageLength: + type: integer + description: The length of the message content. + example: 18 + attachmentCount: + type: integer + description: The number of attachments the message has. + nullable: true + example: 1 + recipientCount: + type: integer + description: The number of recipients the message has. + nullable: true + example: 1 + campaignClass: + type: string + description: The campaign class of the message if it has one. + nullable: true + example: T + campaignId: + type: string + description: The campaign ID of the message if it has one. + nullable: true + example: CJEUMDK + bwLatency: + type: integer + description: >- + The Bandwidth latency of the message in seconds. Only available for + accounts with the Advanced Quality Metrics feature enabled. + nullable: true + example: 20 + carrierLatency: + type: integer + description: >- + The carrier latency of the message in seconds. Only available for + OUTBOUND messages from accounts with the Advanced Quality Metrics + feature enabled. + nullable: true + example: 20 + callingNumberCountryA3: + type: string + description: The A3 country code of the calling number. + nullable: true + example: USA + calledNumberCountryA3: + type: string + description: The A3 country code of the called number. + nullable: true + example: USA + product: + type: string + description: The messaging product associated with the message. + nullable: true + example: P2P + location: + type: string + description: The location ID associated with this message. + nullable: true + example: 123ID + pageInfo: + title: PageInfo + type: object + properties: + prevPage: + type: string + description: The link to the previous page for pagination. + example: >- + https://messaging.bandwidth.com/api/v2/users/accountId/messages?messageStatus=DLR_EXPIRED&nextPage=DLAPE902 + nextPage: + type: string + description: The link to the next page for pagination. + example: >- + https://messaging.bandwidth.com/api/v2/users/accountId/messages?messageStatus=DLR_EXPIRED&prevPage=GL83PD3C + prevPageToken: + type: string + description: The isolated pagination token for the previous page. + example: DLAPE902 + nextPageToken: + type: string + description: The isolated pagination token for the next page. + example: GL83PD3C + messagingRequestError: + title: MessagingRequestError + type: object + properties: + type: + type: string + description: + type: string + required: + - type + - description + createMessageRequestError: + title: CreateMessageRequestError + type: object + properties: + type: + type: string + description: + type: string + fieldErrors: + type: array + items: + $ref: '#/components/schemas/fieldError' + required: + - type + - description + id: + type: string + description: The ID of the message. + example: 1589228074636lm4k2je7j7jklbn2 + media: + title: Media + type: object + properties: + content: + type: string + contentLength: + type: integer + mediaName: + type: string + segmentCount: + type: integer + description: >- + The number of segments the user's message is broken into before sending + over carrier networks. + example: 1 + tag: + title: Tag + type: string + description: >- + A custom string that will be included in callback events of the message. + Max 1024 characters. + example: custom string + expiration: + type: string + format: date-time + description: >- + A string with the date/time value that the message will automatically + expire by. This must be a valid RFC-3339 value, e.g., + 2021-03-14T01:59:26Z or 2021-03-13T20:59:26-05:00. Must be a date-time + in the future. + example: '2021-02-01T11:29:18-05:00' + carrierName: + type: string + description: >- + The name of the Authorized Message Provider (AMP) that handled this + message. + + In the US, this is the carrier that the message was sent to. + + This field is present only when this account feature has been enabled. + example: AT&T + message: + title: Message + type: object + properties: + id: + type: string + description: The id of the message. + example: 1589228074636lm4k2je7j7jklbn2 + owner: + type: string + description: The Bandwidth phone number associated with the message. + example: '+15554443333' + applicationId: + $ref: '#/components/schemas/applicationId' + time: + type: string + format: date-time + description: The datetime stamp of the message in ISO 8601 + example: 2024-12-02T20:15:57.278Z + segmentCount: + $ref: '#/components/schemas/segmentCount' + direction: + $ref: '#/components/schemas/messageDirectionEnum' + to: + uniqueItems: true + type: array + items: + type: string + description: The phone number recipients of the message. + example: + - '+15552223333' + from: + type: string + description: The phone number the message was sent from. + example: '+15553332222' + media: + uniqueItems: true + type: array + items: + type: string + description: >- + The list of media URLs sent in the message. Including a `filename` + field in the `Content-Disposition` header of the media linked with a + URL will set the displayed file name. This is a best practice to + ensure that your media has a readable file name. + example: + - https://dev.bandwidth.com/images/bandwidth-logo.png + text: + type: string + description: The contents of the message. + example: Hello world + tag: + $ref: '#/components/schemas/tag' + priority: + $ref: '#/components/schemas/priorityEnum' + expiration: + $ref: '#/components/schemas/expiration' + messageRequest: + title: MessageRequest + type: object + required: + - applicationId + - to + - from + properties: + applicationId: + $ref: '#/components/schemas/applicationId' + to: + uniqueItems: true + type: array + description: The phone number(s) the message should be sent to in E164 format. + example: + - '+15554443333' + - '+15552223333' + items: + type: string + from: + type: string + description: >- + Either an alphanumeric sender ID or the sender's Bandwidth phone + number in E.164 format, which must be hosted within Bandwidth and + linked to the account that is generating the message. + + Alphanumeric Sender IDs can contain up to 11 characters, upper-case + letters A-Z, lower-case letters a-z, numbers 0-9, space, hyphen -, + plus +, underscore _ and ampersand &. Alphanumeric Sender IDs must + contain at least one letter. + example: '+15551113333' + text: + $ref: '#/components/schemas/messageText' + media: + $ref: '#/components/schemas/messageMedia' + tag: + $ref: '#/components/schemas/tag' + priority: + $ref: '#/components/schemas/priorityEnum' + expiration: + $ref: '#/components/schemas/expiration' + messageText: + type: string + description: The contents of the text message. Must be 2048 characters or less. + maxLength: 2048 + example: Hello world + messageMedia: + type: array + items: + type: string + format: uri + maxLength: 4096 + description: |- + A list of URLs to include as media attachments as part of the message. + Each URL can be at most 4096 characters. + example: + - https://dev.bandwidth.com/images/bandwidth-logo.png + - https://dev.bandwidth.com/images/github_logo.png + createMultiChannelMessageResponse: + type: object + properties: + links: + type: array + items: + $ref: '#/components/schemas/link' + example: [] + data: + $ref: '#/components/schemas/multiChannelMessageResponseData' + errors: + type: array + items: + $ref: '#/components/schemas/errorObject' + example: [] + multiChannelError: + type: object + properties: + links: + type: array + items: + $ref: '#/components/schemas/link' + example: [] + data: + type: object + nullable: true + example: null + errors: + type: array + items: + $ref: '#/components/schemas/errorObject' + link: + type: object + properties: + rel: + type: string + href: + type: string + errorObject: + type: object + properties: + type: + description: A concise summary of the error used for categorization. + type: string + description: + description: A detailed explanation of the error. + type: string + source: + $ref: '#/components/schemas/errorSource' + required: + - type + - description + - source + errorSource: + title: Error Source + type: object + description: Specifies relevant sources of the error, if any. + properties: + parameter: + type: string + description: The relevant URI query parameter causing the error + field: + type: string + description: The request body field that led to the error + header: + type: string + description: The header field that contributed to the error + reference: + type: string + description: A resource ID or path linked to the error + multiChannelMessageChannelEnum: + description: The channel of the multi-channel message. + type: string + enum: + - RBM + - SMS + - MMS + example: RBM + multiChannelSenderId: + type: string + description: The sender ID of the message. This could be an alphanumeric sender ID. + example: BandwidthRBM + multiChannelDestination: + type: string + description: The phone number the message should be sent to in E164 format. + example: '+15552223333' + multiChannelDestinations: + uniqueItems: true + type: array + description: The destination phone number(s) of the message, in E164 format. + example: + - '+15554443333' + items: + type: string + rbmMessageContentText: + title: RBM Text + type: object + properties: + text: + type: string + description: >- + The text associated with the message. Must be 3270 characters or + less + maxLength: 3270 + example: Hello world + suggestions: + $ref: '#/components/schemas/multiChannelFullActions' + required: + - text + rbmMediaHeightEnum: + type: string + description: The height of the media. + enum: + - SHORT + - MEDIUM + - TALL + example: SHORT + rbmMessageContentFile: + title: RBM Rich Media File + type: object + properties: + fileUrl: + type: string + format: uri + description: The URL of the media file. 100MB is the maximum file size. + example: https://dev.bandwidth.com/images/bandwidth-logo.png + maxLength: 1000 + thumbnailUrl: + type: string + format: uri + description: The URL of the thumbnail image. Applies only to video file media. + example: https://dev.bandwidth.com/images/bandwidth-logo.png + maxLength: 1000 + required: + - fileUrl + mmsMessageContentFile: + title: MMS Media File + type: object + properties: + fileUrl: + type: string + format: uri + description: >- + The URL of a media attachment. + + + For MMS, the API limits file size to 3.5MB. Specific carriers and + channels may have a smaller limit that could cause a large file to + fail, see + [here](https://support.bandwidth.com/hc/en-us/articles/360014235473-What-are-the-MMS-file-size-limits) + for more details. + example: https://dev.bandwidth.com/images/bandwidth-logo.png + maxLength: 1000 + required: + - fileUrl + rbmMessageMedia: + title: RBM Media + type: object + properties: + media: + $ref: '#/components/schemas/rbmMessageContentFile' + suggestions: + $ref: '#/components/schemas/multiChannelFullActions' + required: + - media + rbmCardContent: + type: object + properties: + title: + type: string + description: The title of the card. Must be 200 characters or less. + maxLength: 200 + example: Bandwidth + description: + type: string + description: The description of the card. Must be 2000 characters or less. + maxLength: 2000 + example: Bandwidth is a communications platform as a service (CPaaS) company. + media: + allOf: + - $ref: '#/components/schemas/rbmMessageContentFile' + - type: object + properties: + height: + $ref: '#/components/schemas/rbmMediaHeightEnum' + required: + - height + suggestions: + description: >- + An array of suggested actions for the recipient that will be + displayed on the rich card. + type: array + items: + $ref: '#/components/schemas/multiChannelAction' + maxItems: 4 + rbmStandaloneCard: + title: Standalone Card + type: object + properties: + orientation: + $ref: '#/components/schemas/standaloneCardOrientationEnum' + thumbnailImageAlignment: + $ref: '#/components/schemas/thumbnailAlignmentEnum' + cardContent: + $ref: '#/components/schemas/rbmCardContent' + suggestions: + $ref: '#/components/schemas/multiChannelFullActions' + required: + - orientation + - thumbnailImageAlignment + - cardContent + standaloneCardOrientationEnum: + type: string + enum: + - HORIZONTAL + - VERTICAL + example: VERTICAL + thumbnailAlignmentEnum: + type: string + description: >- + The alignment of the thumbnail image in the card. Only applicable if the + card using horizontal orientation. + enum: + - LEFT + - RIGHT + example: LEFT + rbmMessageCarouselCard: + title: Carousel + type: object + properties: + cardWidth: + $ref: '#/components/schemas/cardWidthEnum' + cardContents: + type: array + items: + $ref: '#/components/schemas/rbmCardContent' + maxItems: 10 + suggestions: + $ref: '#/components/schemas/multiChannelFullActions' + required: + - cardContents + - cardWidth + cardWidthEnum: + type: string + enum: + - SMALL + - MEDIUM + example: SMALL + smsMessageContent: + title: SMS Text + type: object + properties: + text: + $ref: '#/components/schemas/messageText' + required: + - text + mmsMessageContent: + title: MMS Message + type: object + properties: + text: + $ref: '#/components/schemas/messageText' + media: + type: array + items: + $ref: '#/components/schemas/mmsMessageContentFile' + rbmMessageContentRichCard: + title: RBM Rich Card + oneOf: + - $ref: '#/components/schemas/rbmStandaloneCard' + - $ref: '#/components/schemas/rbmMessageCarouselCard' + rbmActionTypeEnum: + type: string + enum: + - REPLY + - DIAL_PHONE + - SHOW_LOCATION + - CREATE_CALENDAR_EVENT + - OPEN_URL + - REQUEST_LOCATION + example: REPLY + rbmOpenUrlEnum: + type: string + description: >- + Specifies how the URL should be opened on a mobile device. + + - `BROWSER` Opens the URL in the device's default browser. If + application is not set or the device doesn’t support WebView, this + option is used by default. + + - `WEBVIEW` Opens the URL in an in-app WebView. + enum: + - BROWSER + - WEBVIEW + example: WEBVIEW + rbmWebViewEnum: + type: string + description: >- + Defines the layout of the WebView on a mobile device. It must be defined + when application is set to `WEBVIEW` + + - `FULL` WebView takes the full screen. + + - `HALF` WebView takes half of the screen. + + - `TALL` WebView takes three-quarters of the screen. + enum: + - FULL + - HALF + - TALL + rbmActionText: + title: Text + type: string + description: Displayed text for user to click + maxLength: 25 + example: Hello world + rbmActionPostbackData: + title: Post Back Data + type: string + format: byte + description: Base64 payload the customer receives when the reply is clicked. + maxLength: 2048 + example: SGVsbG8gd29ybGQ= + rbmActionBase: + type: object + properties: + type: + $ref: '#/components/schemas/rbmActionTypeEnum' + text: + $ref: '#/components/schemas/rbmActionText' + postbackData: + $ref: '#/components/schemas/rbmActionPostbackData' + required: + - text + - postbackData + - type + rbmActionDial: + allOf: + - $ref: '#/components/schemas/rbmActionBase' + - title: Dial Phone + type: object + properties: + phoneNumber: + type: string + description: The phone number to dial. Must be E164 format. + example: '+15552223333' + required: + - phoneNumber + rbmActionViewLocation: + allOf: + - $ref: '#/components/schemas/rbmActionBase' + - title: Show Location + type: object + properties: + latitude: + type: string + format: double + description: The latitude of the location. + example: '37.7749' + longitude: + type: string + format: double + description: The longitude of the location. + example: '-122.4194' + label: + type: string + description: The label of the location. + example: San Francisco + maxLength: 100 + required: + - latitude + - longitude + multiChannelActionCalendarEvent: + allOf: + - $ref: '#/components/schemas/rbmActionBase' + - title: Calendar Event + type: object + properties: + title: + type: string + description: The title of the event. + example: Meeting with John + maxLength: 100 + startTime: + type: string + format: date-time + description: The start time of the event. + example: 2022-09-14T18:20:16.000Z + endTime: + type: string + format: date-time + description: The end time of the event. + example: 2022-09-14T18:20:16.000Z + description: + type: string + description: The description of the event. + example: Discuss the new project + maxLength: 500 + required: + - title + - startTime + - endTime + rbmActionOpenUrl: + allOf: + - $ref: '#/components/schemas/rbmActionBase' + - title: Open URL + type: object + properties: + url: + type: string + format: uri + description: The URL to open in browser. + example: https://dev.bandwidth.com + maxLength: 2048 + application: + $ref: '#/components/schemas/rbmOpenUrlEnum' + webviewViewMode: + $ref: '#/components/schemas/rbmWebViewEnum' + required: + - url + multiChannelFullActions: + type: array + description: An array of suggested actions for the recipient. + items: + $ref: '#/components/schemas/multiChannelAction' + maxItems: 11 + multiChannelAction: + anyOf: + - $ref: '#/components/schemas/rbmActionBase' + - $ref: '#/components/schemas/rbmActionDial' + - $ref: '#/components/schemas/rbmActionViewLocation' + - $ref: '#/components/schemas/multiChannelActionCalendarEvent' + - $ref: '#/components/schemas/rbmActionOpenUrl' + discriminator: + propertyName: type + mapping: + REPLY: '#/components/schemas/rbmActionBase' + DIAL_PHONE: '#/components/schemas/rbmActionDial' + SHOW_LOCATION: '#/components/schemas/rbmActionViewLocation' + CREATE_CALENDAR_EVENT: '#/components/schemas/multiChannelActionCalendarEvent' + OPEN_URL: '#/components/schemas/rbmActionOpenUrl' + REQUEST_LOCATION: '#/components/schemas/rbmActionBase' + multiChannelChannelListObjectBase: + type: object + properties: + from: + $ref: '#/components/schemas/multiChannelSenderId' + applicationId: + $ref: '#/components/schemas/applicationId' + channel: + $ref: '#/components/schemas/multiChannelMessageChannelEnum' + required: + - from + - applicationId + - channel + multiChannelChannelListRBMObject: + allOf: + - $ref: '#/components/schemas/multiChannelChannelListObjectBase' + - type: object + properties: + content: + description: The content of the message. + oneOf: + - $ref: '#/components/schemas/rbmMessageContentText' + - $ref: '#/components/schemas/rbmMessageMedia' + - $ref: '#/components/schemas/rbmMessageContentRichCard' + required: + - content + multiChannelChannelListSMSObject: + allOf: + - $ref: '#/components/schemas/multiChannelChannelListObjectBase' + - type: object + properties: + content: + $ref: '#/components/schemas/smsMessageContent' + required: + - content + multiChannelChannelListMMSObject: + allOf: + - $ref: '#/components/schemas/multiChannelChannelListObjectBase' + - type: object + properties: + content: + $ref: '#/components/schemas/mmsMessageContent' + required: + - content + multiChannelChannelListRBMResponseObject: + allOf: + - $ref: '#/components/schemas/multiChannelChannelListRBMObject' + - $ref: '#/components/schemas/multiChannelChannelListOwnerObject' + multiChannelChannelListSMSResponseObject: + allOf: + - $ref: '#/components/schemas/multiChannelChannelListSMSObject' + - $ref: '#/components/schemas/multiChannelChannelListOwnerObject' + multiChannelChannelListMMSResponseObject: + allOf: + - $ref: '#/components/schemas/multiChannelChannelListMMSObject' + - $ref: '#/components/schemas/multiChannelChannelListOwnerObject' + multiChannelChannelListRequestObject: + anyOf: + - $ref: '#/components/schemas/multiChannelChannelListRBMObject' + - $ref: '#/components/schemas/multiChannelChannelListSMSObject' + - $ref: '#/components/schemas/multiChannelChannelListMMSObject' + discriminator: + propertyName: channel + mapping: + RBM: '#/components/schemas/multiChannelChannelListRBMObject' + SMS: '#/components/schemas/multiChannelChannelListSMSObject' + MMS: '#/components/schemas/multiChannelChannelListMMSObject' + multiChannelChannelListOwnerObject: + type: object + properties: + owner: + type: string + description: >- + The Bandwidth senderId associated with the message. Identical to + 'from'. + required: + - owner + multiChannelChannelListResponseObject: + anyOf: + - $ref: '#/components/schemas/multiChannelChannelListRBMResponseObject' + - $ref: '#/components/schemas/multiChannelChannelListSMSResponseObject' + - $ref: '#/components/schemas/multiChannelChannelListMMSResponseObject' + discriminator: + propertyName: channel + mapping: + RBM: '#/components/schemas/multiChannelChannelListRBMResponseObject' + SMS: '#/components/schemas/multiChannelChannelListSMSResponseObject' + MMS: '#/components/schemas/multiChannelChannelListMMSResponseObject' + multiChannelMessageRequest: + description: Multi-Channel Message Request + type: object + properties: + to: + $ref: '#/components/schemas/multiChannelDestination' + channelList: + type: array + description: >- + A list of message bodies. The messages will be attempted in the + order they are listed. Once a message sends successfully, the others + will be ignored. + items: + $ref: '#/components/schemas/multiChannelChannelListRequestObject' + maxItems: 4 + tag: + $ref: '#/components/schemas/tag' + priority: + $ref: '#/components/schemas/priorityEnum' + expiration: + $ref: '#/components/schemas/expiration' + required: + - to + - channelList + multiChannelMessageResponseData: + description: The data returned in a multichannel message response. + type: object + properties: + id: + $ref: '#/components/schemas/id' + time: + description: The time the message was received by the Bandwidth API. + type: string + format: date-time + example: 2025-01-01T18:20:16.000Z + direction: + $ref: '#/components/schemas/messageDirectionEnum' + to: + $ref: '#/components/schemas/multiChannelDestinations' + channelList: + type: array + description: >- + A list of message bodies. The messages will be attempted in the + order they are listed. Once a message sends successfully, the others + will be ignored. + items: + $ref: '#/components/schemas/multiChannelChannelListResponseObject' + maxItems: 4 + tag: + $ref: '#/components/schemas/tag' + priority: + $ref: '#/components/schemas/priorityEnum' + expiration: + $ref: '#/components/schemas/expiration' + required: + - id + - time + - direction + - to + - channelList + multiChannelMessageContent: + description: The structure of the content field of a multichannel message. + type: object + properties: + text: + type: string + media: + $ref: '#/components/schemas/rbmMessageContentFile' + rbmSuggestionResponse: + type: object + properties: + text: + type: string + description: The text associated with the suggestion response. + example: Yes, I would like to proceed + postbackData: + $ref: '#/components/schemas/rbmActionPostbackData' + rbmLocationResponse: + type: object + properties: + latitude: + type: string + format: double + description: The latitude of the client's location. + example: '37.7749' + longitude: + type: string + format: double + description: The longitude of the client's location. + example: '-122.4194' + callback: + description: >- + Callbacks are divided into two types based on direction of the related + message: + + - `statusCallback` indicates status of an outbound MT SMS, MMS, or RBM + message. + + - `inboundCallback` indicates an inbound MO message or a multichannel + message client's response to a suggestion or location request. + type: object + oneOf: + - $ref: '#/components/schemas/statusCallback' + - $ref: '#/components/schemas/inboundCallback' + discriminator: + propertyName: type + mapping: + message-sent: '#/components/schemas/statusCallback' + message-delivered: '#/components/schemas/statusCallback' + message-failed: '#/components/schemas/statusCallback' + message-read: '#/components/schemas/statusCallback' + message-received: '#/components/schemas/inboundCallback' + request-location-response: '#/components/schemas/inboundCallback' + suggestion-response: '#/components/schemas/inboundCallback' + statusCallback: + type: object + description: >- + Represents a status callback for an outbound MT SMS or MMS or RBM + message. + properties: + time: + type: string + format: date-time + example: 2024-12-02T20:15:57.278Z + eventTime: + type: string + description: >- + Represents the time at which the message was read, for + `message-read` callbacks. + format: date-time + example: 2024-12-02T20:15:58.278Z + type: + $ref: '#/components/schemas/statusCallbackTypeEnum' + to: + type: string + description: >- + The destination phone number the message was sent to. + + For status callbacks, this the the Bandwidth user's client phone + number. + example: '+15552223333' + description: + type: string + description: A detailed description of the event described by the callback. + example: Message delivered to carrier. + message: + $ref: '#/components/schemas/statusCallbackMessage' + errorCode: + type: integer + description: Optional error code, applicable only when type is `message-failed`. + example: 4405 + carrierName: + $ref: '#/components/schemas/carrierName' + required: + - time + - type + - to + - description + - message + inboundCallback: + type: object + description: Represents an inbound callback. + properties: + time: + type: string + format: date-time + example: 2024-12-02T20:15:57.278Z + type: + $ref: '#/components/schemas/inboundCallbackTypeEnum' + to: + type: string + description: > + The destination phone number the message was sent to. + + For inbound callbacks, this is the Bandwidth number or alphanumeric + identifier that received the message. + example: '+15552223333' + description: + type: string + description: A detailed description of the event described by the callback. + example: Incoming message received + message: + $ref: '#/components/schemas/inboundCallbackMessage' + carrierName: + $ref: '#/components/schemas/carrierName' + required: + - time + - type + - to + - description + - message + statusCallbackTypeEnum: + type: string + description: >- + The possible status callbacks when sending an MT SMS or MMS or RBM + message: + + - `message-sending` indicates that Bandwidth is sending the message to + the upstream provider. + + - `message-delivered` indicates that the message was successfully sent. + + - `message-failed` indicates that the message could not be sent to the + intended recipient. + + - `message-read` indicates that the RBM message was read by the + recipient. + enum: + - message-sending + - message-delivered + - message-failed + - message-read + example: message-delivered + inboundCallbackTypeEnum: + type: string + description: >- + The possible inbound callback types originating from MO messages or + multichannel message client responses: + + - `message-received` indicates an MO message from a Bandwidth user's + client to a Bandwidth number. + + - `request-location-response` indicates a response to a location request + sent by the Bandwidth user's client after receiving an RBM message. + + - `suggestion-response` indicates a response to a suggestion sent by the + Bandwidth user's client after receiving an RBM message. + enum: + - message-received + - request-location-response + - suggestion-response + example: message-received + statusCallbackMessage: + description: Message payload schema within a callback + type: object + properties: + id: + type: string + description: A unique identifier of the message. + example: 1661365814859loidf7mcwd4qacn7 + owner: + type: string + description: >- + The Bandwidth phone number or alphanumeric identifier associated + with the message. + example: '+15553332222' + applicationId: + $ref: '#/components/schemas/applicationId' + time: + type: string + format: date-time + example: 2024-12-02T20:15:57.666Z + segmentCount: + $ref: '#/components/schemas/segmentCount' + direction: + $ref: '#/components/schemas/messageDirectionEnum' + to: + description: The phone number recipients of the message. + uniqueItems: true + type: array + items: + type: string + example: + - '+15552223333' + from: + type: string + description: >- + The Bandwidth phone number or alphanumeric identifier the message + was sent from. + example: '+15553332222' + text: + type: string + example: Hello world + tag: + $ref: '#/components/schemas/tag' + media: + type: array + description: Optional media, not applicable for sms + items: + type: string + format: uri + example: + - https://dev.bandwidth.com/images/bandwidth-logo.png + - https://dev.bandwidth.com/images/github_logo.png + priority: + $ref: '#/components/schemas/priorityEnum' + channel: + $ref: '#/components/schemas/multiChannelMessageChannelEnum' + required: + - id + - owner + - applicationId + - time + - segmentCount + - direction + - to + - from + inboundCallbackMessage: + allOf: + - $ref: '#/components/schemas/statusCallbackMessage' + - type: object + properties: + content: + $ref: '#/components/schemas/multiChannelMessageContent' + suggestionResponse: + $ref: '#/components/schemas/rbmSuggestionResponse' + locationResponse: + $ref: '#/components/schemas/rbmLocationResponse' + required: + - id + - owner + - applicationId + - time + - segmentCount + - direction + - to + - from + callbackMethodEnum: + type: string + nullable: true + default: POST + enum: + - GET + - POST + description: >- + The HTTP method to use to deliver the callback. GET or POST. Default + value is POST. + example: POST + redirectMethodEnum: + type: string + nullable: true + default: POST + enum: + - GET + - POST + description: >- + The HTTP method to use for the request to `redirectUrl`. GET + + or POST. Default value is POST.

Not allowed if `state` is + `completed`. + example: POST + recordingStateEnum: + type: string + enum: + - paused + - recording + description: |- + The recording state. Possible values: + + `paused` to pause an active recording + + `recording` to resume a paused recording + example: paused + callDirectionEnum: + type: string + enum: + - inbound + - outbound + description: The direction of the call. + example: inbound + fileFormatEnum: + type: string + enum: + - mp3 + - wav + description: The format that the recording is stored in. + example: wav + callStateEnum: + nullable: true + type: string + default: active + enum: + - active + - completed + description: >- + The call state. Possible values:
`active` to redirect the + + call (default)
`completed` to hang up the call if it is answered, + cancel + + it if it is an unanswered outbound call, or reject it if it an + unanswered + + inbound call + example: completed + conferenceStateEnum: + nullable: true + type: string + default: active + enum: + - active + - completed + description: >- + Setting the conference state to `completed` ends the conference and + ejects all members. + example: completed + machineDetectionModeEnum: + type: string + default: async + enum: + - sync + - async + description: >- + The machine detection mode. If set to 'async', the detection + + result will be sent in a 'machineDetectionComplete' callback. If set to + + 'sync', the 'answer' callback will wait for the machine detection to + complete + + and will include its result. + example: async + callTranscriptionDetectedLanguageEnum: + type: string + enum: + - en-US + - es-US + - fr-FR + description: The detected language for this transcription. + example: en-US + callTranscriptionTrackEnum: + type: string + enum: + - inbound + - outbound + description: Which `track` this transcription is derived from. + example: inbound + createCall: + type: object + required: + - answerUrl + - applicationId + - from + - to + properties: + to: + type: string + description: >- + The destination to call (must be an E.164 formatted number + + (e.g. `+15555551212`) or a SIP URI (e.g. + `sip:user@server.example`)). + example: '+19195551234' + from: + type: string + description: >- + A Bandwidth phone number on your account the call should come + + from (must be in E.164 format, like `+15555551212`) even if + `privacy` is set to true. + example: '+15555551212' + privacy: + nullable: true + type: boolean + description: >- + Hide the calling number. The `displayName` field can be used to + customize the displayed name. + example: false + displayName: + nullable: true + type: string + description: >- + The caller display name to use when the call is created. + + May not exceed 256 characters nor contain control characters such as + new lines. + + If `privacy` is true, only the following values are valid: + `Restricted`, `Anonymous`, `Private`, or `Unavailable`. + maxLength: 256 + example: John Doe + uui: + nullable: true + type: string + example: >- + eyJhbGciOiJIUzI1NiJ9.WyJoaSJd.-znkjYyCkgz4djmHUPSXl9YrJ6Nix_XvmlwKGFh5ERM;encoding=jwt,aGVsbG8gd29ybGQ;encoding=base64 + description: >- + A comma-separated list of 'User-To-User' headers to be sent + + in the INVITE when calling a SIP URI. Each value must end with an + 'encoding' + + parameter as described in RFC + + 7433. Only 'jwt', 'base64' and 'hex' encodings are allowed. The + entire value + + cannot exceed 350 characters, including parameters and separators. + applicationId: + type: string + description: The id of the application associated with the `from` number. + example: 1234-qwer-5679-tyui + answerUrl: + type: string + format: uri + description: >- + The full URL to send the Answer + + event to when the called party answers. This endpoint should return + the + + first BXML document to be executed in + the + + call. + + + Must use `https` if specifying `username` and `password`. + maxLength: 2048 + example: https://www.myCallbackServer.example/webhooks/answer + answerMethod: + $ref: '#/components/schemas/callbackMethodEnum' + username: + type: string + nullable: true + description: Basic auth username. + maxLength: 1024 + example: mySecretUsername + password: + type: string + nullable: true + description: Basic auth password. + maxLength: 1024 + example: mySecretPassword1! + answerFallbackUrl: + nullable: true + type: string + format: uri + description: >- + A fallback url which, if provided, will be used to retry the + + `answer` webhook delivery in case `answerUrl` fails to respond + + + Must use `https` if specifying `fallbackUsername` and + `fallbackPassword`. + maxLength: 2048 + example: https://www.myFallbackServer.example/webhooks/answer + answerFallbackMethod: + $ref: '#/components/schemas/callbackMethodEnum' + fallbackUsername: + type: string + nullable: true + description: Basic auth username. + maxLength: 1024 + example: mySecretUsername + fallbackPassword: + type: string + nullable: true + description: Basic auth password. + maxLength: 1024 + example: mySecretPassword1! + disconnectUrl: + nullable: true + type: string + format: uri + description: >- + The URL to send the Disconnect event to when + the call ends. This event does not expect a BXML response. + maxLength: 2048 + example: https://www.myCallbackServer.example/webhooks/disconnect + disconnectMethod: + $ref: '#/components/schemas/callbackMethodEnum' + callTimeout: + nullable: true + type: number + format: double + description: >- + The timeout (in seconds) for the callee to answer the call + + after it starts ringing. If the call does not start ringing within + 30s, + + the call will be cancelled regardless of this value. Can be any + numeric + + value (including decimals) between 1 and 300. + minimum: 1 + maximum: 300 + default: 30 + example: 30 + callbackTimeout: + nullable: true + type: number + format: double + description: >- + This is the timeout (in seconds) to use when delivering webhooks + + for the call. Can be any numeric value (including decimals) between + 1 + + and 25. + minimum: 1 + maximum: 25 + default: 15 + example: 15 + machineDetection: + $ref: '#/components/schemas/machineDetectionConfiguration' + priority: + nullable: true + type: integer + minimum: 1 + maximum: 5 + default: 5 + description: >- + The priority of this call over other calls from your account. For + example, if during a call + + your application needs to place a new call and bridge it with the + current + + call, you might want to create the call with priority 1 so that it + will + + be the next call picked off your queue, ahead of other less time + sensitive + + calls. A lower value means higher priority, so a priority 1 call + takes + + precedence over a priority 2 call. + example: 5 + tag: + nullable: true + type: string + description: >- + A custom string that will be sent with all webhooks for this + + call unless overwritten by a future `` + + verb or `tag` attribute on another verb, or cleared. + + + May be cleared by setting `tag=""` + + + Max length 256 characters. + maxLength: 256 + example: arbitrary text here + createCallResponse: + type: object + required: + - accountId + - answerMethod + - answerUrl + - applicationId + - callId + - callUrl + - disconnectMethod + - from + - to + properties: + applicationId: + type: string + example: 04e88489-df02-4e34-a0ee-27a91849555f + description: The id of the application associated with the `from` number. + accountId: + type: string + example: '9900000' + description: The bandwidth account ID associated with the call. + callId: + type: string + example: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + description: Programmable Voice API Call ID. + to: + type: string + example: '+19195551234' + description: Recipient of the outgoing call. + from: + type: string + example: '+19195554321' + description: Phone number that created the outbound call. + enqueuedTime: + nullable: true + type: string + format: date-time + description: The time at which the call was accepted into the queue. + example: '2022-06-16T13:15:07.160Z' + callUrl: + type: string + format: uri + example: >- + https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + description: The URL to update this call's state. + callTimeout: + type: number + format: double + example: 30 + description: >- + The timeout (in seconds) for the callee to answer the call after it + starts ringing. + callbackTimeout: + type: number + format: double + example: 15 + description: >- + This is the timeout (in seconds) to use when delivering webhooks for + the call. + tag: + nullable: true + type: string + example: My custom tag value + description: Custom tag value. + answerMethod: + $ref: '#/components/schemas/callbackMethodEnum' + answerUrl: + type: string + format: uri + example: https://myServer.example/bandwidth/webhooks/answer + description: URL to deliver the `answer` event webhook. + answerFallbackMethod: + $ref: '#/components/schemas/callbackMethodEnum' + answerFallbackUrl: + nullable: true + type: string + format: uri + example: https://myFallbackServer.example/bandwidth/webhooks/answer + description: Fallback URL to deliver the `answer` event webhook. + disconnectMethod: + $ref: '#/components/schemas/callbackMethodEnum' + disconnectUrl: + nullable: true + type: string + format: uri + example: https://myServer.example/bandwidth/webhooks/disconnect + description: URL to deliver the `disconnect` event webhook. + username: + type: string + nullable: true + description: Basic auth username. + maxLength: 1024 + example: mySecretUsername + password: + type: string + nullable: true + description: Basic auth password. + maxLength: 1024 + example: mySecretPassword1! + fallbackUsername: + type: string + nullable: true + description: Basic auth username. + maxLength: 1024 + example: mySecretUsername + fallbackPassword: + type: string + nullable: true + description: Basic auth password. + maxLength: 1024 + example: mySecretPassword1! + priority: + nullable: true + type: integer + example: 5 + description: The priority of this call over other calls from your account. + callState: + type: object + properties: + applicationId: + type: string + description: The application id associated with the call. + example: 04e88489-df02-4e34-a0ee-27a91849555f + accountId: + type: string + description: The account id associated with the call. + example: '9900000' + callId: + type: string + description: The programmable voice API call ID. + example: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + parentCallId: + nullable: true + type: string + description: >- + The A-leg call id, set only if this call is the B-leg of a + [``](/docs/voice/bxml/transfer). + example: c-25ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + to: + type: string + description: >- + The phone number that received the call, in E.164 format (e.g. + +15555555555), or if the call was to a SIP URI, the SIP URI. + example: '+19195551234' + from: + type: string + description: >- + The phone number that made the call, in E.164 format (e.g. + +15555555555). + example: '+19195554321' + direction: + $ref: '#/components/schemas/callDirectionEnum' + state: + description: >- + The current state of the call. Current possible values are + + `queued`, `initiated`, `answered` and `disconnected`. Additional + states + + may be added in the future, so your application must be tolerant of + unknown + + values. + type: string + example: disconnected + stirShaken: + nullable: true + type: object + description: >- + For inbound calls, the Bandwidth STIR/SHAKEN implementation will + verify the information provided in the inbound invite request + `Identity` header. + + The verification status is stored in the call state `stirShaken` + property as follows. + + + | Property | Description | + + |:------------------|:------------| + + | verstat | (optional) The verification status indicating whether + the verification was successful or not. Possible values are + `TN-Validation-Passed` or `TN-Validation-Failed`. | + + | attestationIndicator | (optional) The attestation level verified + by Bandwidth. Possible values are `A` (full), `B` (partial) or `C` + (gateway). | + + | originatingId | (optional) A unique origination identifier. | + + + Note that these are common properties but that the `stirShaken` + object is free form and can contain other key-value pairs. + + + More information: [Understanding + STIR/SHAKEN](https://www.bandwidth.com/regulations/stir-shaken). + additionalProperties: + type: string + example: + verstat: TN-Validation-Passed + attestationIndicator: A + originatingId: abc123 + identity: + nullable: true + type: string + description: >- + The value of the `Identity` header from the inbound invite + + request. Only present for inbound calls and if the account is + configured + + to forward this header. + example: >- + eyJhbGciOiJFUzI1NiIsInBwdCI6InNoYWtlbiIsInR5cCI6InBhc3Nwb3J0IiwieDV1IjoiaHR0cHM6Ly9idy1zaGFrZW4tY2VydC1wdWIuczMuYW1hem9uYXdzLmNvbS9iYW5kd2lkdGgtc2hha2VuLWNlcnRfMjAyMzA3MTYucGVtIn0.eyJhdHRlc3QiOiJBIiwiZGVzdCI6eyJ0biI6WyIxOTg0MjgyMDI4MCJdfSwiaWF0IjoxNjU2NTM0MzM2LCJvcmlnIjp7InRuIjoiMTkxOTQ0NDI2ODMifSwib3JpZ2lkIjoiNDk0NTlhOGEtNDJmNi0zNTFjLTkzNjEtYWRmNTdhOWUwOGNhIn0.56un9sRw_uH-sbJvnUsqdevlVxbOVjn8MVlGTlBMicjaZuRRwxfiNp-C9zYCMKTTCbc-QdYPN05F61XNVN4D3w;info=;alg=ES256;ppt=shaken + enqueuedTime: + nullable: true + type: string + format: date-time + description: The time this call was placed in queue. + example: '2022-06-16T13:15:07.160Z' + startTime: + nullable: true + type: string + format: date-time + description: >- + The time the call was initiated, in ISO 8601 format. `null` if the + call is still in your queue. + example: '2022-06-16T13:15:07.160Z' + answerTime: + nullable: true + type: string + format: date-time + description: >- + Populated once the call has been answered, with the time in ISO 8601 + format. + example: '2022-06-16T13:15:18.126Z' + endTime: + nullable: true + type: string + format: date-time + description: Populated once the call has ended, with the time in ISO 8601 format. + example: '2022-06-16T13:15:18.314Z' + disconnectCause: + nullable: true + type: string + description: >- + | Cause | Description | + + |:------|:------------| + + | `hangup`| One party hung up the call, a + [``](../../bxml/verbs/hangup.md) verb was executed, or there + was no more BXML to execute; it indicates that the call ended + normally. | + + | `busy` | Callee was busy. | + + | `timeout` | Call wasn't answered before the `callTimeout` was + reached. | + + | `cancel` | Call was cancelled by its originator while it was + ringing. | + + | `rejected` | Call was rejected by the callee. | + + | `callback-error` | BXML callback couldn't be delivered to your + callback server. | + + | `invalid-bxml` | Invalid BXML was returned in response to a + callback. | + + | `application-error` | An unsupported action was tried on the call, + e.g. trying to play a .ogg audio. | + + | `account-limit` | Account rate limits were reached. | + + | `node-capacity-exceeded` | System maximum capacity was reached. | + + | `error` | Some error not described in any of the other causes + happened on the call. | + + | `unknown` | Unknown error happened on the call. | + + + Note: This list is not exhaustive and other values can appear in the + future. + errorMessage: + nullable: true + type: string + description: >- + Populated only if the call ended with an error, with text explaining + the reason. + example: null + errorId: + nullable: true + type: string + description: >- + Populated only if the call ended with an error, with a Bandwidth + internal id that references the error event. + example: null + lastUpdate: + type: string + format: date-time + description: The last time the call had a state update, in ISO 8601 format. + example: '2022-06-16T13:15:18.314Z' + updateCall: + type: object + properties: + state: + $ref: '#/components/schemas/callStateEnum' + redirectUrl: + description: |- + The URL to send the [Redirect](/docs/voice/bxml/redirect) event + to which will provide new BXML. + + Required if `state` is `active`. + + Not allowed if `state` is `completed`. + nullable: true + type: string + format: uri + example: https://myServer.example/bandwidth/webhooks/redirect + redirectMethod: + $ref: '#/components/schemas/redirectMethodEnum' + username: + type: string + nullable: true + description: Basic auth username. + maxLength: 1024 + example: mySecretUsername + password: + type: string + nullable: true + description: Basic auth password. + maxLength: 1024 + example: mySecretPassword1! + redirectFallbackUrl: + nullable: true + type: string + format: uri + description: |- + A fallback url which, if provided, will be used to retry the + redirect callback delivery in case `redirectUrl` fails to respond. + example: https://myFallbackServer.example/bandwidth/webhooks/redirect + redirectFallbackMethod: + $ref: '#/components/schemas/redirectMethodEnum' + fallbackUsername: + type: string + nullable: true + description: Basic auth username. + maxLength: 1024 + example: mySecretUsername + fallbackPassword: + type: string + nullable: true + description: Basic auth password. + maxLength: 1024 + example: mySecretPassword1! + tag: + nullable: true + type: string + description: >- + A custom string that will be sent with this and all future + + callbacks unless overwritten by a future `tag` attribute or + [``](/docs/voice/bxml/tag) + + verb, or cleared. + + + May be cleared by setting `tag=""`. + + + Max length 256 characters. + + + Not allowed if `state` is `completed`. + maxLength: 256 + example: My Custom Tag + updateCallRecording: + type: object + required: + - state + properties: + state: + $ref: '#/components/schemas/recordingStateEnum' + accountStatistics: + type: object + properties: + currentCallQueueSize: + type: integer + description: The number of calls currently enqueued. + example: 0 + maxCallQueueSize: + type: integer + description: >- + The maximum size of the queue before outgoing calls start being + rejected. + example: 900 + callRecordingMetadata: + type: object + properties: + applicationId: + $ref: '#/components/schemas/applicationId1' + accountId: + $ref: '#/components/schemas/accountId' + callId: + $ref: '#/components/schemas/callId' + parentCallId: + $ref: '#/components/schemas/parentCallId' + recordingId: + $ref: '#/components/schemas/recordingId' + to: + $ref: '#/components/schemas/to' + from: + $ref: '#/components/schemas/from' + transferCallerId: + $ref: '#/components/schemas/transferCallerId' + transferTo: + $ref: '#/components/schemas/transferTo' + duration: + $ref: '#/components/schemas/duration' + direction: + $ref: '#/components/schemas/callDirectionEnum' + channels: + $ref: '#/components/schemas/channels' + startTime: + $ref: '#/components/schemas/startTime' + endTime: + $ref: '#/components/schemas/endTime' + fileFormat: + $ref: '#/components/schemas/fileFormatEnum' + status: + $ref: '#/components/schemas/status' + mediaUrl: + $ref: '#/components/schemas/mediaUrl' + transcription: + $ref: '#/components/schemas/recordingTranscriptionMetadata' + recordingName: + $ref: '#/components/schemas/recordingName' + conference: + type: object + properties: + id: + type: string + description: The Bandwidth-generated conference ID. + example: conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9 + name: + type: string + description: The name of the conference, as specified by your application. + example: my-conference-name + createdTime: + type: string + format: date-time + description: The time the conference was initiated, in ISO 8601 format. + example: '2022-06-17T22:19:40.375Z' + completedTime: + nullable: true + type: string + format: date-time + description: The time the conference was terminated, in ISO 8601 format. + example: '2022-06-17T22:20:00.000Z' + conferenceEventUrl: + nullable: true + type: string + format: uri + description: The URL to send the conference-related events. + example: https://myServer.example/bandwidth/webhooks/conferenceEvent + conferenceEventMethod: + $ref: '#/components/schemas/callbackMethodEnum' + tag: + nullable: true + type: string + description: >- + The custom string attached to the conference that will be sent with + callbacks. + example: my custom tag + activeMembers: + type: array + nullable: true + items: + $ref: '#/components/schemas/conferenceMember' + description: >- + A list of active members of the conference. Omitted if this + + is a response to the [Get Conferences + endpoint](/apis/voice#tag/Conferences/operation/listConferences). + updateConference: + type: object + properties: + status: + $ref: '#/components/schemas/conferenceStateEnum' + redirectUrl: + nullable: true + type: string + format: uri + description: >- + The URL to send the + [conferenceRedirect](/docs/voice/webhooks/conferenceRedirect) + + event which will provide new BXML. Not allowed if `state` is + `completed`, + + but required if `state` is `active`. + example: https://myServer.example/bandwidth/webhooks/conferenceRedirect + redirectMethod: + $ref: '#/components/schemas/redirectMethodEnum' + username: + type: string + nullable: true + description: Basic auth username. + maxLength: 1024 + example: mySecretUsername + password: + type: string + nullable: true + description: Basic auth password. + maxLength: 1024 + example: mySecretPassword1! + redirectFallbackUrl: + nullable: true + type: string + format: uri + description: >- + A fallback url which, if provided, will be used to retry the + + `conferenceRedirect` webhook delivery in case `redirectUrl` fails to + respond. Not + + allowed if `state` is `completed`. + example: >- + https://myFallbackServer.example/bandwidth/webhooks/conferenceRedirect + redirectFallbackMethod: + $ref: '#/components/schemas/redirectMethodEnum' + fallbackUsername: + type: string + nullable: true + description: Basic auth username. + maxLength: 1024 + example: mySecretUsername + fallbackPassword: + type: string + nullable: true + description: Basic auth password. + maxLength: 1024 + example: mySecretPassword1! + conferenceMember: + type: object + properties: + callId: + $ref: '#/components/schemas/callId' + conferenceId: + $ref: '#/components/schemas/conferenceId' + memberUrl: + type: string + format: uri + description: >- + A URL that may be used to retrieve information about or update + + the state of this conference member. This is the URL of this + member's + + [Get Conference + Member](/apis/voice-apis/voice/#tag/Conferences/operation/getConferenceMember) + endpoint + + and [Modify Conference + Member](/apis/voice-apis/voice/#tag/Conferences/operation/updateConferenceMember) + + endpoint. + example: >- + https://voice.bandwidth.com/api/v2/accounts/9900000/conferences/conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9/members/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + mute: + type: boolean + description: >- + Whether or not this member is currently muted. Members who are muted + are still able to hear other participants. + + + If used in a PUT request, updates this member's mute status. Has no + effect if omitted. + example: false + hold: + type: boolean + description: >- + Whether or not this member is currently on hold. Members who are on + hold are not able to hear or speak in the conference. + + + If used in a PUT request, updates this member's hold status. Has no + effect if omitted. + example: false + callIdsToCoach: + nullable: true + type: array + items: + type: string + description: >- + If this member had a value set for `callIdsToCoach` in its + [Conference](/docs/voice/bxml/conference) verb or this list was + added with a previous PUT request to modify the member, this is that + list of calls. + + + If present in a PUT request, modifies the calls that this member is + coaching. Has no effect if omitted. See the documentation for the + [Conference](/docs/voice/bxml/conference) verb for more details + about coaching. + + Note that this will not add the matching calls to the conference; + each call must individually execute a Conference verb to join. + example: + - c-25ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + updateConferenceMember: + type: object + properties: + mute: + type: boolean + description: >- + Whether or not this member is currently muted. Members who are muted + are still able to hear other participants. + + + Updates this member's mute status. Has no effect if omitted. + example: false + hold: + type: boolean + description: >- + Whether or not this member is currently on hold. Members who are on + hold are not able to hear or speak in the conference. + + + Updates this member's hold status. Has no effect if omitted. + example: false + callIdsToCoach: + nullable: true + type: array + items: + type: string + description: >- + If this member had a value set for `callIdsToCoach` in its + [Conference](/docs/voice/bxml/conference) verb or this list was + added with a previous PUT request to modify the member, this is that + list of calls. + + + Modifies the calls that this member is coaching. Has no effect if + omitted. See the documentation for the + [Conference](/docs/voice/bxml/conference) verb for more details + about coaching. + + + Note that this will not add the matching calls to the conference; + each call must individually execute a Conference verb to join. + example: + - c-25ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + conferenceRecordingMetadata: + type: object + properties: + accountId: + $ref: '#/components/schemas/accountId' + conferenceId: + $ref: '#/components/schemas/conferenceId' + name: + $ref: '#/components/schemas/name' + recordingId: + $ref: '#/components/schemas/recordingId' + duration: + $ref: '#/components/schemas/duration' + channels: + $ref: '#/components/schemas/channels' + startTime: + $ref: '#/components/schemas/startTime' + endTime: + $ref: '#/components/schemas/endTime' + fileFormat: + $ref: '#/components/schemas/fileFormatEnum' + status: + $ref: '#/components/schemas/status' + mediaUrl: + $ref: '#/components/schemas/mediaUrl' + recordingName: + $ref: '#/components/schemas/recordingName' + machineDetectionConfiguration: + type: object + description: >- + The machine detection request used to perform machine detection on the + call. Currently, there is an issue where decimal values are not getting + processed correctly. Please use whole number values. We are working to + resolve this issue. Please contact Bandwidth Support if you need more + information. + properties: + mode: + $ref: '#/components/schemas/machineDetectionModeEnum' + detectionTimeout: + nullable: true + type: number + format: double + description: >- + The timeout used for the whole operation, in seconds. If no + + result is determined in this period, a callback with a `timeout` + result + + is sent. + default: 15 + example: 15 + silenceTimeout: + nullable: true + type: number + format: double + description: >- + If no speech is detected in this period, a callback with a 'silence' + result is sent. + default: 10 + example: 10 + speechThreshold: + nullable: true + type: number + format: double + description: >- + When speech has ended and a result couldn't be determined based + + on the audio content itself, this value is used to determine if the + speaker + + is a machine based on the speech duration. If the length of the + speech + + detected is greater than or equal to this threshold, the result will + be + + 'answering-machine'. If the length of speech detected is below this + threshold, + + the result will be 'human'. + default: 10 + example: 10 + speechEndThreshold: + nullable: true + type: number + format: double + description: >- + Amount of silence (in seconds) before assuming the callee has + finished speaking. + default: 5 + example: 5 + machineSpeechEndThreshold: + nullable: true + type: number + format: double + description: >- + When an answering machine is detected, the amount of silence (in + seconds) before assuming the message has finished playing. + + If not provided it will default to the speechEndThreshold value. + example: 5 + delayResult: + nullable: true + type: boolean + description: >- + If set to 'true' and if an answering machine is detected, the + + 'answering-machine' callback will be delayed until the machine is + done + + speaking, or an end of message tone is detected, or until the + 'detectionTimeout' is exceeded. If false, the 'answering-machine' + + result is sent immediately. + default: false + example: false + callbackUrl: + nullable: true + description: >- + The URL to send the 'machineDetectionComplete' webhook when the + detection is completed. Only for 'async' mode. + type: string + format: uri + maxLength: 2048 + example: https://myServer.example/bandwidth/webhooks/machineDetectionComplete + callbackMethod: + $ref: '#/components/schemas/callbackMethodEnum' + username: + type: string + nullable: true + description: Basic auth username. + maxLength: 1024 + example: mySecretUsername + password: + type: string + nullable: true + description: Basic auth password. + maxLength: 1024 + example: mySecretPassword1! + fallbackUrl: + nullable: true + type: string + format: uri + description: >- + A fallback URL which, if provided, will be used to retry the + + machine detection complete webhook delivery in case `callbackUrl` + fails + + to respond + maxLength: 2048 + example: >- + https://myFallbackServer.example/bandwidth/webhooks/machineDetectionComplete + fallbackMethod: + $ref: '#/components/schemas/callbackMethodEnum' + fallbackUsername: + type: string + nullable: true + description: Basic auth username. + maxLength: 1024 + example: mySecretUsername + fallbackPassword: + type: string + nullable: true + description: Basic auth password. + maxLength: 1024 + example: mySecretPassword1! + transcribeRecording: + type: object + properties: + callbackUrl: + type: string + format: uri + description: >- + The URL to send the + [TranscriptionAvailable](/docs/voice/webhooks/transcriptionAvailable) + + event to. You should not include sensitive or + personally-identifiable + + information in the callbackUrl field! Always use the proper username + and + + password fields for authorization. + example: https://myServer.example/bandwidth/webhooks/transcriptionAvailable + callbackMethod: + $ref: '#/components/schemas/callbackMethodEnum' + username: + type: string + nullable: true + description: Basic auth username. + maxLength: 1024 + example: mySecretUsername + password: + type: string + nullable: true + description: Basic auth password. + maxLength: 1024 + example: mySecretPassword1! + tag: + $ref: '#/components/schemas/tag1' + callbackTimeout: + nullable: true + type: number + format: double + minimum: 1 + maximum: 25 + default: 15 + description: >- + This is the timeout (in seconds) to use when delivering the + + webhook to `callbackUrl`. Can be any numeric value (including + decimals) + + between 1 and 25. + example: 5.5 + detectLanguage: + type: boolean + nullable: true + description: >- + A boolean value to indicate that the recording may not be in + English, and the transcription service will need to detect the + dominant language the recording is in and transcribe accordingly. + Current supported languages are English, French, and Spanish. + default: false + example: true + recordingTranscriptions: + type: object + properties: + transcripts: + type: array + items: + $ref: '#/components/schemas/transcription' + callTranscriptionMetadataList: + type: array + items: + $ref: '#/components/schemas/callTranscriptionMetadata' + example: + - transcriptionId: t-3f758f24-c7a2fc78-7c91-401a-8b2e-e542f9c40d6b + transcriptionName: live_transcription + transcriptionUrl: >- + https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-fef240ff-5cfc9091-8069-4863-a8c0-a4dcbbf1f1a4/transcriptions/t-3f758f24-c7a2fc78-7c91-401a-8b2e-e542f9c40d6b + callTranscriptionMetadata: + type: object + properties: + transcriptionId: + type: string + description: The programmable voice API transcription ID. + example: t-3f758f24-c7a2fc78-7c91-401a-8b2e-e542f9c40d6b + transcriptionName: + type: string + description: >- + The programmable voice API transcription name. This name could be + provided by the user when creating the transcription. + example: live_transcription + transcriptionUrl: + type: string + description: >- + A URL that may be used to retrieve the transcription itself. This + points to the + + [Get Call + Transcription](/apis/voice-apis/voice/#tag/Transcriptions/operation/getRealTimeTranscription) + endpoint. + example: >- + https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-fef240ff-5cfc9091-8069-4863-a8c0-a4dcbbf1f1a4/transcriptions/t-3f758f24-c7a2fc78-7c91-401a-8b2e-e542f9c40d6b + callTranscriptionResponse: + type: object + properties: + accountId: + type: string + description: The user account associated with the call. + example: '9900000' + callId: + type: string + description: The call id associated with the event. + example: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + transcriptionId: + type: string + description: The programmable voice API transcription ID. + example: t-3f758f24-c7a2fc78-7c91-401a-8b2e-e542f9c40d6b + tracks: + type: array + items: + $ref: '#/components/schemas/callTranscription' + example: + - detectedLanguage: en-US + track: inbound + transcript: Hello World! This is an example. + confidence: 0.9 + callTranscription: + type: object + properties: + detectedLanguage: + $ref: '#/components/schemas/callTranscriptionDetectedLanguageEnum' + track: + $ref: '#/components/schemas/callTranscriptionTrackEnum' + transcript: + type: string + description: The transcription itself. + example: Hello World! This is an example. + confidence: + type: number + format: double + minimum: 0 + maximum: 1 + description: >- + How confident the transcription engine was in transcribing the + associated audio (from `0` to `1`). + example: 0.9 + recordingTranscriptionMetadata: + nullable: true + type: object + description: If the recording was transcribed, metadata about the transcription + properties: + id: + type: string + description: The unique transcription ID + example: t-387bd648-18f3-4823-9d16-746bca0003c9 + status: + $ref: '#/components/schemas/status' + completedTime: + type: string + format: date-time + description: The time that the transcription was completed + example: '2022-06-13T18:46:29.715Z' + url: + type: string + format: uri + description: The URL of the [transcription](#operation/getCallTranscription) + example: >- + https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85/recordings/r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85/transcription + voiceApiError: + type: object + properties: + type: + type: string + description: + type: string + id: + nullable: true + type: string + answerCallback: + type: object + description: >- + The Answer event is sent to the answerUrl specified in the createCall + request when an outbound call is answered. + properties: + eventType: + $ref: '#/components/schemas/eventType' + eventTime: + $ref: '#/components/schemas/eventTime' + accountId: + $ref: '#/components/schemas/accountId' + applicationId: + $ref: '#/components/schemas/applicationId1' + from: + $ref: '#/components/schemas/from' + to: + $ref: '#/components/schemas/to' + direction: + $ref: '#/components/schemas/callDirectionEnum' + callId: + $ref: '#/components/schemas/callId' + callUrl: + $ref: '#/components/schemas/callUrl' + enqueuedTime: + $ref: '#/components/schemas/enqueuedTime' + startTime: + $ref: '#/components/schemas/startTime' + answerTime: + $ref: '#/components/schemas/answerTime' + tag: + $ref: '#/components/schemas/tag1' + machineDetectionResult: + $ref: '#/components/schemas/machineDetectionResult' + bridgeCompleteCallback: + type: object + description: >- + If the target call leaves the , then this callback is sent to + the bridgeCompleteUrl, and the BXML returned in it is executed on the + call. If this webhook is sent, the Bridge Target Complete webhook is NOT + sent. This callback is also sent if any problem occurs that prevents the + calls to be bridged. + properties: + eventType: + $ref: '#/components/schemas/eventType' + eventTime: + $ref: '#/components/schemas/eventTime' + accountId: + $ref: '#/components/schemas/accountId' + applicationId: + $ref: '#/components/schemas/applicationId1' + from: + $ref: '#/components/schemas/from' + to: + $ref: '#/components/schemas/to' + direction: + $ref: '#/components/schemas/callDirectionEnum' + callId: + $ref: '#/components/schemas/callId' + callUrl: + $ref: '#/components/schemas/callUrl' + enqueuedTime: + $ref: '#/components/schemas/enqueuedTime' + startTime: + $ref: '#/components/schemas/startTime' + answerTime: + $ref: '#/components/schemas/answerTime' + tag: + $ref: '#/components/schemas/tag1' + cause: + $ref: '#/components/schemas/cause' + errorMessage: + $ref: '#/components/schemas/errorMessage' + errorId: + $ref: '#/components/schemas/errorId' + bridgeTargetCompleteCallback: + type: object + description: >- + If the originating call leaves the , then this callback is sent + to the bridgeTargetCompleteUrl, and the BXML returned in it is executed + on the target call. If this webhook is sent, the Bridge Complete webhook + is NOT sent. + properties: + eventType: + $ref: '#/components/schemas/eventType' + eventTime: + $ref: '#/components/schemas/eventTime' + accountId: + $ref: '#/components/schemas/accountId' + applicationId: + $ref: '#/components/schemas/applicationId1' + from: + $ref: '#/components/schemas/from' + to: + $ref: '#/components/schemas/to' + direction: + $ref: '#/components/schemas/callDirectionEnum' + callId: + $ref: '#/components/schemas/callId' + callUrl: + $ref: '#/components/schemas/callUrl' + enqueuedTime: + $ref: '#/components/schemas/enqueuedTime' + startTime: + $ref: '#/components/schemas/startTime' + answerTime: + $ref: '#/components/schemas/answerTime' + tag: + $ref: '#/components/schemas/tag1' + conferenceCreatedCallback: + type: object + description: >- + The Conference Created event is fired whenever a new conference that + specified a callbackUrl is created. The response may be either empty or + a BXML document. Only the following verbs are valid for conferences: + PlayAudio, SpeakSentence, StartRecording, StopRecording, PauseRecording, + ResumeRecording. Audio verbs will be heard by all members of the + conference. Recordings capture audio from all members who are not muted + or on hold, as well as any audio verbs that are played into the + conference. + properties: + eventType: + $ref: '#/components/schemas/eventType' + eventTime: + $ref: '#/components/schemas/eventTime' + conferenceId: + $ref: '#/components/schemas/conferenceId' + name: + $ref: '#/components/schemas/name' + tag: + $ref: '#/components/schemas/tag1' + conferenceRedirectCallback: + type: object + description: >- + The Conference Redirect event is fired whenever an existing conference + is modified via a POST request made to the /conferences/{conferenceId} + endpoint. The response may be either empty or a BXML document. Only the + following verbs are valid for conferences: PlayAudio, SpeakSentence, + StartRecording, StopRecording, PauseRecording, ResumeRecording. Audio + verbs will be heard by all members of the conference. Recordings capture + audio from all members who are not muted or on hold, as well as any + audio verbs that are played into the conference. + properties: + eventType: + $ref: '#/components/schemas/eventType' + eventTime: + $ref: '#/components/schemas/eventTime' + conferenceId: + $ref: '#/components/schemas/conferenceId' + name: + $ref: '#/components/schemas/name' + tag: + $ref: '#/components/schemas/tag1' + conferenceMemberJoinCallback: + type: object + description: >- + The Conference Member Join event is fired whenever a caller joins a + conference that specified a callbackUrl. The response may be either + empty or a BXML document. Only the following verbs are valid for + conferences: PlayAudio, SpeakSentence, StartRecording, StopRecording, + PauseRecording, ResumeRecording. Audio verbs will be heard by all + members of the conference. Recordings capture audio from all members who + are not muted or on hold, as well as any audio verbs that are played + into the conference. + properties: + eventType: + $ref: '#/components/schemas/eventType' + eventTime: + $ref: '#/components/schemas/eventTime' + conferenceId: + $ref: '#/components/schemas/conferenceId' + name: + $ref: '#/components/schemas/name' + from: + $ref: '#/components/schemas/from' + to: + $ref: '#/components/schemas/to' + callId: + $ref: '#/components/schemas/callId' + tag: + $ref: '#/components/schemas/tag1' + conferenceMemberExitCallback: + type: object + description: >- + The Conference Member Exit event is fired whenever a caller exits a + conference that specified a callbackUrl. The response may be either + empty or a BXML document. Only the following verbs are valid for + conferences: PlayAudio, SpeakSentence, StartRecording, StopRecording, + PauseRecording, ResumeRecording. Audio verbs will be heard by all + members of the conference. Recordings capture audio from all members who + are not muted or on hold, as well as any audio verbs that are played + into the conference. + properties: + eventType: + $ref: '#/components/schemas/eventType' + eventTime: + $ref: '#/components/schemas/eventTime' + conferenceId: + $ref: '#/components/schemas/conferenceId' + name: + $ref: '#/components/schemas/name' + from: + $ref: '#/components/schemas/from' + to: + $ref: '#/components/schemas/to' + callId: + $ref: '#/components/schemas/callId' + tag: + $ref: '#/components/schemas/tag1' + conferenceCompletedCallback: + type: object + description: >- + The Conference Completed event is fired when the last member leaves the + conference. The response to this event may not contain BXML. + properties: + eventType: + $ref: '#/components/schemas/eventType' + eventTime: + $ref: '#/components/schemas/eventTime' + conferenceId: + $ref: '#/components/schemas/conferenceId' + name: + $ref: '#/components/schemas/name' + tag: + $ref: '#/components/schemas/tag1' + conferenceRecordingAvailableCallback: + type: object + description: >- + The Conference Recording Available event is sent after a conference + recording has been processed. It indicates that the recording is + available for download. + properties: + eventType: + $ref: '#/components/schemas/eventType' + eventTime: + $ref: '#/components/schemas/eventTime' + conferenceId: + $ref: '#/components/schemas/conferenceId' + name: + $ref: '#/components/schemas/name' + accountId: + $ref: '#/components/schemas/accountId' + recordingId: + $ref: '#/components/schemas/recordingId' + channels: + $ref: '#/components/schemas/channels' + startTime: + $ref: '#/components/schemas/startTime' + endTime: + $ref: '#/components/schemas/endTime' + duration: + $ref: '#/components/schemas/duration' + fileFormat: + $ref: '#/components/schemas/fileFormatEnum' + mediaUrl: + $ref: '#/components/schemas/mediaUrl' + tag: + $ref: '#/components/schemas/tag1' + status: + $ref: '#/components/schemas/status' + disconnectCallback: + type: object + description: The Disconnect event is fired when a call ends, for any reason. + properties: + eventType: + $ref: '#/components/schemas/eventType' + eventTime: + $ref: '#/components/schemas/eventTime' + accountId: + $ref: '#/components/schemas/accountId' + applicationId: + $ref: '#/components/schemas/applicationId1' + from: + $ref: '#/components/schemas/from' + to: + $ref: '#/components/schemas/to' + callId: + $ref: '#/components/schemas/callId' + direction: + $ref: '#/components/schemas/callDirectionEnum' + callUrl: + $ref: '#/components/schemas/callUrl' + enqueuedTime: + $ref: '#/components/schemas/enqueuedTime' + startTime: + $ref: '#/components/schemas/startTime' + answerTime: + $ref: '#/components/schemas/answerTime' + endTime: + $ref: '#/components/schemas/endTime' + cause: + $ref: '#/components/schemas/cause' + errorMessage: + $ref: '#/components/schemas/errorMessage' + errorId: + $ref: '#/components/schemas/errorId' + tag: + $ref: '#/components/schemas/tag1' + dtmfCallback: + type: object + description: >- + The DTMF event is sent for every digit detected after a + verb is executed. You may not respond to this event with BXML. + properties: + eventType: + $ref: '#/components/schemas/eventType' + eventTime: + $ref: '#/components/schemas/eventTime' + accountId: + $ref: '#/components/schemas/accountId' + applicationId: + $ref: '#/components/schemas/applicationId1' + from: + $ref: '#/components/schemas/from' + to: + $ref: '#/components/schemas/to' + callId: + $ref: '#/components/schemas/callId' + direction: + $ref: '#/components/schemas/callDirectionEnum' + digit: + $ref: '#/components/schemas/digit' + callUrl: + $ref: '#/components/schemas/callUrl' + enqueuedTime: + $ref: '#/components/schemas/enqueuedTime' + startTime: + $ref: '#/components/schemas/startTime' + answerTime: + $ref: '#/components/schemas/answerTime' + parentCallId: + $ref: '#/components/schemas/parentCallId' + transferCallerId: + $ref: '#/components/schemas/transferCallerId' + transferTo: + $ref: '#/components/schemas/transferTo' + tag: + $ref: '#/components/schemas/tag1' + gatherCallback: + type: object + description: >- + The gather event is sent after a verb is executed. Its purpose + is to report the gathered digits to the calling application. + properties: + eventType: + $ref: '#/components/schemas/eventType' + eventTime: + $ref: '#/components/schemas/eventTime' + accountId: + $ref: '#/components/schemas/accountId' + applicationId: + $ref: '#/components/schemas/applicationId1' + from: + $ref: '#/components/schemas/from' + to: + $ref: '#/components/schemas/to' + direction: + $ref: '#/components/schemas/callDirectionEnum' + callId: + $ref: '#/components/schemas/callId' + digits: + $ref: '#/components/schemas/digits' + callUrl: + $ref: '#/components/schemas/callUrl' + enqueuedTime: + $ref: '#/components/schemas/enqueuedTime' + startTime: + $ref: '#/components/schemas/startTime' + answerTime: + $ref: '#/components/schemas/answerTime' + parentCallId: + $ref: '#/components/schemas/parentCallId' + terminatingDigit: + $ref: '#/components/schemas/terminatingDigit' + transferCallerId: + $ref: '#/components/schemas/transferCallerId' + transferTo: + $ref: '#/components/schemas/transferTo' + tag: + $ref: '#/components/schemas/tag1' + initiateCallback: + type: object + description: >- + The Initiate event is fired when an inbound call is received for a + Telephone Number on your Account. It is sent to the URL specified in the + application associated with the location (sip-peer) that the called + telephone number belongs to. + properties: + eventType: + $ref: '#/components/schemas/eventType' + eventTime: + $ref: '#/components/schemas/eventTime' + accountId: + $ref: '#/components/schemas/accountId' + applicationId: + $ref: '#/components/schemas/applicationId1' + from: + $ref: '#/components/schemas/from' + to: + $ref: '#/components/schemas/to' + direction: + $ref: '#/components/schemas/callDirectionEnum' + callId: + $ref: '#/components/schemas/callId' + callUrl: + $ref: '#/components/schemas/callUrl' + startTime: + $ref: '#/components/schemas/startTime' + diversion: + $ref: '#/components/schemas/diversion' + stirShaken: + $ref: '#/components/schemas/stirShaken' + uui: + $ref: '#/components/schemas/uui' + machineDetectionCompleteCallback: + type: object + description: >- + This event is sent to the url informed when requesting a machine + detection operation. It contains the machine detection operation result, + which can be: human, answering-machine, silence, timeout, error. This + event is not sent when sync answering machine detection mode is chosen. + properties: + eventType: + $ref: '#/components/schemas/eventType' + eventTime: + $ref: '#/components/schemas/eventTime' + accountId: + $ref: '#/components/schemas/accountId' + applicationId: + $ref: '#/components/schemas/applicationId1' + from: + $ref: '#/components/schemas/from' + to: + $ref: '#/components/schemas/to' + direction: + $ref: '#/components/schemas/callDirectionEnum' + callId: + $ref: '#/components/schemas/callId' + callUrl: + $ref: '#/components/schemas/callUrl' + enqueuedTime: + $ref: '#/components/schemas/enqueuedTime' + startTime: + $ref: '#/components/schemas/startTime' + answerTime: + $ref: '#/components/schemas/answerTime' + tag: + $ref: '#/components/schemas/tag1' + machineDetectionResult: + $ref: '#/components/schemas/machineDetectionResult' + recordingCompleteCallback: + type: object + description: >- + The Record Complete event is sent after a verb has executed if + the call is still active. The BXML returned by this callback is executed + next. When the recording is available for download, a Recording + Available event will be sent. + properties: + eventType: + $ref: '#/components/schemas/eventType' + eventTime: + $ref: '#/components/schemas/eventTime' + accountId: + $ref: '#/components/schemas/accountId' + applicationId: + $ref: '#/components/schemas/applicationId1' + from: + $ref: '#/components/schemas/from' + to: + $ref: '#/components/schemas/to' + direction: + $ref: '#/components/schemas/callDirectionEnum' + callId: + $ref: '#/components/schemas/callId' + callUrl: + $ref: '#/components/schemas/callUrl' + parentCallId: + $ref: '#/components/schemas/parentCallId' + recordingId: + $ref: '#/components/schemas/recordingId' + mediaUrl: + $ref: '#/components/schemas/mediaUrl' + enqueuedTime: + $ref: '#/components/schemas/enqueuedTime' + startTime: + $ref: '#/components/schemas/startTime' + answerTime: + $ref: '#/components/schemas/answerTime' + endTime: + $ref: '#/components/schemas/endTime' + duration: + $ref: '#/components/schemas/duration' + fileFormat: + $ref: '#/components/schemas/fileFormatEnum' + channels: + $ref: '#/components/schemas/channels' + tag: + $ref: '#/components/schemas/tag1' + transferCallerId: + $ref: '#/components/schemas/transferCallerId' + transferTo: + $ref: '#/components/schemas/transferTo' + recordingAvailableCallback: + type: object + description: >- + The Recording Available event is sent after a recording has been + processed. It indicates that the recording is available for download. + properties: + eventType: + $ref: '#/components/schemas/eventType' + eventTime: + $ref: '#/components/schemas/eventTime' + accountId: + $ref: '#/components/schemas/accountId' + applicationId: + $ref: '#/components/schemas/applicationId1' + from: + $ref: '#/components/schemas/from' + to: + $ref: '#/components/schemas/to' + direction: + $ref: '#/components/schemas/callDirectionEnum' + callId: + $ref: '#/components/schemas/callId' + callUrl: + $ref: '#/components/schemas/callUrl' + parentCallId: + $ref: '#/components/schemas/parentCallId' + recordingId: + $ref: '#/components/schemas/recordingId' + mediaUrl: + $ref: '#/components/schemas/mediaUrl' + enqueuedTime: + $ref: '#/components/schemas/enqueuedTime' + startTime: + $ref: '#/components/schemas/startTime' + endTime: + $ref: '#/components/schemas/endTime' + duration: + $ref: '#/components/schemas/duration' + fileFormat: + $ref: '#/components/schemas/fileFormatEnum' + channels: + $ref: '#/components/schemas/channels' + tag: + $ref: '#/components/schemas/tag1' + status: + $ref: '#/components/schemas/status' + transferCallerId: + $ref: '#/components/schemas/transferCallerId' + transferTo: + $ref: '#/components/schemas/transferTo' + redirectCallback: + type: object + description: >- + The Redirect event is fired when a verb is executed. Its + purpose is to get the next set of verbs from the calling application. + properties: + eventType: + $ref: '#/components/schemas/eventType' + eventTime: + $ref: '#/components/schemas/eventTime' + accountId: + $ref: '#/components/schemas/accountId' + applicationId: + $ref: '#/components/schemas/applicationId1' + from: + $ref: '#/components/schemas/from' + to: + $ref: '#/components/schemas/to' + direction: + $ref: '#/components/schemas/callDirectionEnum' + callId: + $ref: '#/components/schemas/callId' + callUrl: + $ref: '#/components/schemas/callUrl' + parentCallId: + $ref: '#/components/schemas/parentCallId' + enqueuedTime: + $ref: '#/components/schemas/enqueuedTime' + startTime: + $ref: '#/components/schemas/startTime' + answerTime: + $ref: '#/components/schemas/answerTime' + tag: + $ref: '#/components/schemas/tag1' + transferCallerId: + $ref: '#/components/schemas/transferCallerId' + transferTo: + $ref: '#/components/schemas/transferTo' + transcriptionAvailableCallback: + type: object + description: >- + The Transcription Available event is sent when the recording + transcription is available to be downloaded. + properties: + eventType: + $ref: '#/components/schemas/eventType' + eventTime: + $ref: '#/components/schemas/eventTime' + accountId: + $ref: '#/components/schemas/accountId' + applicationId: + $ref: '#/components/schemas/applicationId1' + from: + $ref: '#/components/schemas/from' + to: + $ref: '#/components/schemas/to' + direction: + $ref: '#/components/schemas/callDirectionEnum' + callId: + $ref: '#/components/schemas/callId' + callUrl: + $ref: '#/components/schemas/callUrl' + mediaUrl: + $ref: '#/components/schemas/mediaUrl' + parentCallId: + $ref: '#/components/schemas/parentCallId' + recordingId: + $ref: '#/components/schemas/recordingId' + enqueuedTime: + $ref: '#/components/schemas/enqueuedTime' + startTime: + $ref: '#/components/schemas/startTime' + endTime: + $ref: '#/components/schemas/endTime' + duration: + $ref: '#/components/schemas/duration' + fileFormat: + $ref: '#/components/schemas/fileFormatEnum' + tag: + $ref: '#/components/schemas/tag1' + transcription: + $ref: '#/components/schemas/transcription' + transferCallerId: + $ref: '#/components/schemas/transferCallerId' + transferTo: + $ref: '#/components/schemas/transferTo' + transferAnswerCallback: + type: object + description: >- + When processing a verb, this event is sent when a called + party (B-leg) answers. The event is sent to the endpoint specified in + the transferAnswerUrl attribute of the tag that answered. + BXML returned by this callback will be executed for the called party + only. After all BXML has been executed, the called party will be bridged + to the original call. Most BXML verbs are allowed in response to a + transferAnswer event, but some are not allowed. + properties: + eventType: + $ref: '#/components/schemas/eventType' + eventTime: + $ref: '#/components/schemas/eventTime' + accountId: + $ref: '#/components/schemas/accountId' + applicationId: + $ref: '#/components/schemas/applicationId1' + from: + $ref: '#/components/schemas/from' + to: + $ref: '#/components/schemas/to' + direction: + $ref: '#/components/schemas/callDirectionEnum' + callId: + $ref: '#/components/schemas/callId' + callUrl: + $ref: '#/components/schemas/callUrl' + enqueuedTime: + $ref: '#/components/schemas/enqueuedTime' + startTime: + $ref: '#/components/schemas/startTime' + answerTime: + $ref: '#/components/schemas/answerTime' + tag: + $ref: '#/components/schemas/tag1' + transferCallerId: + $ref: '#/components/schemas/transferCallerId' + transferTo: + $ref: '#/components/schemas/transferTo' + transferCompleteCallback: + type: object + description: >- + This event is sent to the transferCompleteUrl of the A-leg's + verb when the transferred call (B-leg) completes. In a simultaneous + ringing scenario, only one B-leg succeeds and this event corresponds to + that successful leg. If none of the calls were answered, the + transferComplete event corresponds to one of the legs. + properties: + eventType: + $ref: '#/components/schemas/eventType' + eventTime: + $ref: '#/components/schemas/eventTime' + accountId: + $ref: '#/components/schemas/accountId' + applicationId: + $ref: '#/components/schemas/applicationId1' + from: + $ref: '#/components/schemas/from' + to: + $ref: '#/components/schemas/to' + direction: + $ref: '#/components/schemas/callDirectionEnum' + callId: + $ref: '#/components/schemas/callId' + callUrl: + $ref: '#/components/schemas/callUrl' + enqueuedTime: + $ref: '#/components/schemas/enqueuedTime' + startTime: + $ref: '#/components/schemas/startTime' + answerTime: + $ref: '#/components/schemas/answerTime' + tag: + $ref: '#/components/schemas/tag1' + transferCallerId: + $ref: '#/components/schemas/transferCallerId' + transferTo: + $ref: '#/components/schemas/transferTo' + cause: + $ref: '#/components/schemas/cause' + errorMessage: + $ref: '#/components/schemas/errorMessage' + errorId: + $ref: '#/components/schemas/errorId' + transferDisconnectCallback: + type: object + description: >- + This event is sent to the transferDisconnectUrl of each + tag when its respective call leg ends for any reason. The event is sent + in the normal case, when the transferred leg is answered and later hung + up, but is also sent if the new leg was never answered in the first + place, if it was rejected, and if the original call leg hung up before + the transferred leg. + properties: + eventType: + $ref: '#/components/schemas/eventType' + eventTime: + $ref: '#/components/schemas/eventTime' + accountId: + $ref: '#/components/schemas/accountId' + applicationId: + $ref: '#/components/schemas/applicationId1' + from: + $ref: '#/components/schemas/from' + to: + $ref: '#/components/schemas/to' + direction: + $ref: '#/components/schemas/callDirectionEnum' + callId: + $ref: '#/components/schemas/callId' + callUrl: + $ref: '#/components/schemas/callUrl' + parentCallId: + $ref: '#/components/schemas/parentCallId' + enqueuedTime: + $ref: '#/components/schemas/enqueuedTime' + startTime: + $ref: '#/components/schemas/startTime' + answerTime: + $ref: '#/components/schemas/answerTime' + endTime: + $ref: '#/components/schemas/endTime' + tag: + $ref: '#/components/schemas/tag1' + transferCallerId: + $ref: '#/components/schemas/transferCallerId' + transferTo: + $ref: '#/components/schemas/transferTo' + cause: + $ref: '#/components/schemas/cause' + errorMessage: + $ref: '#/components/schemas/errorMessage' + errorId: + $ref: '#/components/schemas/errorId' + eventType: + type: string + description: >- + The event type, value can be one of the following: answer, + bridgeComplete, bridgeTargetComplete, conferenceCreated, + conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, + conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, + gather, initiate, machineDetectionComplete, recordingComplete, + recordingAvailable, redirect, transcriptionAvailable, transferAnswer, + transferComplete, transferDisconnect. + example: bridgeComplete + eventTime: + type: string + format: date-time + description: >- + The approximate UTC date and time when the event was generated by the + Bandwidth server, in ISO 8601 format. This may not be exactly the time + of event execution. + example: '2022-06-17T22:19:40.375Z' + accountId: + type: string + description: The user account associated with the call. + example: '9900000' + applicationId1: + type: string + description: The id of the application associated with the call. + example: 04e88489-df02-4e34-a0ee-27a91849555f + to: + type: string + description: >- + The phone number that received the call, in E.164 format (e.g. + +15555555555). + example: '+15555555555' + from: + type: string + description: >- + The provided identifier of the caller. Must be a phone number in E.164 + format (e.g. +15555555555). + example: '+15555555555' + conferenceId: + type: string + description: The unique, Bandwidth-generated ID of the conference that was recorded + example: conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9 + name: + type: string + description: The user-specified name of the conference that was recorded + example: my-conference-name + recordingId: + type: string + description: The unique ID of this recording + example: r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833 + duration: + type: string + description: The duration of the recording in ISO-8601 format + example: PT13.67S + channels: + type: integer + format: int32 + description: >- + Always `1` for conference recordings; multi-channel recordings are not + supported on conferences. + example: 1 + digit: + type: string + description: The digit collected in the call. + example: '2' + digits: + type: string + description: >- + (optional) The digits, letters, and/or symbols entered by the user. The + string is empty if a timeout occurred before any buttons were pressed. + example: '123' + terminatingDigit: + type: string + description: >- + (optional) The digit the user pressed to end the gather. Empty string + value if no terminating digit was pressed. + example: '#' + startTime: + type: string + format: date-time + description: Time the call was started, in ISO 8601 format. + example: '2022-06-17T22:19:40.375Z' + enqueuedTime: + type: string + format: date-time + description: >- + (optional) If call queueing is enabled and this is an outbound call, + time the call was queued, in ISO 8601 format. + example: '2022-06-17T22:20:00.000Z' + nullable: true + answerTime: + type: string + format: date-time + description: Time the call was answered, in ISO 8601 format. + example: '2022-06-17T22:20:00.000Z' + nullable: true + endTime: + type: string + format: date-time + description: The time that the recording ended in ISO-8601 format + example: '2022-06-17T22:20:00.000Z' + status: + type: string + description: >- + The current status of the process. For recording, current possible + values are 'processing', 'partial', 'complete', 'deleted', and 'error'. + For transcriptions, current possible values are 'none', 'processing', + 'available', 'error', 'timeout', 'file-size-too-big', and + 'file-size-too-small'. Additional states may be added in the future, so + your application must be tolerant of unknown values. + example: completed + transferCallerId: + type: string + description: >- + The phone number used as the from field of the B-leg call, in E.164 + format (e.g. +15555555555). + example: '+15555555555' + transferTo: + type: string + description: >- + The phone number used as the to field of the B-leg call, in E.164 format + (e.g. +15555555555). + example: '+15555555555' + mediaUrl: + nullable: true + type: string + format: uri + description: >- + The URL that can be used to download the recording. Only present if the + recording is finished and may be downloaded. + example: >- + https://voice.bandwidth.com/api/v2/accounts/9900000/conferences/conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9/recordings/r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833/media + callId: + type: string + description: The call id associated with the event. + example: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + recordingName: + type: string + description: A name to identify this recording. + example: my-recording-name + callUrl: + type: string + format: uri + description: The URL of the call associated with the event. + example: >- + https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + parentCallId: + type: string + description: >- + (optional) If the event is related to the B leg of a , the + call id of the original call leg that executed the . + Otherwise, this field will not be present. + example: c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d + tag1: + type: string + description: >- + (optional) The tag specified on call creation. If no tag was specified + or it was previously cleared, this field will not be present. + example: exampleTag + nullable: true + cause: + type: string + description: >- + Reason the call failed - hangup, busy, timeout, cancel, rejected, + callback-error, invalid-bxml, application-error, account-limit, + node-capacity-exceeded, error, or unknown. + example: busy + errorMessage: + type: string + description: >- + Text explaining the reason that caused the call to fail in case of + errors. + example: >- + Call c-2a913f94-6a486f3a-3cae-4034-bcc3-f0c9fa77ca2f is already bridged + with another call + nullable: true + errorId: + type: string + description: Bandwidth's internal id that references the error event. + example: 4642074b-7b58-478b-96e4-3a60955c6765 + nullable: true + machineDetectionResult: + type: object + description: >- + (optional) if machine detection was requested in sync mode, the result + will be specified here. Possible values are the same as the async + counterpart: Machine Detection Complete + properties: + value: + type: string + description: >- + Possible values are answering-machine, human, silence, timeout, or + error. + example: answering-machine + duration: + type: string + description: The amount of time it took to determine the result. + example: PT4.9891287S + nullable: true + diversion: + type: object + properties: + reason: + type: string + description: >- + The reason for the diversion. Common values: unknown, user-busy, + no-answer, unavailable, unconditional, time-of-day, do-not-disturb, + deflection, follow-me, out-of-service, away. + example: unavailable + privacy: + type: string + description: off or full + example: 'off' + screen: + type: string + description: >- + No if the number was provided by the user, yes if the number was + provided by the network + example: 'no' + counter: + type: string + description: The number of diversions that have occurred + example: '2' + limit: + type: string + description: The maximum number of diversions allowed for this session + example: '3' + unknown: + type: string + description: >- + The normal list of values is not exhaustive. Your application must + be tolerant of unlisted keys and unlisted values of those keys. + example: unknownValue + origTo: + type: string + description: >- + Always present. Indicates the last telephone number that the call + was diverted from. + example: '+15558884444' + transcription: + type: object + properties: + text: + type: string + description: The transcribed text + example: Nice talking to you, friend! + confidence: + type: number + format: double + description: >- + The confidence on the recognized content, ranging from `0.0` to + `1.0` with `1.0` being the highest confidence. + example: 0.9 + stirShaken: + type: object + properties: + verstat: + type: string + description: >- + (optional) The verification status indicating whether the + verification was successful or not. Possible values are + TN-Validation-Passed and TN-Validation-Failed. + example: Tn-Validation-Passed + attestationIndicator: + type: string + description: >- + (optional) The attestation level verified by Bandwidth. Possible + values are A (full), B (partial) or C (gateway). + example: A + originatingId: + type: string + description: (optional) A unique origination identifier. + example: 99759086-1335-11ed-9bcf-5f7d464e91af + uui: + type: string + description: >- + The value of the `User-To-User` header to send within the initial + `INVITE`. Must include the encoding parameter as specified in RFC 7433. + Only `base64`, `jwt` and `hex` encoding are currently allowed. This + value, including the encoding specifier, may not exceed 256 characters. + example: bXktdXVp + maxLength: 256 + codeRequest: + type: object + properties: + to: + type: string + description: The phone number to send the mfa code to. + pattern: ^\+[1-9]\d{1,14}$ + example: '+19195551234' + from: + type: string + description: The application phone number, the sender of the mfa code. + pattern: ^\+[1-9]\d{1,14}$ + maxLength: 32 + example: '+19195554321' + applicationId: + type: string + description: The application unique ID, obtained from Bandwidth. + maxLength: 50 + example: 66fd98ae-ac8d-a00f-7fcd-ba3280aeb9b1 + scope: + type: string + description: >- + An optional field to denote what scope or action the mfa code is + addressing. If not supplied, defaults to "2FA". + maxLength: 25 + example: 2FA + message: + type: string + description: >- + The message format of the mfa code. There are three values that the + system will replace "{CODE}", "{NAME}", "{SCOPE}". The "{SCOPE}" + and "{NAME} value template are optional, while "{CODE}" must be + supplied. As the name would suggest, code will be replace with the + actual mfa code. Name is replaced with the application name, + configured during provisioning of mfa. The scope value is the same + value sent during the call and partitioned by the server. + maxLength: 2048 + example: Your temporary {NAME} {SCOPE} code is {CODE} + digits: + type: integer + description: >- + The number of digits for your mfa code. The valid number ranges + from 2 to 8, inclusively. + minimum: 4 + maximum: 8 + example: 6 + required: + - to + - from + - applicationId + - message + - digits + voiceCodeResponse: + type: object + properties: + callId: + type: string + description: Programmable Voice API Call ID. + example: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + messagingCodeResponse: + type: object + properties: + messageId: + type: string + description: Messaging API Message ID. + example: 1589228074636lm4k2je7j7jklbn2 + verifyCodeRequest: + type: object + properties: + to: + type: string + description: The phone number to send the mfa code to. + pattern: ^\+[1-9]\d{1,14}$ + example: '+19195551234' + scope: + type: string + description: >- + An optional field to denote what scope or action the mfa code is + addressing. If not supplied, defaults to "2FA". + example: 2FA + expirationTimeInMinutes: + type: number + description: >- + The time period, in minutes, to validate the mfa code. By setting + this to 3 minutes, it will mean any code generated within the last 3 + minutes are still valid. The valid range for expiration time is + between 0 and 15 minutes, exclusively and inclusively, respectively. + minimum: 1 + maximum: 15 + example: 3 + code: + type: string + description: The generated mfa code to check if valid. + minLength: 4 + maxLength: 8 + example: '123456' + required: + - to + - expirationTimeInMinutes + - code + verifyCodeResponse: + type: object + properties: + valid: + type: boolean + description: Whether or not the supplied code is valid. + example: true + mfaRequestError: + type: object + properties: + error: + type: string + description: A message describing the error with your request. + example: 400 Request is malformed or invalid + requestId: + type: string + description: The associated requestId from AWS. + example: 354cc8a3-6701-461e-8fa7-8671703dd898 + mfaUnauthorizedRequestError: + type: object + properties: + message: + type: string + description: Unauthorized + example: Unauthorized + mfaForbiddenRequestError: + type: object + properties: + message: + type: string + description: >- + The message containing the reason behind the request being + forbidden. + example: Missing Authentication Token + completedLookupStatusEnum: + type: string + enum: + - COMPLETE + - PARTIAL_COMPLETE + - FAILED + example: COMPLETE + inProgressLookupStatusEnum: + type: string + enum: + - IN_PROGRESS + - COMPLETE + - PARTIAL_COMPLETE + - FAILED + example: COMPLETE + deactivationEventEnum: + type: string + description: > + [DNI-Only](#section/DNI-Only). + + `DEACTIVATED` if the carrier reported a deactivation event for this + phone number. + enum: + - DEACTIVATED + latestMessageDeliveryStatusEnum: + type: string + description: >- + [DNI-Only](#section/DNI-Only). The current delivery status of the phone + number. + + - ACTIVE: A message was successfully sent to the number (delivery code + 0). + + - DEACTIVATED: A message was not delivered to a number (delivery code + 720) + + - UNKNOWN: Bandwidth cannot find an delivery status entry for the + number. + enum: + - ACTIVE + - DEACTIVATED + - UNKNOWN + lineTypeEnum: + type: string + enum: + - FIXED + - VOIP-FIXED + - MOBILE + - VOIP + example: MOBILE + requestId: + type: string + format: uuid + description: The phone number lookup request ID from Bandwidth. + example: 004223a0-8b17-41b1-bf81-20732adf5590 + linkSchema: + title: Link + type: object + properties: + href: + type: string + description: URI of the link. + example: /relative/uri + rel: + type: string + description: Specifies the relationship between this link and the resource. + example: aRelatedResource + method: + type: string + description: HTTP method to be used. + example: GET + lookupErrorSchema: + type: object + properties: + code: + type: string + description: Validation error code + example: NO-MATCH + description: + type: string + description: Description of validation error + example: Example error description + type: + type: string + description: Type of validation error + example: NumberInventory + meta: + type: object + properties: + phoneNumbers: + type: array + items: + type: string + description: Phone number experiencing the error. + example: + - '+13992077164' + - '+19196104424' + message: + type: string + description: Message describing the error + example: Invalid TNs + code: + type: integer + description: Error code associated with the message + example: 1001 + syncLookupRequest: + type: object + properties: + phoneNumbers: + description: Telephone numbers in E.164 format. + type: array + minimum: 1 + maximum: 100 + items: + type: string + pattern: ^\+[1-9]\d{1,14}$ + required: + - phoneNumbers + asyncLookupRequest: + type: object + properties: + phoneNumbers: + description: Telephone numbers in E.164 format. + type: array + minimum: 1 + maximum: 15000 + items: + type: string + pattern: ^\+[1-9]\d{1,14}$ + required: + - phoneNumbers + createSyncLookupResponse: + type: object + properties: + links: + type: array + items: + $ref: '#/components/schemas/linkSchema' + example: [] + data: + type: object + description: The phone number lookup response data + properties: + requestId: + $ref: '#/components/schemas/requestId' + status: + $ref: '#/components/schemas/completedLookupStatusEnum' + results: + type: array + description: >- + The carrier information results for the specified telephone + numbers. + items: + $ref: '#/components/schemas/lookupResult' + errors: + type: array + items: + $ref: '#/components/schemas/lookupErrorSchema' + createAsyncBulkLookupResponse: + type: object + properties: + links: + type: array + description: Links for pagination (if applicable) + items: + $ref: '#/components/schemas/linkSchema' + data: + type: object + description: The phone number lookup response data + properties: + requestId: + $ref: '#/components/schemas/requestId' + status: + $ref: '#/components/schemas/inProgressLookupStatusEnum' + errors: + type: array + items: + $ref: '#/components/schemas/lookupErrorSchema' + getAsyncBulkLookupResponse: + type: object + properties: + links: + type: array + items: + $ref: '#/components/schemas/linkSchema' + example: [] + data: + type: object + description: The phone number lookup response data + properties: + requestId: + $ref: '#/components/schemas/requestId' + status: + $ref: '#/components/schemas/inProgressLookupStatusEnum' + results: + type: array + description: >- + The carrier information results for the specified telephone + number. + items: + $ref: '#/components/schemas/lookupResult' + errors: + type: array + items: + $ref: '#/components/schemas/lookupErrorSchema' + lookupErrorResponse: + type: object + properties: + links: + type: array + items: + $ref: '#/components/schemas/linkSchema' + example: [] + data: + type: object + description: The phone number lookup response data + errors: + type: array + items: + $ref: '#/components/schemas/lookupErrorSchema' + lookupResult: + type: object + description: Carrier information results for the specified telephone number. + properties: + phoneNumber: + type: string + description: The telephone number in E.164 format. + example: '+10072904498' + lineType: + $ref: '#/components/schemas/lineTypeEnum' + messagingProvider: + type: string + description: The messaging service provider of the telephone number. + example: Verizon Wireless + voiceProvider: + type: string + description: The voice service provider of the telephone number. + example: Verizon Wireless + countryCodeA3: + type: string + description: >- + The country code of the telephone number in ISO 3166-1 alpha-3 + format. + example: USA + deactivationReporter: + type: string + description: > + [DNI-Only](#section/DNI-Only). + + The carrier that reported a deactivation event for this phone + number. + deactivationDate: + type: string + format: date-time-local + description: >- + [DNI-Only](#section/DNI-Only). The datetime the carrier reported a + deactivation event. + example: 2025-06-20 18:35 + deactivationEvent: + $ref: '#/components/schemas/deactivationEventEnum' + latestMessageDeliveryStatus: + $ref: '#/components/schemas/latestMessageDeliveryStatusEnum' + initialMessageDeliveryStatusDate: + type: string + format: date + description: >- + [DNI-Only](#section/DNI-Only). The date the phone number entered the + status described in `latestMessageDeliveryStatus`. + + Think of this as the "start time" for that status. + + Value resets every time the `latestMessageDeliveryStatus` changes. + example: '2025-06-20' + latestMessageDeliveryStatusDate: + type: string + format: date + description: >- + [DNI-Only](#section/DNI-Only). The date bandwidth last received + delivery status information for this phone number. + + Use this field to understand how up-to-date the + `latestMessageDeliveryStatus` is. + + Value resets every time the `latestMessageDeliveryStatus` changes. + example: '2025-06-21' + accountId1: + type: string + description: User's account ID. + example: '1234567' + tfPhoneNumber: + type: string + description: Toll-free telephone number in E.164 format. + minLength: 12 + maxLength: 12 + nullable: false + pattern: ^\+1(800|833|844|855|866|877|888)[2-9]\d{6}$ + example: '+18005555555' + tfvWebhookErrors: + type: array + description: Details of the errors that were encountered when processing the request. + items: + type: string + example: 'optInWorkflowImageURLs: Entries must be a valid array of objects.' + tfvCallbackStatusEnum: + type: string + enum: + - VERIFIED + - UNVERIFIED + example: VERIFIED + tfvUnverifiedStatus: + type: string + default: UNVERIFIED + example: UNVERIFIED + declineReasonDescription: + type: string + description: Explanation for why a verification request was declined. + nullable: false + example: >- + Invalid Information - Can't Validate URL - Website is not accessible / + not available + denialStatusCode: + description: Reason code for denial. + type: integer + example: 511 + resubmitAllowed: + description: >- + Whether a Toll-Free Verification request qualifies for resubmission via + PUT. + example: true + type: boolean + blocked: + description: >- + Whether a Toll-Free Verification is blocked. This attribute will only be + defined when the number is blocked. + example: true + type: boolean + blockedReason: + description: >- + The reason why the Toll-Free Verification is blocked. This attribute + will only be defined when the number is blocked. + example: Toll-free number was used to send spam messages + type: string + privacyPolicyUrl: + description: The Toll-Free Verification request privacy policy URL. + example: http://your-company.com/privacyPolicy + type: string + termsAndConditionsUrl: + description: The Toll-Free Verification request terms and conditions policy URL. + example: http://your-company.com/termsAndConditions + type: string + businessDba: + description: The company 'Doing Business As'. + example: Another Company Name Inc. + type: string + businessRegistrationNumber: + type: string + description: >- + US Federal Tax ID Number (EIN) or Canada Business Number (CBN). Optional + until early 2026. If a value is provided for this field, a value must be + provided for `businessRegistrationType` and `businessEntityType`. + Available starting October 1st, 2025. + nullable: true + maxLength: 500 + example: 12-3456789 + businessRegistrationTypeEnum: + type: string + description: >- + The type of business registration number. Optional until early 2026; + required if `businessRegistrationNumber` is provided. Available starting + October 1st, 2025. + enum: + - EIN + - CBN + nullable: true + businessEntityTypeEnum: + type: string + description: >- + The type of registered business. If no option is applicable, please + provide "SOLE_PROPRIETOR" as a value. Optional until early 2026; + required if `businessRegistrationNumber` is provided. Available starting + October 1st, 2025. + enum: + - SOLE_PROPRIETOR + - PRIVATE_PROFIT + - PUBLIC_PROFIT + - NON_PROFIT + - GOVERNMENT + nullable: true + helpMessageResponse: + type: string + description: A message that gets sent to users requesting help. + nullable: true + maxLength: 500 + example: Please contact support for assistance. + ageGatedContent: + type: boolean + description: Indicates whether the content is age-gated. + example: false + additionalDenialReason: + properties: + statusCode: + $ref: '#/components/schemas/denialStatusCode' + reason: + $ref: '#/components/schemas/declineReasonDescription' + resubmitAllowed: + $ref: '#/components/schemas/resubmitAllowed' + required: + - statusCode + - reason + - resubmitAllowed + type: object + internalTicketNumber: + type: string + format: uuid + description: >- + Unique identifier (UUID) generated by Bandwidth to assist in tracking + the verification status of a toll-free number - included in all webhook + payloads. + example: acde070d-8c4c-4f0d-9d8a-162843c10333 + internalTicketNumberForWebhook: + type: string + format: uuid + description: >- + Unique identifier (UUID) generated by Bandwidth to assist in tracking + the verification status of a toll-free number. + example: acde070d-8c4c-4f0d-9d8a-162843c10333 + businessContactPhoneNumber: + description: Contact telephone number + type: string + minLength: 1 + maxLength: 500 + nullable: false + example: '+19192654500' + verificationRequest: + type: object + required: + - businessAddress + - businessContact + - messageVolume + - phoneNumbers + - useCase + - useCaseSummary + - productionMessageContent + - optInWorkflow + properties: + businessAddress: + $ref: '#/components/schemas/address' + businessContact: + $ref: '#/components/schemas/contact' + messageVolume: + type: integer + description: Estimated monthly volume of messages from the toll-free number. + minimum: 10 + maximum: 10000000 + example: 10000 + phoneNumbers: + type: array + minItems: 1 + maxItems: 10 + items: + $ref: '#/components/schemas/tfPhoneNumber' + useCase: + $ref: '#/components/schemas/useCase' + useCaseSummary: + $ref: '#/components/schemas/useCaseSummary' + productionMessageContent: + $ref: '#/components/schemas/productionMessageContent' + optInWorkflow: + $ref: '#/components/schemas/optInWorkflow' + additionalInformation: + type: string + description: Any additional information. + minLength: 0 + maxLength: 500 + nullable: true + example: Any additional information + isvReseller: + $ref: '#/components/schemas/isvReseller' + privacyPolicyUrl: + $ref: '#/components/schemas/privacyPolicyUrl' + termsAndConditionsUrl: + $ref: '#/components/schemas/termsAndConditionsUrl' + businessDba: + $ref: '#/components/schemas/businessDba' + businessRegistrationNumber: + $ref: '#/components/schemas/businessRegistrationNumber' + businessRegistrationType: + $ref: '#/components/schemas/businessRegistrationTypeEnum' + businessEntityType: + $ref: '#/components/schemas/businessEntityTypeEnum' + helpMessageResponse: + $ref: '#/components/schemas/helpMessageResponse' + ageGatedContent: + $ref: '#/components/schemas/ageGatedContent' + verificationUpdateRequest: + type: object + required: + - businessAddress + - businessContact + - messageVolume + - useCase + - useCaseSummary + - productionMessageContent + - optInWorkflow + properties: + businessAddress: + $ref: '#/components/schemas/address' + businessContact: + $ref: '#/components/schemas/contact' + messageVolume: + type: integer + description: Estimated monthly volume of messages from the toll-free number. + minimum: 10 + maximum: 10000000 + example: 10000 + useCase: + $ref: '#/components/schemas/useCase' + useCaseSummary: + $ref: '#/components/schemas/useCaseSummary' + productionMessageContent: + $ref: '#/components/schemas/productionMessageContent' + optInWorkflow: + $ref: '#/components/schemas/optInWorkflow' + additionalInformation: + $ref: '#/components/schemas/additionalInformation' + isvReseller: + $ref: '#/components/schemas/isvReseller' + privacyPolicyUrl: + $ref: '#/components/schemas/privacyPolicyUrl' + termsAndConditionsUrl: + $ref: '#/components/schemas/termsAndConditionsUrl' + businessDba: + $ref: '#/components/schemas/businessDba' + businessRegistrationNumber: + $ref: '#/components/schemas/businessRegistrationNumber' + businessRegistrationType: + $ref: '#/components/schemas/businessRegistrationTypeEnum' + businessEntityType: + $ref: '#/components/schemas/businessEntityTypeEnum' + helpMessageResponse: + $ref: '#/components/schemas/helpMessageResponse' + ageGatedContent: + $ref: '#/components/schemas/ageGatedContent' + tfvBasicAuthentication: + type: object + properties: + username: + type: string + maxLength: 100 + example: username + password: + type: string + maxLength: 200 + example: password + required: + - username + - password + webhookSubscriptionRequestSchema: + type: object + properties: + basicAuthentication: + $ref: '#/components/schemas/tfvBasicAuthentication' + callbackUrl: + $ref: '#/components/schemas/webhookUrl' + sharedSecretKey: + $ref: '#/components/schemas/sharedSecretKey' + required: + - callbackUrl + failureWebhook: + type: object + properties: + accountId: + $ref: '#/components/schemas/accountId1' + phoneNumber: + $ref: '#/components/schemas/tfPhoneNumber' + errorCode: + type: string + description: >- + An error code indicating what error was encountered. This code can + be interpreted as an HTTP status code in regards to the error that + was encountered. + example: '400' + errorMessage: + type: string + description: A description of the error that was encountered. + example: cannot process request. + errors: + $ref: '#/components/schemas/tfvWebhookErrors' + internalTicketNumber: + $ref: '#/components/schemas/internalTicketNumberForWebhook' + verificationDenialWebhook: + type: object + properties: + accountId: + $ref: '#/components/schemas/accountId1' + additionalDenialReasons: + description: >- + An optional list of denial reasons in addition to + declineReasonDescription when multiple reasons apply. + items: + $ref: '#/components/schemas/additionalDenialReason' + example: + - statusCode: 512 + reason: Reason A + resubmitAllowed: true + - statusCode: 513 + reason: Reason B + resubmitAllowed: true + type: array + declineReasonDescription: + $ref: '#/components/schemas/declineReasonDescription' + denialStatusCode: + $ref: '#/components/schemas/denialStatusCode' + internalTicketNumber: + $ref: '#/components/schemas/internalTicketNumberForWebhook' + phoneNumber: + $ref: '#/components/schemas/tfPhoneNumber' + resubmitAllowed: + $ref: '#/components/schemas/resubmitAllowed' + status: + $ref: '#/components/schemas/tfvUnverifiedStatus' + blocked: + $ref: '#/components/schemas/blocked' + blockedReason: + $ref: '#/components/schemas/blockedReason' + verificationWebhook: + type: object + properties: + accountId: + $ref: '#/components/schemas/accountId1' + phoneNumber: + $ref: '#/components/schemas/tfPhoneNumber' + status: + $ref: '#/components/schemas/tfvCallbackStatusEnum' + internalTicketNumber: + $ref: '#/components/schemas/internalTicketNumberForWebhook' + blockedWebhook: + type: object + properties: + accountId: + $ref: '#/components/schemas/accountId1' + phoneNumber: + $ref: '#/components/schemas/tfPhoneNumber' + status: + $ref: '#/components/schemas/tfvCallbackStatusEnum' + internalTicketNumber: + $ref: '#/components/schemas/internalTicketNumberForWebhook' + blocked: + $ref: '#/components/schemas/blocked' + blockedReason: + $ref: '#/components/schemas/blockedReason' + tfvSubmissionWrapper: + type: object + properties: + submission: + $ref: '#/components/schemas/verificationUpdateRequest' + address: + type: object + nullable: false + required: + - name + - addr1 + - city + - state + - zip + - url + properties: + name: + type: string + description: The name of the business using the toll-free number. + minLength: 1 + maxLength: 500 + nullable: false + example: Bandwidth Inc. + addr1: + type: string + description: The address of the business using the toll-free number. + minLength: 1 + maxLength: 500 + nullable: false + example: 2230 Bandmate Way + addr2: + type: string + description: The address of the business using the toll-free number. + minLength: 0 + maxLength: 500 + nullable: true + example: 2230 Bandmate Way + city: + type: string + description: The city of the business using the toll-free number. + minLength: 1 + maxLength: 500 + nullable: false + example: Raleigh + state: + type: string + description: The state of the business using the toll-free number. + minLength: 1 + maxLength: 500 + nullable: false + example: NC + zip: + type: string + description: The zip of the business using the toll-free number. + nullable: false + example: '27606' + pattern: '[- A-Za-z0-9]{0,500}' + url: + type: string + format: url + description: The website of the business using the toll-free number. + minLength: 1 + maxLength: 500 + nullable: false + example: https://www.example.com/path/to/resource + additionalInformation: + type: string + description: Any additional information. + minLength: 0 + maxLength: 500 + nullable: true + example: Any additional information + optInWorkflow: + type: object + nullable: false + required: + - description + - imageUrls + properties: + description: + type: string + minLength: 1 + maxLength: 500 + nullable: false + example: Opt In Flow + imageUrls: + type: array + items: + type: string + minLength: 1 + maxLength: 500 + nullable: false + example: https://www.example.com/path/to/resource + pattern: >- + ^$|(https?:\/\/)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,253}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#()?&//=]*) + confirmationResponse: + type: string + minLength: 0 + maxLength: 500 + nullable: true + example: Thank you for opting in! + isvReseller: + type: string + description: ISV name. + minLength: 0 + maxLength: 500 + nullable: true + example: Test ISV + contact: + type: object + nullable: false + required: + - firstName + - lastName + - email + - phoneNumber + properties: + firstName: + type: string + description: The first name of the business contact using the toll-free number. + minLength: 1 + maxLength: 500 + nullable: false + example: John + lastName: + type: string + description: The last name of the business contact using the toll-free number. + minLength: 1 + maxLength: 500 + nullable: false + example: Doe + email: + $ref: '#/components/schemas/email' + phoneNumber: + $ref: '#/components/schemas/businessContactPhoneNumber' + email: + type: string + format: email + minLength: 0 + maxLength: 500 + nullable: false + pattern: >- + ^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\.){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$ + example: foo@bar.com + useCases: + type: array + items: + type: string + example: + - 2FA + - App Notifications + - Appointments + - Auctions + - Auto Repair Services + - Bank Transfers + - Billing + - Booking Confirmations + - Business Updates + - COVID-19 Alerts + useCase: + type: string + description: The category of the use case. + minLength: 0 + maxLength: 500 + example: 2FA + useCaseSummary: + type: string + description: A general idea of the use case and customer. + minLength: 0 + maxLength: 500 + nullable: false + example: Text summarizing the use case for the toll-free number + productionMessageContent: + type: string + description: Example of message content. + minLength: 0 + maxLength: 500 + nullable: false + example: Production message content + webhookSubscriptionsListBody: + description: >- + A list of all webhook subscriptions registered for this account ID for + this particular feature (unpaginated). + type: object + required: + - data + properties: + links: + $ref: '#/components/schemas/linksObject' + errors: + type: array + items: + $ref: '#/components/schemas/error' + data: + items: + $ref: '#/components/schemas/webhookSubscription' + type: array + linksObject: + type: object + properties: + first: + description: The first (or only) page of results matching the query. + type: string + next: + description: >- + If more results exist than specified by 'size', this link returns + the next page of 'size' results. + type: string + previous: + description: >- + If the results are more than one page, this link returns the + previous page of 'size' results. + type: string + last: + description: >- + If more results exist than specified by 'size', this link return the + last page of result. + type: string + error: + type: object + properties: + code: + type: integer + description: + type: string + telephoneNumbers: + type: array + items: + $ref: '#/components/schemas/telephoneNumber' + telephoneNumber: + type: object + properties: + telephoneNumber: + description: Simple Telephone Number. + type: string + webhookSubscriptionTypeEnum: + type: string + enum: + - TOLLFREE_VERIFICATION_STATUS + - MESSAGING_PORTOUT_APPROVAL_STATUS + example: TOLLFREE_VERIFICATION_STATUS + webhookSubscription: + description: >- + Information about a webhook that Bandwidth should send upon the + completion of event customer has subscribed to. + type: object + required: + - callbackUrl + properties: + id: + type: string + example: 7hICGStfAfeGxEq3N0lQwO + accountId: + type: string + example: '1234567' + callbackUrl: + $ref: '#/components/schemas/webhookUrl' + type: + $ref: '#/components/schemas/webhookSubscriptionTypeEnum' + basicAuthentication: + description: >- + Basic authentication credentials are not required, but if present, + both username and password must be provided. + type: object + required: + - username + - password + properties: + username: + type: string + maxLength: 100 + password: + type: string + maxLength: 200 + createdDate: + type: string + format: date-time + example: '2023-05-15T13:56:39.965Z' + modifiedDate: + type: string + format: date-time + example: '2023-05-15T13:56:39.965Z' + webhookUrl: + description: >- + Callback URL to receive status updates from Bandwidth. When a webhook + subscription is registered with Bandwidth under a given account ID, it + will be used to send status updates for all requests submitted under + that account ID. + type: string + format: url + minLength: 0 + maxLength: 2000 + nullable: true + example: https://www.example.com/path/to/resource + pattern: >- + ^$|(https?:\/\/)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,253}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#()?&//=]*) + tfvError: + description: A generic error object. + properties: + type: + type: string + example: Error Type + description: + type: string + example: Error Message + errors: + type: object + description: >- + Each key of this errors object refers to a field of the submitted + object (using dot notation for nested objects), with the field being + a key to an array of one or more errors for that field. + example: + field: error message + type: object + tfvStatus: + type: object + properties: + phoneNumber: + $ref: '#/components/schemas/tfPhoneNumber' + status: + $ref: '#/components/schemas/tfvStatusEnum' + internalTicketNumber: + $ref: '#/components/schemas/internalTicketNumber' + declineReasonDescription: + $ref: '#/components/schemas/declineReasonDescription' + resubmitAllowed: + $ref: '#/components/schemas/resubmitAllowed' + createdDateTime: + type: string + description: Date and time the verification request was created. + format: date-time + example: '2021-06-08T06:45:13.0Z' + modifiedDateTime: + type: string + description: Date and time the verification request was last modified. + format: date-time + example: '2021-06-08T06:45:13.0Z' + submission: + $ref: '#/components/schemas/tfvSubmissionInfo' + blocked: + $ref: '#/components/schemas/blocked' + blockedReason: + $ref: '#/components/schemas/blockedReason' + tfvSubmissionInfo: + type: object + properties: + businessAddress: + $ref: '#/components/schemas/address' + businessContact: + $ref: '#/components/schemas/contact' + messageVolume: + type: integer + description: Estimated monthly volume of messages from the toll-free number. + minimum: 10 + maximum: 10000000 + example: 10000 + useCase: + $ref: '#/components/schemas/useCase' + useCaseSummary: + $ref: '#/components/schemas/useCaseSummary' + productionMessageContent: + $ref: '#/components/schemas/productionMessageContent' + optInWorkflow: + $ref: '#/components/schemas/optInWorkflow' + additionalInformation: + $ref: '#/components/schemas/additionalInformation' + isvReseller: + $ref: '#/components/schemas/isvReseller' + privacyPolicyUrl: + $ref: '#/components/schemas/privacyPolicyUrl' + termsAndConditionsUrl: + $ref: '#/components/schemas/termsAndConditionsUrl' + businessDba: + $ref: '#/components/schemas/businessDba' + businessRegistrationNumber: + $ref: '#/components/schemas/businessRegistrationNumber' + description: >- + US Federal Tax ID Number (EIN) or Canada Business Number (CBN). + Available starting October 1st, 2025. + businessRegistrationType: + $ref: '#/components/schemas/businessRegistrationTypeEnum' + description: >- + The type of business registration number. Available starting October + 1st, 2025. + businessEntityType: + $ref: '#/components/schemas/businessEntityTypeEnum' + description: >- + The type of registered business. If no option is applicable, please + provide "SOLE_PROPRIETOR" as a value. Available starting October + 1st, 2025. + tfvStatusEnum: + type: string + enum: + - VERIFIED + - UNVERIFIED + - PENDING + example: VERIFIED + sharedSecretKey: + description: >- + An ASCII string submitted by the user as a shared secret key for + generating an HMAC header for callbacks. + example: This is my $3cret + maxLength: 64 + minLength: 16 + nullable: true + pattern: ^[ -~]{16,64}$ + type: string + endpointId: + type: string + description: The unique ID of the endpoint. + example: e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + endpointStatusEnum: + type: string + enum: + - CONNECTED + - DISCONNECTED + deviceStatusEnum: + type: string + enum: + - CONNECTED + - DISCONNECTED + endpointTypeEnum: + type: string + enum: + - WEBRTC + endpointDirectionEnum: + type: string + enum: + - INBOUND + - OUTBOUND + - BIDIRECTIONAL + sipCredentials: + type: object + properties: + username: + type: string + description: The username for the SIP connection. + example: username + password: + type: string + description: The password for the SIP connection. + example: password + sipConnectionMetadata: + title: SIP Connection + type: object + properties: + ipAddress: + type: string + format: ipv4 + description: The IP address of the SIP connection. + example: 192.168.0.0 + port: + type: integer + description: The port of the SIP connection. + example: 5060 + credentials: + $ref: '#/components/schemas/sipCredentials' + uuiHeader: + type: string + description: The User-to-User Information header for the SIP connection. + example: my-uui-header + webRtcConnectionMetadata: + title: WebRTC Connection + type: object + endpointToken: + type: string + description: >- + The json web token specific to the endpoint. Used to authenticate the + client with the media gateway. + example: xxxxx.yyyyy.zzzzz + endpointTag: + type: string + description: A tag for the endpoint. + example: my-tag + maximum: 1024 + device: + type: object + properties: + deviceId: + type: string + description: The unique ID of the device. + example: d-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + deviceName: + type: string + description: The name of the device. + maximum: 1024 + example: David's iPhone + status: + $ref: '#/components/schemas/deviceStatusEnum' + creationTimestamp: + type: string + format: date-time + description: The time the device was created. In ISO-8601 format. + example: '2021-01-01T00:00:00Z' + required: + - deviceId + - status + - creationTimestamp + endpoints: + type: object + properties: + endpointId: + $ref: '#/components/schemas/endpointId' + type: + $ref: '#/components/schemas/endpointTypeEnum' + status: + $ref: '#/components/schemas/endpointStatusEnum' + creationTimestamp: + type: string + format: date-time + description: The time the endpoint was created. In ISO-8601 format. + example: '2021-01-01T00:00:00Z' + expirationTimestamp: + type: string + format: date-time + description: >- + The time the endpoint token will expire. In ISO-8601 format. Tokens + last 24 hours. + example: '2021-01-02T00:00:00Z' + tag: + $ref: '#/components/schemas/endpointTag' + required: + - endpointId + - type + - status + - creationTimestamp + - expirationTimestamp + endpoint: + type: object + allOf: + - $ref: '#/components/schemas/endpoints' + - type: object + properties: + devices: + type: array + items: + $ref: '#/components/schemas/device' + createWebRtcConnectionRequest: + allOf: + - $ref: '#/components/schemas/createEndpointRequestBase' + - type: object + properties: + connectionMetadata: + $ref: '#/components/schemas/webRtcConnectionMetadata' + createEndpointRequestBase: + type: object + properties: + type: + $ref: '#/components/schemas/endpointTypeEnum' + direction: + $ref: '#/components/schemas/endpointDirectionEnum' + eventCallbackUrl: + type: string + format: uri + description: The URL to send event callbacks to. + example: https://myapp.com/callback + eventFallbackUrl: + type: string + format: uri + description: The URL to send event fallbacks to. + example: https://fallback.myapp.com/callback + tag: + $ref: '#/components/schemas/endpointTag' + required: + - type + - direction + createEndpointRequest: + oneOf: + - $ref: '#/components/schemas/createWebRtcConnectionRequest' + discriminator: + propertyName: type + mapping: + WEBRTC: '#/components/schemas/createWebRtcConnectionRequest' + createEndpointResponseObject: + allOf: + - $ref: '#/components/schemas/endpoint' + - type: object + properties: + token: + $ref: '#/components/schemas/endpointToken' + required: + - token + endpointEventTypeEnum: + type: string + enum: + - DEVICE_CONNECTED + - DEVICE_DISCONNECTED + endpointEvent: + description: An event that occurred on an endpoint. + allOf: + - $ref: '#/components/schemas/endpoints' + - type: object + properties: + eventTime: + type: string + format: date-time + description: The time the event occurred. In ISO-8601 format. + example: '2021-01-01T00:00:00Z' + eventType: + $ref: '#/components/schemas/endpointEventTypeEnum' + device: + $ref: '#/components/schemas/device' + required: + - eventType + - eventTime + link1: + type: object + properties: + href: + type: string + description: The full URL of the link. + example: >- + https://api.bandwidth.com/v2/accounts/5500123/endpoints/e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + rel: + type: string + description: The relationship of the link to the current resource. + example: self + method: + type: string + enum: + - GET + - POST + - DELETE + description: The HTTP method to use when making the request. + example: GET + page: + type: object + properties: + pageSize: + type: integer + description: The number of items per page. + minimum: 0 + example: 10 + totalElements: + type: integer + description: The total number of items. + minimum: 0 + example: 100 + totalPages: + type: integer + description: The total number of pages. + minimum: 0 + example: 10 + pageNumber: + type: integer + description: The current page number. + minimum: 0 + example: 0 + required: + - pageSize + error1: + type: object + properties: + id: + type: string + format: uuid + description: A unique identifier for the error. + example: 59512d87-7a92-4040-8e4a-78fb772019b9 + type: + type: string + description: The type of error. + example: resource.not_found + description: + type: string + description: A description of the error. + example: The requested resource was not found. + code: + type: string + description: A code that uniquely identifies the error. + example: '404' + source: + type: object + properties: + parameter: + type: string + description: The URI parameter that caused the error. + example: accountId + field: + type: string + description: The request body field that caused the error. + example: accountId + header: + type: string + description: The header that caused the error. + example: Authorization + reference: + type: string + description: >- + The resource ID or path to the resource (or non-existent + resource) causing the error. + example: e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + required: + - id + - type + - description + - code + listEndpointsResponse: + type: object + properties: + links: + type: array + items: + $ref: '#/components/schemas/link1' + page: + $ref: '#/components/schemas/page' + data: + type: array + items: + $ref: '#/components/schemas/endpoints' + errors: + type: array + items: + $ref: '#/components/schemas/error1' + required: + - links + - data + - errors + endpointResponse: + type: object + properties: + links: + type: array + items: + $ref: '#/components/schemas/link1' + data: + $ref: '#/components/schemas/endpoint' + errors: + type: array + items: + $ref: '#/components/schemas/error1' + required: + - links + - data + - errors + createEndpointResponse: + type: object + properties: + links: + type: array + items: + $ref: '#/components/schemas/link1' + data: + $ref: '#/components/schemas/createEndpointResponseObject' + errors: + type: array + items: + $ref: '#/components/schemas/error1' + required: + - links + - data + - errors + errorResponse: + type: object + properties: + links: + type: array + items: + $ref: '#/components/schemas/link1' + data: + type: object + nullable: true + additionalProperties: false + errors: + type: array + items: + $ref: '#/components/schemas/error1' + required: + - links + - data + - errors + responses: + createMessageResponse: + description: Accepted + content: + application/json: + schema: + $ref: '#/components/schemas/message' + createMultiChannelMessageResponse: + description: Accepted + content: + application/json: + schema: + $ref: '#/components/schemas/createMultiChannelMessageResponse' + listMessagesResponse: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/messagesList' + getMediaResponse: + description: OK + content: + application/octet-stream: + schema: + type: string + description: Successful Operation + format: binary + listMediaResponse: + description: OK + headers: + Continuation-Token: + description: Continuation token used to retrieve subsequent media. + schema: + type: string + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/media' + messagingBadRequestError: + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/messagingRequestError' + messagingNotAcceptableError: + description: Not Acceptable + content: + application/json: + schema: + $ref: '#/components/schemas/messagingRequestError' + createMessageBadRequestError: + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/createMessageRequestError' + messagingUnauthorizedError: + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/messagingRequestError' + messagingForbiddenError: + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/messagingRequestError' + messagingNotFoundError: + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/messagingRequestError' + messagingMethodNotAllowedError: + description: Method Not Allowed + content: + application/json: + schema: + $ref: '#/components/schemas/messagingRequestError' + messagingInvalidMediaTypeError: + description: Unsupported Media Type + content: + application/json: + schema: + $ref: '#/components/schemas/messagingRequestError' + messagingTooManyRequestsError: + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/messagingRequestError' + messagingInternalServerError: + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/messagingRequestError' + multiChannelBadRequestError: + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/multiChannelError' + example: + links: [] + data: null + errors: + - type: request-validation + description: >- + The 'channelList[0].from' field must contain exactly one + telephone number + source: + field: channelList[0].from + multiChannelNotAcceptableError: + description: Not Acceptable + multiChannelUnauthorizedError: + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/multiChannelError' + example: + links: [] + data: null + errors: + - type: unauthorized + description: Authentication Failed + source: {} + multiChannelForbiddenError: + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/multiChannelError' + example: + links: [] + data: null + errors: + - type: forbidden + description: Access Denied + source: {} + multiChannelNotFoundError: + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/multiChannelError' + example: + links: [] + data: null + errors: + - type: forbidden + description: Resource not found. + source: {} + multiChannelMethodNotAllowedError: + description: Method Not Allowed + content: + application/json: + schema: + $ref: '#/components/schemas/multiChannelError' + example: + links: [] + data: null + errors: + - type: method-not-allowed + description: Method 'PUT' not supported for this resource. + source: {} + multiChannelInvalidMediaTypeError: + description: Unsupported Media Type + content: + application/json: + schema: + $ref: '#/components/schemas/multiChannelError' + example: + links: [] + data: null + errors: + - type: unsupported-content-type + description: >- + Content-Type 'application/xml;charset=UTF-8' is not supported. + Please use 'application/json' + source: + header: Content-Type + multiChannelTooManyRequestsError: + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/multiChannelError' + example: + links: [] + data: null + errors: + - type: rate-limit-exceeded + description: >- + You have exceeded your rate limit for this endpoint. Please + retry later. + source: {} + multiChannelInternalServerError: + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/multiChannelError' + example: + links: [] + data: null + errors: + - type: internal-server-error + description: Internal server error. No further information available + source: {} + createCallResponse: + description: Created + headers: + Location: + description: The URL for further interactions with this call + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/createCallResponse' + examples: + createCall Response: + $ref: '#/components/examples/createCallResponseExample' + getCallStateResponse: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/callState' + updateCallResponse: + description: OK + listCallsResponse: + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/callState' + getStatisticsResponse: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/accountStatistics' + updateRecordingResponse: + description: OK + listCallRecordingsResponse: + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/callRecordingMetadata' + getCallRecordingResponse: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/callRecordingMetadata' + downloadRecordingMediaResponse: + description: OK + content: + audio/vnd.wave: + schema: + type: string + format: binary + audio/mpeg: + schema: + type: string + format: binary + getRecordingTranscriptionResponse: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/recordingTranscriptions' + listTranscriptionsResponse: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/callTranscriptionMetadataList' + getCallTranscriptionResponse: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/callTranscriptionResponse' + deleteCallTranscriptionResponse: + description: No Content + listConferencesResponse: + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/conference' + examples: + listConferences Response: + $ref: '#/components/examples/listConferencesResponseExample' + getConferenceResponse: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/conference' + getConferenceMemberResponse: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/conferenceMember' + listConferenceRecordingsResponse: + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/conferenceRecordingMetadata' + getConferenceRecordingResponse: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/conferenceRecordingMetadata' + voiceBadRequestError: + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/voiceApiError' + examples: + badRequestErrorExample: + $ref: '#/components/examples/voiceBadRequestErrorExample' + voiceUnauthorizedError: + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/voiceApiError' + examples: + unauthorizedErrorExample: + $ref: '#/components/examples/voiceUnauthorizedErrorExample' + voiceForbiddenError: + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/voiceApiError' + examples: + forbiddenErrorExample: + $ref: '#/components/examples/voiceForbiddenErrorExample' + voiceNotFoundError: + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/voiceApiError' + examples: + notFoundErrorExample: + $ref: '#/components/examples/voiceNotFoundErrorExample' + voiceNotAllowedError: + description: Method Not Allowed + content: + application/json: + schema: + $ref: '#/components/schemas/voiceApiError' + examples: + notAllowedErrorExample: + $ref: '#/components/examples/voiceNotAllowedErrorExample' + voiceConflictError: + description: Conflict + content: + application/json: + schema: + $ref: '#/components/schemas/voiceApiError' + examples: + conflictErrorExample: + $ref: '#/components/examples/voiceConflictErrorExample' + voiceUnsupportedMediaTypeError: + description: Unsupported Media Type + content: + application/json: + schema: + $ref: '#/components/schemas/voiceApiError' + examples: + tooManyRequestsErrorExample: + $ref: '#/components/examples/voiceUnsupportedMediaTypeErrorExample' + voiceTooManyRequestsError: + description: Too Many Requests + headers: + Retry-After: + description: When you should try your request again. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/voiceApiError' + examples: + tooManyRequestsErrorExample: + $ref: '#/components/examples/voiceTooManyRequestsErrorExample' + voiceInternalServerError: + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/voiceApiError' + examples: + internalServerErrorExample: + $ref: '#/components/examples/voiceInternalServerErrorExample' + voiceCodeResponse: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/voiceCodeResponse' + messagingCodeResponse: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/messagingCodeResponse' + verifyCodeResponse: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/verifyCodeResponse' + mfaBadRequestError: + description: Bad Request + headers: {} + content: + application/json: + schema: + $ref: '#/components/schemas/mfaRequestError' + mfaUnauthorizedError: + description: Unauthorized + headers: {} + content: + application/json: + schema: + $ref: '#/components/schemas/mfaUnauthorizedRequestError' + mfaForbiddenError: + description: Forbidden + headers: {} + content: + application/json: + schema: + $ref: '#/components/schemas/mfaForbiddenRequestError' + mfaTooManyRequestsError: + description: Too Many Requests + headers: {} + content: + application/json: + schema: + $ref: '#/components/schemas/mfaRequestError' + mfaInternalServerError: + description: Internal Server Error + headers: {} + content: + application/json: + schema: + $ref: '#/components/schemas/mfaRequestError' + createSyncLookupResponse: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/createSyncLookupResponse' + examples: + lookupCompleteWithDniExample: + $ref: '#/components/examples/lookupCompleteWithDniExample' + lookupCompleteExample: + $ref: '#/components/examples/lookupCompleteExample' + lookupPartialExample: + $ref: '#/components/examples/lookupPartialExample' + lookupFailedExample: + $ref: '#/components/examples/lookupFailedExample' + createAsyncBulkLookupResponse: + description: Accepted + content: + application/json: + schema: + $ref: '#/components/schemas/createAsyncBulkLookupResponse' + examples: + lookupInProgressExample: + $ref: '#/components/examples/lookupInProgressExample' + getAsyncBulkLookupResponse: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/getAsyncBulkLookupResponse' + examples: + lookupCompleteWithDniExample: + $ref: '#/components/examples/lookupCompleteWithDniExample' + lookupCompleteExample: + $ref: '#/components/examples/lookupCompleteExample' + lookupInProgressExample: + $ref: '#/components/examples/lookupInProgressExample' + lookupPartialExample: + $ref: '#/components/examples/lookupPartialExample' + lookupFailedExample: + $ref: '#/components/examples/lookupFailedExample' + tnLookupDefaultResponse: + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/lookupErrorResponse' + examples: + badRequest: + $ref: '#/components/examples/badRequestExample' + unauthorized: + $ref: '#/components/examples/unauthorizedExample' + forbidden: + $ref: '#/components/examples/forbiddenExample' + mediaType: + $ref: '#/components/examples/unsupportedMediaTypeExample' + notFound: + $ref: '#/components/examples/notFoundExample' + tooManyRequests: + $ref: '#/components/examples/tooManyRequestsExample' + internalServer: + $ref: '#/components/examples/internalServerErrorExample' + getTollFreeVerificationStatusResponse: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/tfvStatus' + listWebhookSubscriptionsResponse: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/webhookSubscriptionsListBody' + createWebhookSubscriptionResponse: + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/webhookSubscription' + updateWebhookSubscriptionResponse: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/webhookSubscription' + listTollFreeUseCasesResponse: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/useCases' + tfvBadRequestResponse: + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/tfvError' + example: + description: Cannot process request. + type: bad request + noContentResponse: + description: No Content + tfvPostBadRequestResponse: + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/tfvError' + example: + description: cannot process request. + errors: + businessName: Business name is required. + businessContactEmail: Business contact email is not a valid email address. + optInWorkflowImageURLs: Entries must be a valid array of objects. + tfvUnauthorizedResponse: + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/tfvError' + example: + description: Client is providing incorrect or invalid credentials. + type: unauthorized + tfvForbiddenResponse: + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/tfvError' + example: + description: Client is not authorized for the action. + type: forbidden + tfvNotFoundResponse: + description: Cannot find the requested resource. + content: + application/json: + schema: + $ref: '#/components/schemas/tfvError' + example: + description: Cannot find the requested resource. + type: Not Found + tfvNotAllowedResponse: + description: Method Not Allowed + content: + application/json: + schema: + $ref: '#/components/schemas/tfvError' + example: + description: Method is not allowed. + type: Method Not Allowed + tfvTooManyRequestsResponse: + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/tfvError' + example: + description: Throttling error. Too many requests. + type: Too Many Requests + tfvServerErrorResponse: + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/tfvError' + example: + description: Internal Server Error. + type: Internal Server Error + tfvServiceUnavailableResponse: + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/tfvError' + example: + description: Service Unavailable Error. + type: Service Unavailable + listEndpointsResponse: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/listEndpointsResponse' + examples: + listEndpointsResponseExample: + $ref: '#/components/examples/listEndpointsResponseExample' + createEndpointResponse: + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/createEndpointResponse' + examples: + createEndpointResponseExample: + $ref: '#/components/examples/createEndpointResponseExample' + getEndpointResponse: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/endpointResponse' + examples: + getEndpointResponseExample: + $ref: '#/components/examples/getEndpointResponseExample' + badRequestErrorResponse: + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/errorResponse' + examples: + badRequestErrorExample: + $ref: '#/components/examples/badRequestErrorExample' + unauthorizedErrorResponse: + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/errorResponse' + examples: + unauthorizedErrorExample: + $ref: '#/components/examples/unauthorizedErrorExample' + forbiddenErrorResponse: + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/errorResponse' + examples: + forbiddenErrorExample: + $ref: '#/components/examples/forbiddenErrorExample' + notFoundErrorResponse: + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/errorResponse' + examples: + notFoundErrorExample: + $ref: '#/components/examples/notFoundErrorExample' + methodNotAllowedErrorResponse: + description: Method Not Allowed + content: + application/json: + schema: + $ref: '#/components/schemas/errorResponse' + examples: + methodNotAllowedErrorExample: + $ref: '#/components/examples/methodNotAllowedErrorExample' + unsupportedMediaTypeErrorResponse: + description: Unsupported Media Type + content: + application/json: + schema: + $ref: '#/components/schemas/errorResponse' + examples: + unsuppotedMediaTypeErrorExample: + $ref: '#/components/examples/unsupportedMediaTypeErrorExample' + tooManyRequestsErrorResponse: + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/errorResponse' + examples: + tooManyRequestsErrorExample: + $ref: '#/components/examples/tooManyRequestsErrorExample' + serviceUnavailableErrorResponse: + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/errorResponse' + examples: + serviceUnavailableErrorExample: + $ref: '#/components/examples/serviceUnavailableErrorExample' + parameters: + accountId: + in: path + name: accountId + required: true + schema: + type: string + description: Your Bandwidth Account ID. + example: '9900000' + mediaId: + in: path + name: mediaId + required: true + description: Media ID to retrieve. + example: 14762070468292kw2fuqty55yp2b2/0/bw.png + schema: + type: string + contentType: + in: header + name: Content-Type + style: simple + explode: false + description: The media type of the entity-body. + example: audio/wav + schema: + type: string + cacheControl: + in: header + name: Cache-Control + style: simple + explode: false + description: >- + General-header field is used to specify directives that MUST be obeyed + by all caching mechanisms along the request/response chain. + example: no-cache + schema: + type: string + continuationToken: + in: header + name: Continuation-Token + description: Continuation token used to retrieve subsequent media. + example: >- + 1XEi2tsFtLo1JbtLwETnM1ZJ+PqAa8w6ENvC5QKvwyrCDYII663Gy5M4s40owR1tjkuWUif6qbWvFtQJR5/ipqbUnfAqL254LKNlPy6tATCzioKSuHuOqgzloDkSwRtX0LtcL2otHS69hK343m+SjdL+vlj71tT39 + schema: + type: string + messageId: + in: query + name: messageId + required: false + description: >- + The ID of the message to search for. Special characters need to be + encoded using URL encoding. Message IDs could come in different formats, + e.g., 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 and + 1589228074636lm4k2je7j7jklbn2 are valid message ID formats. Note that + you must include at least one query parameter. + example: 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 + schema: + type: string + sourceTn: + in: query + name: sourceTn + required: false + description: >- + The phone number that sent the message. Accepted values are: a single + full phone number a comma separated list of full phone numbers (maximum + of 10) or a single partial phone number (minimum of 5 characters e.g. + '%2B1919'). + example: '%2B15554443333' + schema: + type: string + destinationTn: + in: query + name: destinationTn + required: false + description: >- + The phone number that received the message. Accepted values are: a + single full phone number a comma separated list of full phone numbers + (maximum of 10) or a single partial phone number (minimum of 5 + characters e.g. '%2B1919'). + example: '%2B15554443333' + schema: + type: string + messageStatus: + in: query + name: messageStatus + required: false + description: >- + The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED + DELIVERED ACCEPTED UNDELIVERED. + schema: + $ref: '#/components/schemas/messageStatusEnum' + messageDirection: + in: query + name: messageDirection + required: false + description: The direction of the message. One of INBOUND OUTBOUND. + schema: + $ref: '#/components/schemas/listMessageDirectionEnum' + carrierName: + in: query + name: carrierName + required: false + description: >- + The name of the carrier used for this message. Possible values include + but are not limited to Verizon and TMobile. Special characters need to + be encoded using URL encoding (i.e. AT&T should be passed as AT%26T). + example: Verizon + schema: + type: string + messageType: + in: query + name: messageType + required: false + description: The type of message. Either sms or mms. + schema: + $ref: '#/components/schemas/messageTypeEnum' + errorCode: + in: query + name: errorCode + required: false + description: The error code of the message. + example: 9902 + schema: + type: integer + fromDateTime: + in: query + name: fromDateTime + required: false + description: >- + The start of the date range to search in ISO 8601 format. Uses the + message receive time. The date range to search in is currently 14 days. + example: 2022-09-14T18:20:16.000Z + schema: + type: string + toDateTime: + in: query + name: toDateTime + required: false + description: >- + The end of the date range to search in ISO 8601 format. Uses the message + receive time. The date range to search in is currently 14 days. + example: 2022-09-14T18:20:16.000Z + schema: + type: string + campaignId: + in: query + name: campaignId + required: false + description: The campaign ID of the message. + example: CJEUMDK + schema: + type: string + fromBwLatency: + in: query + name: fromBwLatency + required: false + description: >- + The minimum Bandwidth latency of the message in seconds. Only available + for accounts with the Advanced Quality Metrics feature enabled. + example: 5 + schema: + type: integer + bwQueued: + in: query + name: bwQueued + required: false + description: >- + A boolean value indicating whether the message is queued in the + Bandwidth network. + example: true + schema: + type: boolean + product: + in: query + name: product + required: false + description: Messaging product associated with the message. + example: P2P + schema: + $ref: '#/components/schemas/productTypeEnum' + location: + in: query + name: location + required: false + description: Location Id associated with the message. + example: 123ABC + schema: + type: string + carrierQueued: + in: query + name: carrierQueued + required: false + description: >- + A boolean value indicating whether the message is queued in the carrier + network. Only available for OUTBOUND messages from accounts with the + Advanced Quality Metrics feature enabled. + example: true + schema: + type: boolean + fromCarrierLatency: + in: query + name: fromCarrierLatency + required: false + description: >- + The minimum carrier latency of the message in seconds. Only available + for OUTBOUND messages from accounts with the Advanced Quality Metrics + feature enabled. + example: 50 + schema: + type: integer + callingNumberCountryA3: + in: query + name: callingNumberCountryA3 + required: false + description: Calling number country in A3 format. + example: USA + schema: + type: string + calledNumberCountryA3: + in: query + name: calledNumberCountryA3 + required: false + description: Called number country in A3 format. + example: USA + schema: + type: string + fromSegmentCount: + in: query + name: fromSegmentCount + required: false + description: Segment count (start range). + example: 1 + schema: + type: integer + toSegmentCount: + in: query + name: toSegmentCount + required: false + description: Segment count (end range). + example: 3 + schema: + type: integer + fromMessageSize: + in: query + name: fromMessageSize + required: false + description: Message size (start range). + example: 100 + schema: + type: integer + toMessageSize: + in: query + name: toMessageSize + required: false + description: Message size (end range). + example: 120 + schema: + type: integer + sort: + in: query + name: sort + required: false + description: >- + The field and direction to sort by combined with a colon. Direction is + either asc or desc. + example: sourceTn:desc + schema: + type: string + pageToken: + in: query + name: pageToken + required: false + description: A base64 encoded value used for pagination of results. + example: gdEewhcJLQRB5 + schema: + type: string + limit: + in: query + name: limit + required: false + description: >- + The maximum records requested in search result. Default 100. The sum of + limit and after cannot be more than 10000. + schema: + type: integer + example: 50 + limitTotalCount: + in: query + name: limitTotalCount + required: false + description: >- + When set to true, the response's totalCount field will have a maximum + value of 10,000. When set to false, or excluded, this will give an + accurate totalCount of all messages that match the provided filters. If + you are experiencing latency, try using this parameter to limit your + results. + example: true + schema: + type: boolean + callId: + name: callId + in: path + required: true + schema: + type: string + description: Programmable Voice API Call ID. + example: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + recordingId: + name: recordingId + in: path + required: true + schema: + type: string + description: Programmable Voice API Recording ID. + example: r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + conferenceId: + name: conferenceId + in: path + required: true + schema: + type: string + description: Programmable Voice API Conference ID. + example: conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9 + memberId: + name: memberId + in: path + required: true + schema: + type: string + description: Programmable Voice API Conference Member ID. + example: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + transcriptionId: + name: transcriptionId + in: path + required: true + schema: + type: string + description: Programmable Voice API Transcription ID. + example: t-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + to: + name: to + in: query + required: false + schema: + type: string + description: Filter results by the `to` field. + example: '%2b19195551234' + from: + name: from + in: query + required: false + schema: + type: string + description: Filter results by the `from` field. + example: '%2b19195554321' + name: + name: name + in: query + required: false + schema: + type: string + description: Filter results by the `name` field. + example: my-custom-name + minCreatedTime: + name: minCreatedTime + in: query + required: false + schema: + type: string + description: >- + Filter results to conferences which have a `createdTime` after or at + `minCreatedTime` (in ISO8601 format). + example: '2022-06-21T19:13:21Z' + maxCreatedTime: + name: maxCreatedTime + in: query + required: false + schema: + type: string + description: >- + Filter results to conferences which have a `createdTime` before or at + `maxCreatedTime` (in ISO8601 format). + example: '2022-06-21T19:13:21Z' + minStartTime: + name: minStartTime + in: query + required: false + schema: + type: string + description: >- + Filter results to recordings which have a `startTime` after or including + `minStartTime` (in ISO8601 format). + example: '2022-06-21T19:13:21Z' + maxStartTime: + name: maxStartTime + in: query + required: false + schema: + type: string + description: >- + Filter results to recordings which have a `startTime` before + `maxStartTime` (in ISO8601 format). + example: '2022-06-21T19:13:21Z' + pageSize: + name: pageSize + in: query + required: false + schema: + type: integer + format: int32 + minimum: 1 + maximum: 1000 + default: 1000 + description: Specifies the max number of conferences that will be returned. + example: 500 + minStartTimeCalls: + name: minStartTime + in: query + required: false + schema: + type: string + description: >- + Filter results to calls which have a `startTime` after or including + `minStartTime` (in ISO8601 format). + example: '2022-06-21T19:13:21Z' + maxStartTimeCalls: + name: maxStartTime + in: query + required: false + schema: + type: string + description: >- + Filter results to calls which have a `startTime` before or including + `maxStartTime` (in ISO8601 format). + example: '2022-06-21T19:13:21Z' + pageSizeCalls: + name: pageSize + in: query + required: false + schema: + type: integer + format: int32 + minimum: 1 + maximum: 10000 + default: 1000 + description: Specifies the max number of calls that will be returned. + example: 500 + pageToken1: + name: pageToken + in: query + required: false + schema: + type: string + description: >- + Not intended for explicit use. To use pagination, follow the links in + the `Link` header of the response, as indicated in the endpoint + description. + example: eyJwYWdlVG9rZW4iOiJ0b2tlbiJ9 + disconnectCause: + name: disconnectCause + in: query + required: false + schema: + type: string + description: Filter results to calls with specified call Disconnect Cause. + example: hangup + accountId1: + in: path + name: accountId + required: true + schema: + type: string + description: Your Bandwidth Account ID. + example: '9900000' + requestId: + in: path + name: requestId + required: true + schema: + type: string + format: uuid + description: The phone number lookup request ID from Bandwidth. + example: 004223a0-8b17-41b1-bf81-20732adf5590 + tfPhoneNumberPathParam: + in: path + name: phoneNumber + required: true + schema: + $ref: '#/components/schemas/tfPhoneNumber' + description: Valid Toll-Free telephone number in E.164 format. + example: '+18885555555' + webhookSubscriptionIdPathParam: + in: path + name: id + required: true + schema: + type: string + description: Webhook subscription ID + example: 7bt57JcsVYJrN9K1OcV1Nu + accountId2: + name: accountId + in: path + required: true + schema: + type: string + example: '5500123' + description: Your Bandwidth Account ID. + endpointId: + name: endpointId + in: path + required: true + schema: + type: string + example: e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + description: BRTC Endpoint ID. + endpointType: + name: type + in: query + schema: + $ref: '#/components/schemas/endpointTypeEnum' + description: The type of endpoint. + endpointStatus: + name: status + in: query + schema: + $ref: '#/components/schemas/endpointStatusEnum' + description: The status of the endpoint. + afterCursor: + name: afterCursor + in: query + schema: + type: string + example: TWF5IHRoZSBmb3JjZSBiZSB3aXRoIHlvdQ== + description: >- + The cursor to use for pagination. This is the value of the `next` link + in the previous response. + limit1: + name: limit + in: query + schema: + type: integer + minimum: 1 + maximum: 1000 + default: 100 + example: 2 + description: The maximum number of endpoints to return in the response. + examples: + smsMessageReceivedCallbackExample: + summary: An example of a sms message-received callback body. + value: + time: '2025-01-06T15:43:35.502180Z' + type: message-received + to: '+12345678902' + description: Incoming message received + message: + id: 14762070468292kw2fuqty55yp2b2 + owner: '+12345678902' + applicationId: 93de2206-9669-4e07-948d-329f4b722ee2 + time: '2025-01-06T15:43:34.000000Z' + segmentCount: 1 + direction: in + to: + - '+12345678902' + from: '+12345678901' + text: Hey, check out this SMS! + mmsMessageReceivedCallbackExample: + summary: An example of a mms message-received callback body. + value: + time: '2024-09-14T18:20:45.160744Z' + type: message-received + to: '+12345678902' + description: Incoming message received + message: + id: 14762070468292kw2fuqty55yp2b2 + owner: '+12345678902' + applicationId: 93de2206-9669-4e07-948d-329f4b722ee2 + time: '2024-09-14T18:20:45.160744Z' + segmentCount: 1 + direction: in + to: + - '+12345678902' + - '+12345678903' + from: '+12345678901' + text: Hey, check out the MMS! + media: + - >- + https://messaging.bandwidth.com/api/v2/users/9900902/media/14762070468292kw2fuqty55yp2b2/0/bw.png + messageSendingCallbackExample: + summary: An example of a message-sending callback body. + value: + time: '2024-06-25T18:42:36.979456Z' + type: message-sending + to: '+15554443333' + description: Message is sending to carrier. + message: + id: 1593110555875xo7watq5px6rbe5d + owner: '+15552221111' + applicationId: cfd4fb83-7531-4acc-b471-42d0bb76a65c + time: '2024-06-25T18:42:35.876906Z' + segmentCount: 1 + direction: out + to: + - '+15554443333' + from: '+15552221111' + text: '' + media: + - https://dev.bandwidth.com/images/bandwidth-logo.png + tag: your tag here + smsMessageDeliveredCallbackExample: + summary: An example of a sms message-delivered callback body. + value: + type: message-delivered + time: '2024-09-14T18:20:11.160744Z' + description: Message delivered to carrier. + to: '+12345678902' + message: + id: 14762070468292kw2fuqty55yp2b2 + time: '2024-09-14T18:20:11.160744Z' + to: + - '+12345678902' + from: '+12345678901' + text: '' + applicationId: 93de2206-9669-4e07-948d-329f4b722ee2 + owner: '+12345678902' + direction: out + segmentCount: 1 + mmsMessageDeliveredCallbackExample: + summary: An example of a mms message-delivered callback body. + value: + type: message-delivered + time: '2024-09-14T18:20:24.160544Z' + description: Message delivered to carrier. + to: '+12345678902' + message: + id: 14762070468292kw2fuqty55yp2b2 + time: '2024-09-14T18:20:24.160544Z' + to: + - '+12345678902' + from: '+12345678901' + text: '' + applicationId: 93de2206-9669-4e07-948d-329f4b722ee2 + owner: '+12345678902' + direction: out + segmentCount: 1 + media: + - https://dev.bandwidth.com/images/bandwidth-logo.png + groupMmsMessageDeliveredCallbackExample: + summary: An example of a group mms message-delivered callback body. + value: + type: message-delivered + time: '2024-09-14T18:20:17.160544Z' + description: Message delivered to carrier. + to: '+12345678902' + message: + id: 14762070468292kw2fuqty55yp2b2 + time: '2024-09-14T18:20:17.160544Z' + to: + - '+12345678902' + - '+12345678903' + from: '+12345678901' + text: '' + applicationId: 93de2206-9669-4e07-948d-329f4b722ee2 + owner: '+12345678902' + direction: out + segmentCount: 1 + messageFailedCallbackExample: + summary: An example of a message-failed callback body. + value: + type: message-failed + time: '2024-12-18T16:51:27.704450Z' + description: forbidden to country + to: '+52345678903' + errorCode: 4432 + message: + id: 14762070468292kw2fuqty55yp2b2 + time: '2024-12-18T16:51:27.704450Z' + to: + - '+12345678902' + - '+52345678903' + from: '+12345678901' + text: '' + applicationId: 93de2206-9669-4e07-948d-329f4b722ee2 + media: + - https://dev.bandwidth.com/images/bandwidth-logo.png + owner: '+12345678901' + direction: out + segmentCount: 1 + createCallResponseExample: + summary: Example of a createCall Response + value: + applicationId: 04e88489-df02-4e34-a0ee-27a91849555f + accountId: '9900000' + callId: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + to: '+19195551234' + from: '+19195554312' + enqueuedTime: '2022-06-16T13:15:07.160Z' + callUrl: >- + https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + callTimeout: 30 + callbackTimeout: 15 + tag: My custom tag value + answerMethod: POST + answerUrl: https://myServer.example/bandwidth/webhooks/answer + answerFallbackMethod: POST + answerFallbackUrl: https://myServer.example/bandwidth/webhooks/answerFallback + disconnectMethod: POST + disconnectUrl: https://myServer.example/bandwidth/webhooks/disconnect + username: mySecretUsername + password: '*****' + fallbackUsername: mySecretUsername + fallbackPassword: '*****' + priority: 5 + listConferencesResponseExample: + summary: Example of a listConferences Response + value: + - id: conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9 + name: my-conference-name + createdTime: '2022-06-17T22:19:40.375Z' + completedTime: '2022-06-17T22:20:00.000Z' + conferenceEventUrl: https://myServer.example/bandwidth/webhooks/conferenceEvent + conferenceEventMethod: POST + tag: my custom tag + voiceBadRequestErrorExample: + summary: Example of a Bad Request (400) Error + value: + type: validation + description: 'Invalid answerUrl: only http and https are allowed.' + voiceUnauthorizedErrorExample: + summary: Example of an Unauthorized (401) Error + value: + type: validation + description: 'Invalid answerUrl: only http and https are allowed.' + voiceForbiddenErrorExample: + summary: Example of a Forbidden (403) Error + value: + type: validation + description: 'Invalid answerUrl: only http and https are allowed.' + voiceNotFoundErrorExample: + summary: Example of a Not Found (404) Error + value: + type: validation + description: 'Invalid answerUrl: only http and https are allowed.' + voiceNotAllowedErrorExample: + summary: Example of a Not Allowed (405) Error + value: + type: validation + description: 'Invalid answerUrl: only http and https are allowed.' + voiceConflictErrorExample: + summary: Example of a Conflict (409) Error + value: + type: validation + description: 'Invalid answerUrl: only http and https are allowed.' + voiceUnsupportedMediaTypeErrorExample: + summary: Example of an Unsupported Media Type (415) Error + value: + type: validation + description: 'Invalid answerUrl: only http and https are allowed.' + voiceTooManyRequestsErrorExample: + summary: Example of a Too Many Requests (429) Error + value: + type: validation + description: 'Invalid answerUrl: only http and https are allowed.' + voiceInternalServerErrorExample: + summary: Example of an Internal Server (500) Error + value: + type: validation + description: 'Invalid answerUrl: only http and https are allowed.' + singleNumberRequestExample: + summary: Number Lookup Request + value: + phoneNumbers: + - '+19196104423' + multipleNumberRequestExample: + summary: Number Lookup Request for Multiple Numbers + value: + phoneNumbers: + - '+19196104423' + - '+19196104424' + lookupInProgressExample: + summary: Numbers Lookup In Progress + value: + links: + - href: href + rel: rel + method: GET + data: + requestId: 004223a0-8b17-41b1-bf81-20732adf5590 + status: IN_PROGRESS + results: [] + errors: [] + lookupFailedExample: + summary: Numbers Lookup Failed + value: + links: + - href: href + rel: rel + method: GET + data: + requestId: 004223a0-8b17-41b1-bf81-20732adf5590 + status: FAILED + results: [] + errors: + - code: NO-MATCH + description: The following TNs could not be found in the Number Industry data + meta: + phoneNumbers: + - '+13992077164' + message: Invalid TNs + code: 1001 + type: NumberInventory + lookupPartialExample: + summary: Numbers Lookup Partial Complete + value: + links: + - href: href + rel: rel + method: GET + data: + requestId: 004223a0-8b17-41b1-bf81-20732adf5590 + status: PARTIAL_COMPLETE + results: + - phoneNumber: '+19196104423' + lineType: MOBILE + messagingProvider: Verizon Wireless + voiceProvider: Verizon Wireless + countryCodeA3: USA + - phoneNumber: '+19196104424' + lineType: MOBILE + messagingProvider: T-Mobile USA + voiceProvider: T-Mobile USA + countryCodeA3: USA + errors: + - code: NO-MATCH + description: The following TNs could not be found in the Number Industry data + meta: + phoneNumbers: + - '+13992077164' + message: Invalid TNs + code: 1001 + type: NumberInventory + lookupCompleteExample: + summary: Numbers Lookup Complete (without DNI) + value: + links: + - href: href + rel: rel + method: GET + data: + requestId: 004223a0-8b17-41b1-bf81-20732adf5590 + status: COMPLETE + results: + - phoneNumber: '+10072904497' + lineType: MOBILE + messagingProvider: Verizon Wireless + voiceProvider: Verizon Wireless + countryCodeA3: USA + - phoneNumber: '+10072904498' + lineType: MOBILE + messagingProvider: T-Mobile USA + voiceProvider: T-Mobile USA + countryCodeA3: USA + errors: [] + lookupCompleteWithDniExample: + summary: Numbers Lookup Complete (with DNI) + value: + links: + - href: href + rel: rel + method: GET + data: + requestId: 20732adf-bf81-8b17-41b1-004223a05590 + status: COMPLETE + results: + - phoneNumber: '+10072904497' + countryCodeA3: USA + lineType: MOBILE + messagingProvider: T-MOBILE USA INC + voiceProvider: T-MOBILE USA INC + latestMessageDeliveryStatus: ACTIVE + initialMessageDeliveryStatusDate: '2025-05-14' + latestMessageDeliveryStatusDate: '2025-05-18' + - phoneNumber: '+10072904498' + countryCodeA3: USA + lineType: FIXED + voiceProvider: VERIZON + latestMessageDeliveryStatus: DEACTIVATED + initialMessageDeliveryStatusDate: '2025-09-05' + latestMessageDeliveryStatusDate: '2025-09-05' + - phoneNumber: '+10072904499' + lineType: MOBILE + countryCodeA3: USA + messagingProvider: VERIZON + voiceProvider: VERIZON + deactivationReporter: Verizon Wireless + deactivationDate: '2025-09-29 01:23:00' + deactivationEvent: DEACTIVATED + latestMessageDeliveryStatus: UNKNOWN + errors: [] + badRequestExample: + summary: Example Bad Request Error + value: + links: [] + data: {} + errors: + - type: bad-request + description: >- + Bad Request. Ensure that you have set the requestId as a URL path + parameter. + unauthorizedExample: + summary: Unauthorized Error + value: + links: [] + data: {} + errors: + - type: Unauthorized + description: You are not authorized to access this resource. + code: '1' + page: null + forbiddenExample: + summary: Forbidden Error + value: + links: [] + data: {} + errors: + - type: Forbidden + description: You do not have permission to access this resource. + code: '2' + page: null + unsupportedMediaTypeExample: + summary: Unsupported Media Type Error + value: + links: [] + data: {} + errors: + - type: invalid-content-type + description: >- + Invalid content-type. Ensure that your content-type header is set + to application/json. + notFoundExample: + summary: Not Found Error + value: + links: [] + data: {} + errors: + - type: not-found + description: >- + RequestId not found. Ensure that the requestId used in the URL + path is valid and maps to a previous request that was submitted. + tooManyRequestsExample: + summary: Too Many Requests Error + value: + links: [] + data: {} + errors: + - type: rate-limiting + description: >- + Rate limit exceeded. Wait for the time specified in the + Retry-After header before sending another request. + internalServerErrorExample: + summary: Internal Server Error + value: + links: [] + data: {} + errors: + - code: '500' + type: unexpected-error + description: >- + Unexpected error. Please contact Bandwidth Support if your + requests are receiving this status code for an extended period of + time. + listEndpointsResponseExample: + summary: List Endpoints Paginated Response + value: + links: + - href: >- + https://api.bandwidth.com/v2/accounts/5500123/endpoints?type=SIP&status=CONNECTED&limit=2 + rel: self + method: GET + - href: >- + https://api.bandwidth.com/v2/accounts/5500123/endpoints?type=SIP&status=CONNECTED&limit=2&afterCursor=TWF5IHRoZSBmb3JjZSBiZSB3aXRoIHlvdQ== + rel: next + method: GET + page: + pageSize: 2 + totalElements: 10 + totalPages: 5 + pageNumber: 0 + data: + - endpointId: e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + type: WEBRTC + status: CONNECTED + creationTimestamp: '2021-01-01T00:00:00Z' + expirationTimestamp: '2021-01-02T00:00:00Z' + tag: my-tag + - endpointId: e-2cb0-4a07-b215-b22865662d85-15ac29a2-1331029c + type: WEBRTC + status: CONNECTED + creationTimestamp: '2021-01-01T00:00:00Z' + expirationTimestamp: '2021-01-02T00:00:00Z' + tag: my-tag + errors: [] + createEndpointResponseExample: + summary: Create Endpoint Response + value: + links: + - href: >- + https://api.bandwidth.com/v2/accounts/5500123/endpoints/e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + rel: endpoint + method: GET + data: + endpointId: e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + token: xxxxx.yyyyy.zzzzz + type: WEBRTC + status: CONNECTED + creationTimestamp: '2021-01-01T00:00:00Z' + expirationTimestamp: '2021-01-02T00:00:00Z' + devices: [] + tag: my-tag + errors: [] + getEndpointResponseExample: + summary: Get Endpoint Response + value: + links: + - href: >- + https://api.bandwidth.com/v2/accounts/5500123/endpoints/e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + rel: self + method: GET + data: + endpointId: e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + type: WEBRTC + status: CONNECTED + creationTimestamp: '2021-01-01T00:00:00Z' + expirationTimestamp: '2021-01-02T00:00:00Z' + devices: [] + tag: my-tag + errors: [] + createSipEndpointRequestExample: + summary: SIP Endpoint Example + value: + type: SIP + connectionMetadata: + ipAddress: 0.0.0.0 + port: 3000 + credentials: + username: username + password: '********' + uuiHeader: 123456;encoding=jwt + direction: INBOUND + eventCallbackUrl: https://myEventCallbackUrl.com/callbacks/bandwidth + eventFallbackUrl: https://fallback.myEventCallbackUrl.com/callbacks/bandwidth + tag: '{"myTag": "myTagValue"}' + createWeRtcEndpointExample: + summary: WebRTC Endpoint Example + value: + type: WEBRTC + direction: BIDIRECTIONAL + eventCallbackUrl: https://myEventCallbackUrl.com/callbacks/bandwidth + eventFallbackUrl: https://fallback.myEventCallbackUrl.com/callbacks/bandwidth + tag: '{"myTag": "myTagValue"}' + updateEndpointBxmlRequestExample: + summary: Update Endpoint BXML Request Example + value: + endpointDisconnectedEventExample: + summary: Endpoint Disconnected Event + value: + endpointId: e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + type: WEBRTC + status: DISCONNECTED + creationTimestamp: '2021-01-01T00:00:00Z' + expirationTimestamp: '2021-01-02T00:00:00Z' + eventTime: '2021-01-01T00:00:00Z' + eventType: DEVICE_DISCONNECTED + tag: my-tag + badRequestErrorExample: + summary: Bad Request Error Example + value: + links: [] + data: null + errors: + - id: 59512d87-7a92-4040-8e4a-78fb772019b9 + type: invalid_parameter + description: accountId must not contain any characters other than numbers. + code: '400' + source: + parameter: accountId + unauthorizedErrorExample: + summary: Unauthorized Error Example + value: + links: [] + data: null + errors: + - id: 59512d87-7a92-4040-8e4a-78fb772019b9 + type: unauthorized + description: >- + The provided credentials are not authorized to access this + resource. + code: '401' + source: + header: Authorization + forbiddenErrorExample: + summary: Forbidden Error Example + value: + links: [] + data: null + errors: + - id: 59512d87-7a92-4040-8e4a-78fb772019b9 + type: forbidden + description: >- + The provided credentials are not authorized to access this + resource. + code: '403' + source: + header: Authorization + notFoundErrorExample: + summary: Not Found Error Example + value: + links: [] + data: null + errors: + - id: 59512d87-7a92-4040-8e4a-78fb772019b9 + type: resource_not_found + description: The requested resource was not found. + code: '404' + source: + reference: e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + methodNotAllowedErrorExample: + summary: Method Not Allowed Error Example + value: + links: [] + data: null + errors: + - id: 59512d87-7a92-4040-8e4a-78fb772019b9 + type: method_not_allowed + description: The requested method is not allowed on this resource. + code: '405' + source: + parameter: accountId + unsupportedMediaTypeErrorExample: + summary: Unsupported Media Type Error Example + value: + links: [] + data: null + errors: + - id: 59512d87-7a92-4040-8e4a-78fb772019b9 + type: unsupported_media_type + description: The provided media type is not supported. + code: '415' + source: + header: Content-Type + tooManyRequestsErrorExample: + summary: Too Many Requests Error Example + value: + links: [] + data: null + errors: + - id: 59512d87-7a92-4040-8e4a-78fb772019b9 + type: too_many_requests + description: The client has sent too many requests in a given amount of time. + code: '429' + serviceUnavailableErrorExample: + summary: Service Unavailable Error Example + value: + links: [] + data: null + errors: + - id: 59512d87-7a92-4040-8e4a-78fb772019b9 + type: service_unavailable + description: The service is currently unavailable. + code: '500' + requestBodies: + createMessageRequest: + content: + application/json: + schema: + $ref: '#/components/schemas/messageRequest' + required: true + createMultiChannelMessageRequest: + content: + application/json: + schema: + $ref: '#/components/schemas/multiChannelMessageRequest' + required: true + uploadMediaRequest: + content: + application/json: + schema: + type: string + format: binary + application/ogg: + schema: + type: string + format: binary + application/pdf: + schema: + type: string + format: binary + application/rtf: + schema: + type: string + format: binary + application/zip: + schema: + type: string + format: binary + application/x-tar: + schema: + type: string + format: binary + application/xml: + schema: + type: string + format: binary + application/gzip: + schema: + type: string + format: binary + application/x-bzip2: + schema: + type: string + format: binary + application/x-gzip: + schema: + type: string + format: binary + application/smil: + schema: + type: string + format: binary + application/javascript: + schema: + type: string + format: binary + audio/mp4: + schema: + type: string + format: binary + audio/mpeg: + schema: + type: string + format: binary + audio/ogg: + schema: + type: string + format: binary + audio/flac: + schema: + type: string + format: binary + audio/webm: + schema: + type: string + format: binary + audio/wav: + schema: + type: string + format: binary + audio/amr: + schema: + type: string + format: binary + audio/3gpp: + schema: + type: string + format: binary + image/bmp: + schema: + type: string + format: binary + image/gif: + schema: + type: string + format: binary + image/heic: + schema: + type: string + format: binary + image/heif: + schema: + type: string + format: binary + image/jpeg: + schema: + type: string + format: binary + image/pjpeg: + schema: + type: string + format: binary + image/png: + schema: + type: string + format: binary + image/svg+xml: + schema: + type: string + format: binary + image/tiff: + schema: + type: string + format: binary + image/webp: + schema: + type: string + format: binary + image/x-icon: + schema: + type: string + format: binary + text/css: + schema: + type: string + format: binary + text/csv: + schema: + type: string + format: binary + text/calendar: + schema: + type: string + format: binary + text/html: + schema: + type: string + format: binary + text/plain: + schema: + type: string + format: binary + text/javascript: + schema: + type: string + format: binary + text/vcard: + schema: + type: string + format: binary + text/vnd.wap.wml: + schema: + type: string + format: binary + text/xml: + schema: + type: string + format: binary + video/avi: + schema: + type: string + format: binary + video/mp4: + schema: + type: string + format: binary + video/mpeg: + schema: + type: string + format: binary + video/ogg: + schema: + type: string + format: binary + video/quicktime: + schema: + type: string + format: binary + video/webm: + schema: + type: string + format: binary + video/x-ms-wmv: + schema: + type: string + format: binary + video/x-flv: + schema: + type: string + format: binary + required: true + createCallRequest: + description: JSON object containing information to create an outbound call + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/createCall' + updateCallRequest: + description: >- + JSON object containing information to redirect an existing call to a new + BXML document + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/updateCall' + updateCallBxmlRequest: + required: true + content: + application/xml: + schema: + type: string + description: A valid BXML document to replace the call's current BXML. + examples: + speakSentence: + summary: Speak Sentence + value: |- + + + This is a test sentence. + + redirectUrl: + summary: Redirect + value: |- + + + + + updateCallRecordingRequest: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/updateCallRecording' + transcribeRecordingRequest: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/transcribeRecording' + updateConferenceRequest: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/updateConference' + updateConferenceBxmlRequest: + required: true + content: + application/xml: + schema: + type: string + description: A valid BXML document to replace the call's current BXML. + examples: + stopRecording: + summary: Stop Recording + value: |- + + + + + updateConferenceMemberRequest: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/updateConferenceMember' + codeRequest: + description: MFA code request body. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/codeRequest' + codeVerify: + description: MFA code verify request body. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/verifyCodeRequest' + createSyncLookupRequest: + description: Synchronous phone number lookup request. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/syncLookupRequest' + examples: + singleNumberRequestExample: + $ref: '#/components/examples/singleNumberRequestExample' + multipleNumberRequestExample: + $ref: '#/components/examples/multipleNumberRequestExample' + createAsyncBulkLookupRequest: + description: Asynchronous bulk phone number lookup request. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/asyncLookupRequest' + examples: + multipleNumberRequestExample: + $ref: '#/components/examples/multipleNumberRequestExample' + requestTollFreeVerificationRequest: + description: Request for verification of a toll-free phone number. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/verificationRequest' + updateTollFreeVerificationRequestRequest: + description: Update a request for verification of a toll-free phone number. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/tfvSubmissionWrapper' + verificationWebhookRequest: + description: Verification callback status of a toll-free phone number. + required: true + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/verificationWebhook' + - $ref: '#/components/schemas/verificationDenialWebhook' + - $ref: '#/components/schemas/failureWebhook' + - $ref: '#/components/schemas/blockedWebhook' + webhookSubscriptionRequest: + description: >- + Information about a webhook that Bandwidth should send upon the + completion of event customer is trying to subscribe to. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/webhookSubscriptionRequestSchema' + createEndpointRequest: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/createEndpointRequest' + examples: + createWebRtcEndpointRequestExample: + $ref: '#/components/examples/createWeRtcEndpointExample' + updateEndpointBxmlRequest: + required: true + content: + application/xml: + schema: + type: string + description: >- + The BXML document to update the endpoint with. This BXML document + will be executed against the endpoint when it is updated. + + For more information, please refer to our [BXML + documentation](/docs/voice/bxml/). + examples: + updateEndpointBxmlRequestExample: + $ref: '#/components/examples/updateEndpointBxmlRequestExample' + securitySchemes: + Basic: + type: http + scheme: basic + description: >- + Basic authentication is a simple authentication scheme built into the + HTTP protocol. To use it, send your HTTP requests with an + `Authorization` header that contains the word `Basic` followed by a + space and a Base64-encoded string `username:password`. + + + - Example: `Authorization: Basic ZGVtbZpwQDU1dzByZA==` + OAuth2: + type: oauth2 + flows: + clientCredentials: + tokenUrl: https://api.bandwidth.com/api/v1/oauth2/token + scopes: {} + callbacks: + inboundCallback: + '{inboundCallbackUrl}': + post: + requestBody: + required: true + description: >- +

This Inbound Message Webhook is an envelope containing either a + received (MO) message to your + + message-enabled Bandwidth telephone number or a multichannel + client's response to a suggestion response + + or location request. + +

The payload type will be one of message-received, + suggestion-response, or + location-request-response. + +

Note that suggestion-response and + location-request-response callback types are + pertinent only for RBM messages sent from the + /messages/multiChannel endpoint. + +

Please visit Webhooks

+ content: + application/json: + schema: + $ref: '#/components/schemas/inboundCallback' + examples: + smsMessageReceivedCallback: + $ref: '#/components/examples/smsMessageReceivedCallbackExample' + mmsMessageReceivedCallback: + $ref: '#/components/examples/mmsMessageReceivedCallbackExample' + responses: + '200': + description: OK + '202': + description: Accepted + statusCallback: + '{statusCallbackUrl}': + post: + requestBody: + required: true + description: >- +

This Outbound Message Webhook is an envelope containing status + information regarding a message sent (MT) + + from your message-enabled Bandwidth telephone number. +

The payload type will be one of message-sending, message-delivered, message-failed or message-read. +

Note that message-read callbacks are pertinent only for RBM messages sent from the /messages/multiChannel endpoint. +

Please visit Webhooks

+ content: + application/json: + schema: + $ref: '#/components/schemas/statusCallback' + examples: + messageSendingCallback: + $ref: '#/components/examples/messageSendingCallbackExample' + smsMessageDeliveredCallback: + $ref: '#/components/examples/smsMessageDeliveredCallbackExample' + mmsMessageDeliveredCallback: + $ref: '#/components/examples/mmsMessageDeliveredCallbackExample' + groupMmsMessageDeliveredCallback: + $ref: >- + #/components/examples/groupMmsMessageDeliveredCallbackExample + messageFailedCallback: + $ref: '#/components/examples/messageFailedCallbackExample' + responses: + '200': + description: OK + '202': + description: Accepted + tfVerificationStatus: + your_url.com/webhookService: + post: + summary: TFV status updates sent to customer's webhook URL. + description: >- + Unique webhook URL provided by customers to which Bandwidth sends a + POST request to notify customer regarding TFV status updates. + operationId: tfvRequest + parameters: + - description: >- + 64-character lowercase hexidecimal HMAC calculated with a shared + secret key, the canonicalized request body, and SHA256. It is + only included when a shared secret key is set through webhook + subscription. + example: ca7b9e9816c90d336f5dca529e733354b81535c7af027b81878ac98afb2dbaa2 + in: header + name: x-bandwidth-signature-hmac-sha256 + schema: + type: string + requestBody: + $ref: '#/components/requestBodies/verificationWebhookRequest' + responses: + '204': + $ref: '#/components/responses/noContentResponse' + '400': + $ref: '#/components/responses/tfvBadRequestResponse' + '401': + $ref: '#/components/responses/tfvUnauthorizedResponse' + '403': + $ref: '#/components/responses/tfvForbiddenResponse' + '404': + $ref: '#/components/responses/tfvNotFoundResponse' + '405': + $ref: '#/components/responses/tfvNotAllowedResponse' + '429': + $ref: '#/components/responses/tfvTooManyRequestsResponse' + '500': + $ref: '#/components/responses/tfvServerErrorResponse' + '503': + $ref: '#/components/responses/tfvServiceUnavailableResponse' + endpointEvent: + '{request.body#/eventCallbackUrl}': + post: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/endpointEvent' + examples: + endpointDisconnectedEventExample: + $ref: '#/components/examples/endpointDisconnectedEventExample' + responses: + '204': + description: Event was successfully received. From efbcc0381478ac344e33a5952719067f4fc3c9db Mon Sep 17 00:00:00 2001 From: Sudhanshu Moghe Date: Mon, 16 Mar 2026 13:54:54 -0400 Subject: [PATCH 3/7] Refactor response models and update documentation - Updated CreateEndpointResponse to use CreateEndpointResponseData, Error, and Link classes. - Refactored EndpointResponse, ErrorResponse, and ListEndpointsResponse to replace Error1 and Link1 with Error and Link. - Added CreateEndpointResponseData class with properties and validation methods. - Improved documentation for InboundCallback, LookupResult, MachineDetectionConfiguration, MessageRequest, RbmOpenUrlEnum, RbmWebViewEnum, and StatusCallback. - Created new markdown documentation for CreateEndpointResponseData. --- .openapi-generator/FILES | 10 +- README.md | 5 +- api/openapi.yaml | 434 ++++++--------- bandwidth.yml | 79 +-- docs/Callback.md | 4 +- docs/CreateCall.md | 2 +- docs/CreateEndpointResponse.md | 6 +- docs/CreateEndpointResponseData.md | 20 + docs/EndpointResponse.md | 4 +- docs/EndpointsApi.md | 10 +- docs/ErrorResponse.md | 4 +- docs/InboundCallback.md | 4 +- docs/ListEndpointsResponse.md | 4 +- docs/LookupResult.md | 4 +- docs/MachineDetectionConfiguration.md | 2 +- docs/MessageRequest.md | 2 +- docs/StatusCallback.md | 2 +- src/main/java/com/bandwidth/sdk/JSON.java | 5 +- .../com/bandwidth/sdk/model/CreateCall.java | 2 +- .../sdk/model/CreateEndpointResponse.java | 40 +- .../sdk/model/CreateEndpointResponseData.java | 515 ++++++++++++++++++ .../bandwidth/sdk/model/EndpointResponse.java | 28 +- .../bandwidth/sdk/model/ErrorResponse.java | 28 +- .../bandwidth/sdk/model/InboundCallback.java | 4 +- .../sdk/model/InboundCallbackTypeEnum.java | 2 +- .../sdk/model/ListEndpointsResponse.java | 28 +- .../com/bandwidth/sdk/model/LookupResult.java | 4 +- .../model/MachineDetectionConfiguration.java | 2 +- .../bandwidth/sdk/model/MessageRequest.java | 2 +- .../bandwidth/sdk/model/RbmOpenUrlEnum.java | 2 +- .../bandwidth/sdk/model/RbmWebViewEnum.java | 2 +- .../bandwidth/sdk/model/StatusCallback.java | 2 +- 32 files changed, 836 insertions(+), 426 deletions(-) create mode 100644 docs/CreateEndpointResponseData.md create mode 100644 src/main/java/com/bandwidth/sdk/model/CreateEndpointResponseData.java diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index ffb4dcec..79c5fb00 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -47,7 +47,7 @@ docs/CreateCall.md docs/CreateCallResponse.md docs/CreateEndpointRequestBase.md docs/CreateEndpointResponse.md -docs/CreateEndpointResponseObject.md +docs/CreateEndpointResponseData.md docs/CreateMessageRequestError.md docs/CreateMultiChannelMessageResponse.md docs/CreateSyncLookupResponse.md @@ -69,8 +69,6 @@ docs/EndpointTypeEnum.md docs/Endpoints.md docs/EndpointsApi.md docs/Error.md -docs/Error1.md -docs/Error1Source.md docs/ErrorObject.md docs/ErrorResponse.md docs/ErrorSource.md @@ -88,7 +86,6 @@ docs/InitiateCallback.md docs/LatestMessageDeliveryStatusEnum.md docs/LineTypeEnum.md docs/Link.md -docs/Link1.md docs/LinkSchema.md docs/LinksObject.md docs/ListEndpointsResponse.md @@ -299,7 +296,7 @@ src/main/java/com/bandwidth/sdk/model/CreateCall.java src/main/java/com/bandwidth/sdk/model/CreateCallResponse.java src/main/java/com/bandwidth/sdk/model/CreateEndpointRequestBase.java src/main/java/com/bandwidth/sdk/model/CreateEndpointResponse.java -src/main/java/com/bandwidth/sdk/model/CreateEndpointResponseObject.java +src/main/java/com/bandwidth/sdk/model/CreateEndpointResponseData.java src/main/java/com/bandwidth/sdk/model/CreateMessageRequestError.java src/main/java/com/bandwidth/sdk/model/CreateMultiChannelMessageResponse.java src/main/java/com/bandwidth/sdk/model/CreateSyncLookupResponse.java @@ -320,8 +317,6 @@ src/main/java/com/bandwidth/sdk/model/EndpointStatusEnum.java src/main/java/com/bandwidth/sdk/model/EndpointTypeEnum.java src/main/java/com/bandwidth/sdk/model/Endpoints.java src/main/java/com/bandwidth/sdk/model/Error.java -src/main/java/com/bandwidth/sdk/model/Error1.java -src/main/java/com/bandwidth/sdk/model/Error1Source.java src/main/java/com/bandwidth/sdk/model/ErrorObject.java src/main/java/com/bandwidth/sdk/model/ErrorResponse.java src/main/java/com/bandwidth/sdk/model/ErrorSource.java @@ -339,7 +334,6 @@ src/main/java/com/bandwidth/sdk/model/InitiateCallback.java src/main/java/com/bandwidth/sdk/model/LatestMessageDeliveryStatusEnum.java src/main/java/com/bandwidth/sdk/model/LineTypeEnum.java src/main/java/com/bandwidth/sdk/model/Link.java -src/main/java/com/bandwidth/sdk/model/Link1.java src/main/java/com/bandwidth/sdk/model/LinkSchema.java src/main/java/com/bandwidth/sdk/model/LinksObject.java src/main/java/com/bandwidth/sdk/model/ListEndpointsResponse.java diff --git a/README.md b/README.md index a63dc3f8..cbb8cf37 100644 --- a/README.md +++ b/README.md @@ -230,7 +230,7 @@ Class | Method | HTTP request | Description - [CreateCallResponse](docs/CreateCallResponse.md) - [CreateEndpointRequestBase](docs/CreateEndpointRequestBase.md) - [CreateEndpointResponse](docs/CreateEndpointResponse.md) - - [CreateEndpointResponseObject](docs/CreateEndpointResponseObject.md) + - [CreateEndpointResponseData](docs/CreateEndpointResponseData.md) - [CreateMessageRequestError](docs/CreateMessageRequestError.md) - [CreateMultiChannelMessageResponse](docs/CreateMultiChannelMessageResponse.md) - [CreateSyncLookupResponse](docs/CreateSyncLookupResponse.md) @@ -251,8 +251,6 @@ Class | Method | HTTP request | Description - [EndpointTypeEnum](docs/EndpointTypeEnum.md) - [Endpoints](docs/Endpoints.md) - [Error](docs/Error.md) - - [Error1](docs/Error1.md) - - [Error1Source](docs/Error1Source.md) - [ErrorObject](docs/ErrorObject.md) - [ErrorResponse](docs/ErrorResponse.md) - [ErrorSource](docs/ErrorSource.md) @@ -270,7 +268,6 @@ Class | Method | HTTP request | Description - [LatestMessageDeliveryStatusEnum](docs/LatestMessageDeliveryStatusEnum.md) - [LineTypeEnum](docs/LineTypeEnum.md) - [Link](docs/Link.md) - - [Link1](docs/Link1.md) - [LinkSchema](docs/LinkSchema.md) - [LinksObject](docs/LinksObject.md) - [ListEndpointsResponse](docs/ListEndpointsResponse.md) diff --git a/api/openapi.yaml b/api/openapi.yaml index 13c5d860..7b75e49b 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -5840,12 +5840,12 @@ paths: operationId: listEndpoints parameters: - description: Your Bandwidth Account ID. + example: "9900000" explode: false in: path name: accountId required: true schema: - example: "5500123" type: string style: simple - description: The type of endpoint. @@ -5971,6 +5971,9 @@ paths: summary: List Endpoints tags: - Endpoints + x-badges: + - name: Beta + color: "#076EA8" x-accepts: - application/json post: @@ -5981,12 +5984,12 @@ paths: operationId: createEndpoint parameters: - description: Your Bandwidth Account ID. + example: "9900000" explode: false in: path name: accountId required: true schema: - example: "5500123" type: string style: simple requestBody: @@ -6076,6 +6079,9 @@ paths: summary: Create Endpoint tags: - Endpoints + x-badges: + - name: Beta + color: "#076EA8" x-content-type: application/json x-accepts: - application/json @@ -6089,12 +6095,12 @@ paths: operationId: deleteEndpoint parameters: - description: Your Bandwidth Account ID. + example: "9900000" explode: false in: path name: accountId required: true schema: - example: "5500123" type: string style: simple - description: BRTC Endpoint ID. @@ -6184,6 +6190,9 @@ paths: summary: Delete Endpoint tags: - Endpoints + x-badges: + - name: Beta + color: "#076EA8" x-accepts: - application/json get: @@ -6191,12 +6200,12 @@ paths: operationId: getEndpoint parameters: - description: Your Bandwidth Account ID. + example: "9900000" explode: false in: path name: accountId required: true schema: - example: "5500123" type: string style: simple - description: BRTC Endpoint ID. @@ -6293,6 +6302,9 @@ paths: summary: Get Endpoint tags: - Endpoints + x-badges: + - name: Beta + color: "#076EA8" x-accepts: - application/json servers: @@ -6304,12 +6316,12 @@ paths: operationId: updateEndpointBxml parameters: - description: Your Bandwidth Account ID. + example: "9900000" explode: false in: path name: accountId required: true schema: - example: "5500123" type: string style: simple - description: BRTC Endpoint ID. @@ -6401,6 +6413,9 @@ paths: summary: Update Endpoint BXML tags: - Endpoints + x-badges: + - name: Beta + color: "#076EA8" x-content-type: application/xml x-accepts: - application/json @@ -6422,15 +6437,13 @@ components: $ref: "#/components/examples/mmsMessageReceivedCallbackExample" schema: $ref: "#/components/schemas/inboundCallback" - description: "

This Inbound Message Webhook is an envelope containing\ - \ either a received (MO) message to your \nmessage-enabled Bandwidth\ - \ telephone number or a multichannel client's response to a suggestion\ - \ response \nor location request. \n

The payload type will be one\ - \ of message-received, suggestion-response,\ - \ or location-request-response.\n

Note that suggestion-response\ - \ and location-request-response callback types are pertinent\ - \ only for RBM messages sent from the /messages/multiChannel\ - \ endpoint.\n

Please visit Webhooks

" + description: |- +

This Inbound Message Webhook is an envelope containing either a received (MO) message to your + message-enabled Bandwidth telephone number or a multichannel client's response to a suggestion response + or location request. +

The payload type will be one of message-received, suggestion-response, or location-request-response. +

Note that suggestion-response and location-request-response callback types are pertinent only for RBM messages sent from the /messages/multiChannel endpoint. +

Please visit Webhooks

required: true responses: "200": @@ -7771,16 +7784,6 @@ components: schema: type: string style: simple - accountId2: - description: Your Bandwidth Account ID. - explode: false - in: path - name: accountId - required: true - schema: - example: "5500123" - type: string - style: simple endpointId: description: BRTC Endpoint ID. explode: false @@ -8874,6 +8877,8 @@ components: schema: $ref: "#/components/schemas/tfvError" description: Service Unavailable + verifyPutResponse: + description: Accepted listEndpointsResponse: content: application/json: @@ -8973,8 +8978,6 @@ components: schema: $ref: "#/components/schemas/errorResponse" description: Service Unavailable - verifyPutResponse: - description: Accepted schemas: applicationId: description: The ID of the Application your from number or senderId is associated @@ -9358,9 +9361,10 @@ components: format: date-time type: string carrierName: - description: "The name of the Authorized Message Provider (AMP) that handled\ - \ this message. \nIn the US, this is the carrier that the message was sent\ - \ to.\nThis field is present only when this account feature has been enabled." + description: |- + The name of the Authorized Message Provider (AMP) that handled this message. + In the US, this is the carrier that the message was sent to. + This field is present only when this account feature has been enabled. example: AT&T type: string message: @@ -9467,13 +9471,9 @@ components: type: array uniqueItems: true from: - description: "Either an alphanumeric sender ID or the sender's Bandwidth\ - \ phone number in E.164 format, which must be hosted within Bandwidth\ - \ and linked to the account that is generating the message. \nAlphanumeric\ - \ Sender IDs can contain up to 11 characters, upper-case letters A-Z,\ - \ lower-case letters a-z, numbers 0-9, space, hyphen -, plus +, underscore\ - \ _ and ampersand &. Alphanumeric Sender IDs must contain at least one\ - \ letter." + description: |- + Either an alphanumeric sender ID or the sender's Bandwidth phone number in E.164 format, which must be hosted within Bandwidth and linked to the account that is generating the message. + Alphanumeric Sender IDs can contain up to 11 characters, upper-case letters A-Z, lower-case letters a-z, numbers 0-9, space, hyphen -, plus +, underscore _ and ampersand &. Alphanumeric Sender IDs must contain at least one letter. example: "+15551113333" type: string text: @@ -9703,6 +9703,9 @@ components: type: array type: object link: + example: + rel: rel + href: href properties: rel: type: string @@ -10002,20 +10005,21 @@ components: example: REPLY type: string rbmOpenUrlEnum: - description: "Specifies how the URL should be opened on a mobile device.\n-\ - \ `BROWSER` Opens the URL in the device's default browser. If application\ - \ is not set or the device doesn’t support WebView, this option is used by\ - \ default. \n- `WEBVIEW` Opens the URL in an in-app WebView." + description: |- + Specifies how the URL should be opened on a mobile device. + - `BROWSER` Opens the URL in the device's default browser. If application is not set or the device doesn’t support WebView, this option is used by default. + - `WEBVIEW` Opens the URL in an in-app WebView. enum: - BROWSER - WEBVIEW example: WEBVIEW type: string rbmWebViewEnum: - description: "Defines the layout of the WebView on a mobile device. It must\ - \ be defined when application is set to `WEBVIEW`\n- `FULL` WebView takes\ - \ the full screen. \n- `HALF` WebView takes half of the screen.\n- `TALL`\ - \ WebView takes three-quarters of the screen." + description: |- + Defines the layout of the WebView on a mobile device. It must be defined when application is set to `WEBVIEW` + - `FULL` WebView takes the full screen. + - `HALF` WebView takes half of the screen. + - `TALL` WebView takes three-quarters of the screen. enum: - FULL - HALF @@ -10578,10 +10582,10 @@ components: example: 4405 type: integer carrierName: - description: "The name of the Authorized Message Provider (AMP) that handled\ - \ this message. \nIn the US, this is the carrier that the message was\ - \ sent to.\nThis field is present only when this account feature has been\ - \ enabled." + description: |- + The name of the Authorized Message Provider (AMP) that handled this message. + In the US, this is the carrier that the message was sent to. + This field is present only when this account feature has been enabled. example: AT&T type: string required: @@ -10601,9 +10605,9 @@ components: type: $ref: "#/components/schemas/inboundCallbackTypeEnum" to: - description: "The destination phone number the message was sent to. \nFor\ - \ inbound callbacks, this is the Bandwidth number or alphanumeric identifier\ - \ that received the message.\n" + description: | + The destination phone number the message was sent to. + For inbound callbacks, this is the Bandwidth number or alphanumeric identifier that received the message. example: "+15552223333" type: string description: @@ -10613,10 +10617,10 @@ components: message: $ref: "#/components/schemas/inboundCallbackMessage" carrierName: - description: "The name of the Authorized Message Provider (AMP) that handled\ - \ this message. \nIn the US, this is the carrier that the message was\ - \ sent to.\nThis field is present only when this account feature has been\ - \ enabled." + description: |- + The name of the Authorized Message Provider (AMP) that handled this message. + In the US, this is the carrier that the message was sent to. + This field is present only when this account feature has been enabled. example: AT&T type: string required: @@ -10641,13 +10645,11 @@ components: example: message-delivered type: string inboundCallbackTypeEnum: - description: "The possible inbound callback types originating from MO messages\ - \ or multichannel message client responses:\n- `message-received` indicates\ - \ an MO message from a Bandwidth user's client to a Bandwidth number.\n- `request-location-response`\ - \ indicates a response to a location request sent by the Bandwidth user's\ - \ client after receiving an RBM message. \n- `suggestion-response` indicates\ - \ a response to a suggestion sent by the Bandwidth user's client after receiving\ - \ an RBM message." + description: |- + The possible inbound callback types originating from MO messages or multichannel message client responses: + - `message-received` indicates an MO message from a Bandwidth user's client to a Bandwidth number. + - `request-location-response` indicates a response to a location request sent by the Bandwidth user's client after receiving an RBM message. + - `suggestion-response` indicates a response to a suggestion sent by the Bandwidth user's client after receiving an RBM message. enum: - message-received - request-location-response @@ -10865,10 +10867,10 @@ components: nullable: true type: boolean displayName: - description: "The caller display name to use when the call is created. \n\ - May not exceed 256 characters nor contain control characters such as new\ - \ lines.\nIf `privacy` is true, only the following values are valid: `Restricted`,\ - \ `Anonymous`, `Private`, or `Unavailable`." + description: |- + The caller display name to use when the call is created. + May not exceed 256 characters nor contain control characters such as new lines. + If `privacy` is true, only the following values are valid: `Restricted`, `Anonymous`, `Private`, or `Unavailable`. example: John Doe maxLength: 256 nullable: true @@ -11833,9 +11835,9 @@ components: nullable: true type: number machineSpeechEndThreshold: - description: "When an answering machine is detected, the amount of silence\ - \ (in seconds) before assuming the message has finished playing. \nIf\ - \ not provided it will default to the speechEndThreshold value." + description: |- + When an answering machine is detected, the amount of silence (in seconds) before assuming the message has finished playing. + If not provided it will default to the speechEndThreshold value. example: 5 format: double nullable: true @@ -14605,18 +14607,18 @@ components: latestMessageDeliveryStatus: $ref: "#/components/schemas/latestMessageDeliveryStatusEnum" initialMessageDeliveryStatusDate: - description: "[DNI-Only](#section/DNI-Only). The date the phone number entered\ - \ the status described in `latestMessageDeliveryStatus`. \nThink of this\ - \ as the \"start time\" for that status.\nValue resets every time the\ - \ `latestMessageDeliveryStatus` changes." + description: |- + [DNI-Only](#section/DNI-Only). The date the phone number entered the status described in `latestMessageDeliveryStatus`. + Think of this as the "start time" for that status. + Value resets every time the `latestMessageDeliveryStatus` changes. example: 2025-06-20 format: date type: string latestMessageDeliveryStatusDate: - description: "[DNI-Only](#section/DNI-Only). The date bandwidth last received\ - \ delivery status information for this phone number. \nUse this field\ - \ to understand how up-to-date the `latestMessageDeliveryStatus` is.\n\ - Value resets every time the `latestMessageDeliveryStatus` changes." + description: |- + [DNI-Only](#section/DNI-Only). The date bandwidth last received delivery status information for this phone number. + Use this field to understand how up-to-date the `latestMessageDeliveryStatus` is. + Value resets every time the `latestMessageDeliveryStatus` changes. example: 2025-06-21 format: date type: string @@ -15865,6 +15867,16 @@ components: nullable: true pattern: "^[ -~]{16,64}$" type: string + cvTokenNullable: + description: "The token provided by Campaign Verify to validate your political\ + \ use case. Only required for 527 political organizations. If you are not\ + \ a 527 political organization, this field should be omitted. Supplying an\ + \ empty string will likely result in rejection." + example: cv.user123|sess456|mno|tfree|read_write|X7yZ9aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVw + maxLength: 500 + minLength: 0 + nullable: true + type: string endpointId: description: The unique ID of the endpoint. example: e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 @@ -16060,7 +16072,7 @@ components: type: object createEndpointRequest: $ref: "#/components/schemas/createWebRtcConnectionRequest" - createEndpointResponseObject: + createEndpointResponseData: allOf: - $ref: "#/components/schemas/endpoint" - properties: @@ -16109,29 +16121,6 @@ components: - eventType type: object description: An event that occurred on an endpoint. - link1: - example: - method: GET - rel: self - href: https://api.bandwidth.com/v2/accounts/5500123/endpoints/e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 - properties: - href: - description: The full URL of the link. - example: https://api.bandwidth.com/v2/accounts/5500123/endpoints/e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 - type: string - rel: - description: The relationship of the link to the current resource. - example: self - type: string - method: - description: The HTTP method to use when making the request. - enum: - - GET - - POST - - DELETE - example: GET - type: string - type: object page: example: pageNumber: 0 @@ -16162,43 +16151,6 @@ components: required: - pageSize type: object - error1: - example: - code: "404" - description: The requested resource was not found. - id: 59512d87-7a92-4040-8e4a-78fb772019b9 - source: - reference: e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 - field: accountId - parameter: accountId - header: Authorization - type: resource.not_found - properties: - id: - description: A unique identifier for the error. - example: 59512d87-7a92-4040-8e4a-78fb772019b9 - format: uuid - type: string - type: - description: The type of error. - example: resource.not_found - type: string - description: - description: A description of the error. - example: The requested resource was not found. - type: string - code: - description: A code that uniquely identifies the error. - example: "404" - type: string - source: - $ref: "#/components/schemas/error1_source" - required: - - code - - description - - id - - type - type: object listEndpointsResponse: example: data: @@ -16215,40 +16167,30 @@ components: type: WEBRTC status: CONNECTED links: - - method: GET - rel: self - href: https://api.bandwidth.com/v2/accounts/5500123/endpoints/e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 - - method: GET - rel: self - href: https://api.bandwidth.com/v2/accounts/5500123/endpoints/e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + - rel: rel + href: href + - rel: rel + href: href page: pageNumber: 0 totalPages: 10 pageSize: 10 totalElements: 100 errors: - - code: "404" - description: The requested resource was not found. - id: 59512d87-7a92-4040-8e4a-78fb772019b9 - source: - reference: e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 - field: accountId - parameter: accountId - header: Authorization - type: resource.not_found - - code: "404" - description: The requested resource was not found. - id: 59512d87-7a92-4040-8e4a-78fb772019b9 - source: - reference: e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 - field: accountId - parameter: accountId - header: Authorization - type: resource.not_found + - code: 0 + telephoneNumbers: + - telephoneNumber: telephoneNumber + - telephoneNumber: telephoneNumber + description: description + - code: 0 + telephoneNumbers: + - telephoneNumber: telephoneNumber + - telephoneNumber: telephoneNumber + description: description properties: links: items: - $ref: "#/components/schemas/link1" + $ref: "#/components/schemas/link" type: array page: $ref: "#/components/schemas/page" @@ -16258,7 +16200,7 @@ components: type: array errors: items: - $ref: "#/components/schemas/error1" + $ref: "#/components/schemas/error" type: array required: - data @@ -16284,41 +16226,31 @@ components: type: WEBRTC status: CONNECTED links: - - method: GET - rel: self - href: https://api.bandwidth.com/v2/accounts/5500123/endpoints/e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 - - method: GET - rel: self - href: https://api.bandwidth.com/v2/accounts/5500123/endpoints/e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + - rel: rel + href: href + - rel: rel + href: href errors: - - code: "404" - description: The requested resource was not found. - id: 59512d87-7a92-4040-8e4a-78fb772019b9 - source: - reference: e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 - field: accountId - parameter: accountId - header: Authorization - type: resource.not_found - - code: "404" - description: The requested resource was not found. - id: 59512d87-7a92-4040-8e4a-78fb772019b9 - source: - reference: e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 - field: accountId - parameter: accountId - header: Authorization - type: resource.not_found + - code: 0 + telephoneNumbers: + - telephoneNumber: telephoneNumber + - telephoneNumber: telephoneNumber + description: description + - code: 0 + telephoneNumbers: + - telephoneNumber: telephoneNumber + - telephoneNumber: telephoneNumber + description: description properties: links: items: - $ref: "#/components/schemas/link1" + $ref: "#/components/schemas/link" type: array data: $ref: "#/components/schemas/endpoint" errors: items: - $ref: "#/components/schemas/error1" + $ref: "#/components/schemas/error" type: array required: - data @@ -16345,41 +16277,31 @@ components: status: CONNECTED token: xxxxx.yyyyy.zzzzz links: - - method: GET - rel: self - href: https://api.bandwidth.com/v2/accounts/5500123/endpoints/e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 - - method: GET - rel: self - href: https://api.bandwidth.com/v2/accounts/5500123/endpoints/e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + - rel: rel + href: href + - rel: rel + href: href errors: - - code: "404" - description: The requested resource was not found. - id: 59512d87-7a92-4040-8e4a-78fb772019b9 - source: - reference: e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 - field: accountId - parameter: accountId - header: Authorization - type: resource.not_found - - code: "404" - description: The requested resource was not found. - id: 59512d87-7a92-4040-8e4a-78fb772019b9 - source: - reference: e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 - field: accountId - parameter: accountId - header: Authorization - type: resource.not_found + - code: 0 + telephoneNumbers: + - telephoneNumber: telephoneNumber + - telephoneNumber: telephoneNumber + description: description + - code: 0 + telephoneNumbers: + - telephoneNumber: telephoneNumber + - telephoneNumber: telephoneNumber + description: description properties: links: items: - $ref: "#/components/schemas/link1" + $ref: "#/components/schemas/link" type: array data: - $ref: "#/components/schemas/createEndpointResponseObject" + $ref: "#/components/schemas/createEndpointResponseData" errors: items: - $ref: "#/components/schemas/error1" + $ref: "#/components/schemas/error" type: array required: - data @@ -16390,35 +16312,25 @@ components: example: data: "{}" links: - - method: GET - rel: self - href: https://api.bandwidth.com/v2/accounts/5500123/endpoints/e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 - - method: GET - rel: self - href: https://api.bandwidth.com/v2/accounts/5500123/endpoints/e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + - rel: rel + href: href + - rel: rel + href: href errors: - - code: "404" - description: The requested resource was not found. - id: 59512d87-7a92-4040-8e4a-78fb772019b9 - source: - reference: e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 - field: accountId - parameter: accountId - header: Authorization - type: resource.not_found - - code: "404" - description: The requested resource was not found. - id: 59512d87-7a92-4040-8e4a-78fb772019b9 - source: - reference: e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 - field: accountId - parameter: accountId - header: Authorization - type: resource.not_found + - code: 0 + telephoneNumbers: + - telephoneNumber: telephoneNumber + - telephoneNumber: telephoneNumber + description: description + - code: 0 + telephoneNumbers: + - telephoneNumber: telephoneNumber + - telephoneNumber: telephoneNumber + description: description properties: links: items: - $ref: "#/components/schemas/link1" + $ref: "#/components/schemas/link" type: array data: additionalProperties: false @@ -16426,23 +16338,13 @@ components: type: object errors: items: - $ref: "#/components/schemas/error1" + $ref: "#/components/schemas/error" type: array required: - data - errors - links type: object - cvTokenNullable: - description: "The token provided by Campaign Verify to validate your political\ - \ use case. Only required for 527 political organizations. If you are not\ - \ a 527 political organization, this field should be omitted. Supplying an\ - \ empty string will likely result in rejection." - example: cv.user123|sess456|mno|tfree|read_write|X7yZ9aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVw - maxLength: 500 - minLength: 0 - nullable: true - type: string rbmCardContent_media: allOf: - $ref: "#/components/schemas/rbmMessageContentFile" @@ -16600,31 +16502,6 @@ components: - password - username type: object - error1_source: - example: - reference: e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 - field: accountId - parameter: accountId - header: Authorization - properties: - parameter: - description: The URI parameter that caused the error. - example: accountId - type: string - field: - description: The request body field that caused the error. - example: accountId - type: string - header: - description: The header that caused the error. - example: Authorization - type: string - reference: - description: The resource ID or path to the resource (or non-existent resource) - causing the error. - example: e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 - type: string - type: object securitySchemes: Basic: description: |- @@ -16639,3 +16516,4 @@ components: scopes: {} tokenUrl: https://api.bandwidth.com/api/v1/oauth2/token type: oauth2 + diff --git a/bandwidth.yml b/bandwidth.yml index f8acce9e..91010325 100644 --- a/bandwidth.yml +++ b/bandwidth.yml @@ -1699,7 +1699,7 @@ paths: description: Returns a list of endpoints associated with the specified account. operationId: listEndpoints parameters: - - $ref: '#/components/parameters/accountId2' + - $ref: '#/components/parameters/accountId' - $ref: '#/components/parameters/endpointType' - $ref: '#/components/parameters/endpointStatus' - $ref: '#/components/parameters/afterCursor' @@ -1723,6 +1723,9 @@ paths: $ref: '#/components/responses/tooManyRequestsErrorResponse' '500': $ref: '#/components/responses/serviceUnavailableErrorResponse' + x-badges: + - name: Beta + color: '#076EA8' post: tags: - Endpoints @@ -1730,7 +1733,7 @@ paths: description: Creates a new Endpoint for the specified account. operationId: createEndpoint parameters: - - $ref: '#/components/parameters/accountId2' + - $ref: '#/components/parameters/accountId' requestBody: $ref: '#/components/requestBodies/createEndpointRequest' responses: @@ -1755,6 +1758,9 @@ paths: callbacks: endpointEventCallback: $ref: '#/components/callbacks/endpointEvent' + x-badges: + - name: Beta + color: '#076EA8' servers: &ref_5 - url: https://api.bandwidth.com/v2 description: Production @@ -1766,7 +1772,7 @@ paths: description: Returns information about the specified endpoint. operationId: getEndpoint parameters: - - $ref: '#/components/parameters/accountId2' + - $ref: '#/components/parameters/accountId' - $ref: '#/components/parameters/endpointId' responses: '200': @@ -1787,6 +1793,9 @@ paths: $ref: '#/components/responses/tooManyRequestsErrorResponse' '500': $ref: '#/components/responses/serviceUnavailableErrorResponse' + x-badges: + - name: Beta + color: '#076EA8' delete: tags: - Endpoints @@ -1796,7 +1805,7 @@ paths: media, the media stream will be terminated. operationId: deleteEndpoint parameters: - - $ref: '#/components/parameters/accountId2' + - $ref: '#/components/parameters/accountId' - $ref: '#/components/parameters/endpointId' responses: '204': @@ -1817,6 +1826,9 @@ paths: $ref: '#/components/responses/tooManyRequestsErrorResponse' '500': $ref: '#/components/responses/serviceUnavailableErrorResponse' + x-badges: + - name: Beta + color: '#076EA8' servers: *ref_5 /accounts/{accountId}/endpoints/{endpointId}/bxml: put: @@ -1826,7 +1838,7 @@ paths: description: Updates the BXML for the specified endpoint. operationId: updateEndpointBxml parameters: - - $ref: '#/components/parameters/accountId2' + - $ref: '#/components/parameters/accountId' - $ref: '#/components/parameters/endpointId' requestBody: $ref: '#/components/requestBodies/updateEndpointBxmlRequest' @@ -1849,6 +1861,9 @@ paths: $ref: '#/components/responses/tooManyRequestsErrorResponse' '500': $ref: '#/components/responses/serviceUnavailableErrorResponse' + x-badges: + - name: Beta + color: '#076EA8' servers: *ref_5 components: schemas: @@ -6759,6 +6774,18 @@ components: nullable: true pattern: ^[ -~]{16,64}$ type: string + cvTokenNullable: + type: string + description: >- + The token provided by Campaign Verify to validate your political use + case. Only required for 527 political organizations. If you are not a + 527 political organization, this field should be omitted. Supplying an + empty string will likely result in rejection. + minLength: 0 + maxLength: 500 + nullable: true + example: >- + cv.user123|sess456|mno|tfree|read_write|X7yZ9aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVw endpointId: type: string description: The unique ID of the endpoint. @@ -6925,7 +6952,7 @@ components: propertyName: type mapping: WEBRTC: '#/components/schemas/createWebRtcConnectionRequest' - createEndpointResponseObject: + createEndpointResponseData: allOf: - $ref: '#/components/schemas/endpoint' - type: object @@ -6988,7 +7015,7 @@ components: links: type: array items: - $ref: '#/components/schemas/link1' + $ref: '#/components/schemas/link' page: $ref: '#/components/schemas/page' data: @@ -6998,7 +7025,7 @@ components: errors: type: array items: - $ref: '#/components/schemas/error1' + $ref: '#/components/schemas/error' required: - links - data @@ -7009,13 +7036,13 @@ components: links: type: array items: - $ref: '#/components/schemas/link1' + $ref: '#/components/schemas/link' data: $ref: '#/components/schemas/endpoint' errors: type: array items: - $ref: '#/components/schemas/error1' + $ref: '#/components/schemas/error' required: - links - data @@ -7026,13 +7053,13 @@ components: links: type: array items: - $ref: '#/components/schemas/link1' + $ref: '#/components/schemas/link' data: - $ref: '#/components/schemas/createEndpointResponseObject' + $ref: '#/components/schemas/createEndpointResponseData' errors: type: array items: - $ref: '#/components/schemas/error1' + $ref: '#/components/schemas/error' required: - links - data @@ -7043,7 +7070,7 @@ components: links: type: array items: - $ref: '#/components/schemas/link1' + $ref: '#/components/schemas/link' data: type: object nullable: true @@ -7051,23 +7078,11 @@ components: errors: type: array items: - $ref: '#/components/schemas/error1' + $ref: '#/components/schemas/error' required: - links - data - errors - cvTokenNullable: - type: string - description: >- - The token provided by Campaign Verify to validate your political use - case. Only required for 527 political organizations. If you are not a - 527 political organization, this field should be omitted. Supplying an - empty string will likely result in rejection. - minLength: 0 - maxLength: 500 - nullable: true - example: >- - cv.user123|sess456|mno|tfree|read_write|X7yZ9aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVw responses: createMessageResponse: description: Accepted @@ -7736,6 +7751,8 @@ components: example: description: Service Unavailable Error. type: Service Unavailable + verifyPutResponse: + description: Accepted listEndpointsResponse: description: OK content: @@ -8334,14 +8351,6 @@ components: type: string description: Webhook subscription ID example: 7bt57JcsVYJrN9K1OcV1Nu - accountId2: - name: accountId - in: path - required: true - schema: - type: string - example: '5500123' - description: Your Bandwidth Account ID. endpointId: name: endpointId in: path diff --git a/docs/Callback.md b/docs/Callback.md index 56428470..9d38bdd5 100644 --- a/docs/Callback.md +++ b/docs/Callback.md @@ -11,11 +11,11 @@ Callbacks are divided into two types based on direction of the related message: |**time** | **OffsetDateTime** | | | |**eventTime** | **OffsetDateTime** | Represents the time at which the message was read, for `message-read` callbacks. | [optional] | |**type** | **InboundCallbackTypeEnum** | | | -|**to** | **String** | The destination phone number the message was sent to. For inbound callbacks, this is the Bandwidth number or alphanumeric identifier that received the message. | | +|**to** | **String** | The destination phone number the message was sent to. For inbound callbacks, this is the Bandwidth number or alphanumeric identifier that received the message. | | |**description** | **String** | A detailed description of the event described by the callback. | | |**message** | [**InboundCallbackMessage**](InboundCallbackMessage.md) | | | |**errorCode** | **Integer** | Optional error code, applicable only when type is `message-failed`. | [optional] | -|**carrierName** | **String** | The name of the Authorized Message Provider (AMP) that handled this message. In the US, this is the carrier that the message was sent to. This field is present only when this account feature has been enabled. | [optional] | +|**carrierName** | **String** | The name of the Authorized Message Provider (AMP) that handled this message. In the US, this is the carrier that the message was sent to. This field is present only when this account feature has been enabled. | [optional] | diff --git a/docs/CreateCall.md b/docs/CreateCall.md index 109c9170..7937060a 100644 --- a/docs/CreateCall.md +++ b/docs/CreateCall.md @@ -10,7 +10,7 @@ |**to** | **String** | The destination to call (must be an E.164 formatted number (e.g. `+15555551212`) or a SIP URI (e.g. `sip:user@server.example`)). | | |**from** | **String** | A Bandwidth phone number on your account the call should come from (must be in E.164 format, like `+15555551212`) even if `privacy` is set to true. | | |**privacy** | **Boolean** | Hide the calling number. The `displayName` field can be used to customize the displayed name. | [optional] | -|**displayName** | **String** | The caller display name to use when the call is created. May not exceed 256 characters nor contain control characters such as new lines. If `privacy` is true, only the following values are valid: `Restricted`, `Anonymous`, `Private`, or `Unavailable`. | [optional] | +|**displayName** | **String** | The caller display name to use when the call is created. May not exceed 256 characters nor contain control characters such as new lines. If `privacy` is true, only the following values are valid: `Restricted`, `Anonymous`, `Private`, or `Unavailable`. | [optional] | |**uui** | **String** | A comma-separated list of 'User-To-User' headers to be sent in the INVITE when calling a SIP URI. Each value must end with an 'encoding' parameter as described in <a href='https://tools.ietf.org/html/rfc7433'>RFC 7433</a>. Only 'jwt', 'base64' and 'hex' encodings are allowed. The entire value cannot exceed 350 characters, including parameters and separators. | [optional] | |**applicationId** | **String** | The id of the application associated with the `from` number. | | |**answerUrl** | **URI** | The full URL to send the <a href='/docs/voice/webhooks/answer'>Answer</a> event to when the called party answers. This endpoint should return the first <a href='/docs/voice/bxml'>BXML document</a> to be executed in the call. Must use `https` if specifying `username` and `password`. | | diff --git a/docs/CreateEndpointResponse.md b/docs/CreateEndpointResponse.md index aff840ea..3c481b31 100644 --- a/docs/CreateEndpointResponse.md +++ b/docs/CreateEndpointResponse.md @@ -7,9 +7,9 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**links** | [**List<Link1>**](Link1.md) | | | -|**data** | [**CreateEndpointResponseObject**](CreateEndpointResponseObject.md) | | | -|**errors** | [**List<Error1>**](Error1.md) | | | +|**links** | [**List<Link>**](Link.md) | | | +|**data** | [**CreateEndpointResponseData**](CreateEndpointResponseData.md) | | | +|**errors** | [**List<Error>**](Error.md) | | | diff --git a/docs/CreateEndpointResponseData.md b/docs/CreateEndpointResponseData.md new file mode 100644 index 00000000..2e1911fc --- /dev/null +++ b/docs/CreateEndpointResponseData.md @@ -0,0 +1,20 @@ + + +# CreateEndpointResponseData + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**endpointId** | **String** | The unique ID of the endpoint. | | +|**type** | **EndpointTypeEnum** | | | +|**status** | **EndpointStatusEnum** | | | +|**creationTimestamp** | **OffsetDateTime** | The time the endpoint was created. In ISO-8601 format. | | +|**expirationTimestamp** | **OffsetDateTime** | The time the endpoint token will expire. In ISO-8601 format. Tokens last 24 hours. | | +|**tag** | **String** | A tag for the endpoint. | [optional] | +|**devices** | [**List<Device>**](Device.md) | | [optional] | +|**token** | **String** | The json web token specific to the endpoint. Used to authenticate the client with the media gateway. | | + + + diff --git a/docs/EndpointResponse.md b/docs/EndpointResponse.md index d5615e9c..2240efed 100644 --- a/docs/EndpointResponse.md +++ b/docs/EndpointResponse.md @@ -7,9 +7,9 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**links** | [**List<Link1>**](Link1.md) | | | +|**links** | [**List<Link>**](Link.md) | | | |**data** | [**Endpoint**](Endpoint.md) | | | -|**errors** | [**List<Error1>**](Error1.md) | | | +|**errors** | [**List<Error>**](Error.md) | | | diff --git a/docs/EndpointsApi.md b/docs/EndpointsApi.md index e7fd945f..41586cc2 100644 --- a/docs/EndpointsApi.md +++ b/docs/EndpointsApi.md @@ -44,7 +44,7 @@ public class Example { OAuth2.setAccessToken("YOUR ACCESS TOKEN"); EndpointsApi apiInstance = new EndpointsApi(defaultClient); - String accountId = "5500123"; // String | Your Bandwidth Account ID. + String accountId = "9900000"; // String | Your Bandwidth Account ID. CreateWebRtcConnectionRequest body = new CreateWebRtcConnectionRequest(); // CreateWebRtcConnectionRequest | try { CreateEndpointResponse result = apiInstance.createEndpoint(accountId, body); @@ -126,7 +126,7 @@ public class Example { OAuth2.setAccessToken("YOUR ACCESS TOKEN"); EndpointsApi apiInstance = new EndpointsApi(defaultClient); - String accountId = "5500123"; // String | Your Bandwidth Account ID. + String accountId = "9900000"; // String | Your Bandwidth Account ID. String endpointId = "e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85"; // String | BRTC Endpoint ID. try { apiInstance.deleteEndpoint(accountId, endpointId); @@ -207,7 +207,7 @@ public class Example { OAuth2.setAccessToken("YOUR ACCESS TOKEN"); EndpointsApi apiInstance = new EndpointsApi(defaultClient); - String accountId = "5500123"; // String | Your Bandwidth Account ID. + String accountId = "9900000"; // String | Your Bandwidth Account ID. String endpointId = "e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85"; // String | BRTC Endpoint ID. try { EndpointResponse result = apiInstance.getEndpoint(accountId, endpointId); @@ -289,7 +289,7 @@ public class Example { OAuth2.setAccessToken("YOUR ACCESS TOKEN"); EndpointsApi apiInstance = new EndpointsApi(defaultClient); - String accountId = "5500123"; // String | Your Bandwidth Account ID. + String accountId = "9900000"; // String | Your Bandwidth Account ID. EndpointTypeEnum type = EndpointTypeEnum.fromValue("WEBRTC"); // EndpointTypeEnum | The type of endpoint. EndpointStatusEnum status = EndpointStatusEnum.fromValue("CONNECTED"); // EndpointStatusEnum | The status of the endpoint. String afterCursor = "TWF5IHRoZSBmb3JjZSBiZSB3aXRoIHlvdQ=="; // String | The cursor to use for pagination. This is the value of the `next` link in the previous response. @@ -377,7 +377,7 @@ public class Example { OAuth2.setAccessToken("YOUR ACCESS TOKEN"); EndpointsApi apiInstance = new EndpointsApi(defaultClient); - String accountId = "5500123"; // String | Your Bandwidth Account ID. + String accountId = "9900000"; // String | Your Bandwidth Account ID. String endpointId = "e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85"; // String | BRTC Endpoint ID. String body = "body_example"; // String | try { diff --git a/docs/ErrorResponse.md b/docs/ErrorResponse.md index fa7cb478..a5409868 100644 --- a/docs/ErrorResponse.md +++ b/docs/ErrorResponse.md @@ -7,9 +7,9 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**links** | [**List<Link1>**](Link1.md) | | | +|**links** | [**List<Link>**](Link.md) | | | |**data** | **Object** | | | -|**errors** | [**List<Error1>**](Error1.md) | | | +|**errors** | [**List<Error>**](Error.md) | | | diff --git a/docs/InboundCallback.md b/docs/InboundCallback.md index 5a1993cb..520e3f24 100644 --- a/docs/InboundCallback.md +++ b/docs/InboundCallback.md @@ -10,10 +10,10 @@ Represents an inbound callback. |------------ | ------------- | ------------- | -------------| |**time** | **OffsetDateTime** | | | |**type** | **InboundCallbackTypeEnum** | | | -|**to** | **String** | The destination phone number the message was sent to. For inbound callbacks, this is the Bandwidth number or alphanumeric identifier that received the message. | | +|**to** | **String** | The destination phone number the message was sent to. For inbound callbacks, this is the Bandwidth number or alphanumeric identifier that received the message. | | |**description** | **String** | A detailed description of the event described by the callback. | | |**message** | [**InboundCallbackMessage**](InboundCallbackMessage.md) | | | -|**carrierName** | **String** | The name of the Authorized Message Provider (AMP) that handled this message. In the US, this is the carrier that the message was sent to. This field is present only when this account feature has been enabled. | [optional] | +|**carrierName** | **String** | The name of the Authorized Message Provider (AMP) that handled this message. In the US, this is the carrier that the message was sent to. This field is present only when this account feature has been enabled. | [optional] | diff --git a/docs/ListEndpointsResponse.md b/docs/ListEndpointsResponse.md index cefcc63e..2ab178bf 100644 --- a/docs/ListEndpointsResponse.md +++ b/docs/ListEndpointsResponse.md @@ -7,10 +7,10 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**links** | [**List<Link1>**](Link1.md) | | | +|**links** | [**List<Link>**](Link.md) | | | |**page** | [**Page**](Page.md) | | [optional] | |**data** | [**List<Endpoints>**](Endpoints.md) | | | -|**errors** | [**List<Error1>**](Error1.md) | | | +|**errors** | [**List<Error>**](Error.md) | | | diff --git a/docs/LookupResult.md b/docs/LookupResult.md index 21e16602..d8353faa 100644 --- a/docs/LookupResult.md +++ b/docs/LookupResult.md @@ -17,8 +17,8 @@ Carrier information results for the specified telephone number. |**deactivationDate** | **String** | [DNI-Only](#section/DNI-Only). The datetime the carrier reported a deactivation event. | [optional] | |**deactivationEvent** | **DeactivationEventEnum** | | [optional] | |**latestMessageDeliveryStatus** | **LatestMessageDeliveryStatusEnum** | | [optional] | -|**initialMessageDeliveryStatusDate** | **LocalDate** | [DNI-Only](#section/DNI-Only). The date the phone number entered the status described in `latestMessageDeliveryStatus`. Think of this as the \"start time\" for that status. Value resets every time the `latestMessageDeliveryStatus` changes. | [optional] | -|**latestMessageDeliveryStatusDate** | **LocalDate** | [DNI-Only](#section/DNI-Only). The date bandwidth last received delivery status information for this phone number. Use this field to understand how up-to-date the `latestMessageDeliveryStatus` is. Value resets every time the `latestMessageDeliveryStatus` changes. | [optional] | +|**initialMessageDeliveryStatusDate** | **LocalDate** | [DNI-Only](#section/DNI-Only). The date the phone number entered the status described in `latestMessageDeliveryStatus`. Think of this as the \"start time\" for that status. Value resets every time the `latestMessageDeliveryStatus` changes. | [optional] | +|**latestMessageDeliveryStatusDate** | **LocalDate** | [DNI-Only](#section/DNI-Only). The date bandwidth last received delivery status information for this phone number. Use this field to understand how up-to-date the `latestMessageDeliveryStatus` is. Value resets every time the `latestMessageDeliveryStatus` changes. | [optional] | diff --git a/docs/MachineDetectionConfiguration.md b/docs/MachineDetectionConfiguration.md index a3f6de4c..f3aeba26 100644 --- a/docs/MachineDetectionConfiguration.md +++ b/docs/MachineDetectionConfiguration.md @@ -13,7 +13,7 @@ The machine detection request used to perform devices = new ArrayList<>(); + + public static final String SERIALIZED_NAME_TOKEN = "token"; + @SerializedName(SERIALIZED_NAME_TOKEN) + @javax.annotation.Nonnull + private String token; + + public CreateEndpointResponseData() { + } + + public CreateEndpointResponseData endpointId(@javax.annotation.Nonnull String endpointId) { + this.endpointId = endpointId; + return this; + } + + /** + * The unique ID of the endpoint. + * @return endpointId + */ + @javax.annotation.Nonnull + public String getEndpointId() { + return endpointId; + } + + public void setEndpointId(@javax.annotation.Nonnull String endpointId) { + this.endpointId = endpointId; + } + + + public CreateEndpointResponseData type(@javax.annotation.Nonnull EndpointTypeEnum type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nonnull + public EndpointTypeEnum getType() { + return type; + } + + public void setType(@javax.annotation.Nonnull EndpointTypeEnum type) { + this.type = type; + } + + + public CreateEndpointResponseData status(@javax.annotation.Nonnull EndpointStatusEnum status) { + this.status = status; + return this; + } + + /** + * Get status + * @return status + */ + @javax.annotation.Nonnull + public EndpointStatusEnum getStatus() { + return status; + } + + public void setStatus(@javax.annotation.Nonnull EndpointStatusEnum status) { + this.status = status; + } + + + public CreateEndpointResponseData creationTimestamp(@javax.annotation.Nonnull OffsetDateTime creationTimestamp) { + this.creationTimestamp = creationTimestamp; + return this; + } + + /** + * The time the endpoint was created. In ISO-8601 format. + * @return creationTimestamp + */ + @javax.annotation.Nonnull + public OffsetDateTime getCreationTimestamp() { + return creationTimestamp; + } + + public void setCreationTimestamp(@javax.annotation.Nonnull OffsetDateTime creationTimestamp) { + this.creationTimestamp = creationTimestamp; + } + + + public CreateEndpointResponseData expirationTimestamp(@javax.annotation.Nonnull OffsetDateTime expirationTimestamp) { + this.expirationTimestamp = expirationTimestamp; + return this; + } + + /** + * The time the endpoint token will expire. In ISO-8601 format. Tokens last 24 hours. + * @return expirationTimestamp + */ + @javax.annotation.Nonnull + public OffsetDateTime getExpirationTimestamp() { + return expirationTimestamp; + } + + public void setExpirationTimestamp(@javax.annotation.Nonnull OffsetDateTime expirationTimestamp) { + this.expirationTimestamp = expirationTimestamp; + } + + + public CreateEndpointResponseData tag(@javax.annotation.Nullable String tag) { + this.tag = tag; + return this; + } + + /** + * A tag for the endpoint. + * @return tag + */ + @javax.annotation.Nullable + public String getTag() { + return tag; + } + + public void setTag(@javax.annotation.Nullable String tag) { + this.tag = tag; + } + + + public CreateEndpointResponseData devices(@javax.annotation.Nullable List devices) { + this.devices = devices; + return this; + } + + public CreateEndpointResponseData addDevicesItem(Device devicesItem) { + if (this.devices == null) { + this.devices = new ArrayList<>(); + } + this.devices.add(devicesItem); + return this; + } + + /** + * Get devices + * @return devices + */ + @javax.annotation.Nullable + public List getDevices() { + return devices; + } + + public void setDevices(@javax.annotation.Nullable List devices) { + this.devices = devices; + } + + + public CreateEndpointResponseData token(@javax.annotation.Nonnull String token) { + this.token = token; + return this; + } + + /** + * The json web token specific to the endpoint. Used to authenticate the client with the media gateway. + * @return token + */ + @javax.annotation.Nonnull + public String getToken() { + return token; + } + + public void setToken(@javax.annotation.Nonnull String token) { + this.token = token; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the CreateEndpointResponseData instance itself + */ + public CreateEndpointResponseData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateEndpointResponseData createEndpointResponseData = (CreateEndpointResponseData) o; + return Objects.equals(this.endpointId, createEndpointResponseData.endpointId) && + Objects.equals(this.type, createEndpointResponseData.type) && + Objects.equals(this.status, createEndpointResponseData.status) && + Objects.equals(this.creationTimestamp, createEndpointResponseData.creationTimestamp) && + Objects.equals(this.expirationTimestamp, createEndpointResponseData.expirationTimestamp) && + Objects.equals(this.tag, createEndpointResponseData.tag) && + Objects.equals(this.devices, createEndpointResponseData.devices) && + Objects.equals(this.token, createEndpointResponseData.token)&& + Objects.equals(this.additionalProperties, createEndpointResponseData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(endpointId, type, status, creationTimestamp, expirationTimestamp, tag, devices, token, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateEndpointResponseData {\n"); + sb.append(" endpointId: ").append(toIndentedString(endpointId)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" creationTimestamp: ").append(toIndentedString(creationTimestamp)).append("\n"); + sb.append(" expirationTimestamp: ").append(toIndentedString(expirationTimestamp)).append("\n"); + sb.append(" tag: ").append(toIndentedString(tag)).append("\n"); + sb.append(" devices: ").append(toIndentedString(devices)).append("\n"); + sb.append(" token: ").append(toIndentedString(token)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("endpointId", "type", "status", "creationTimestamp", "expirationTimestamp", "tag", "devices", "token")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("endpointId", "type", "status", "creationTimestamp", "expirationTimestamp", "token")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CreateEndpointResponseData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateEndpointResponseData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in CreateEndpointResponseData is not found in the empty JSON string", CreateEndpointResponseData.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateEndpointResponseData.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("endpointId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `endpointId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("endpointId").toString())); + } + // validate the required field `type` + EndpointTypeEnum.validateJsonElement(jsonObj.get("type")); + // validate the required field `status` + EndpointStatusEnum.validateJsonElement(jsonObj.get("status")); + if ((jsonObj.get("tag") != null && !jsonObj.get("tag").isJsonNull()) && !jsonObj.get("tag").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `tag` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tag").toString())); + } + if (jsonObj.get("devices") != null && !jsonObj.get("devices").isJsonNull()) { + JsonArray jsonArraydevices = jsonObj.getAsJsonArray("devices"); + if (jsonArraydevices != null) { + // ensure the json data is an array + if (!jsonObj.get("devices").isJsonArray()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `devices` to be an array in the JSON string but got `%s`", jsonObj.get("devices").toString())); + } + + // validate the optional field `devices` (array) + for (int i = 0; i < jsonArraydevices.size(); i++) { + Device.validateJsonElement(jsonArraydevices.get(i)); + }; + } + } + if (!jsonObj.get("token").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("token").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateEndpointResponseData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateEndpointResponseData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CreateEndpointResponseData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateEndpointResponseData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public CreateEndpointResponseData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CreateEndpointResponseData instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CreateEndpointResponseData given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateEndpointResponseData + * @throws IOException if the JSON string is invalid with respect to CreateEndpointResponseData + */ + public static CreateEndpointResponseData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateEndpointResponseData.class); + } + + /** + * Convert an instance of CreateEndpointResponseData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/bandwidth/sdk/model/EndpointResponse.java b/src/main/java/com/bandwidth/sdk/model/EndpointResponse.java index 3cb5e4b3..1a59b799 100644 --- a/src/main/java/com/bandwidth/sdk/model/EndpointResponse.java +++ b/src/main/java/com/bandwidth/sdk/model/EndpointResponse.java @@ -16,8 +16,8 @@ import java.util.Objects; import java.util.Locale; import com.bandwidth.sdk.model.Endpoint; -import com.bandwidth.sdk.model.Error1; -import com.bandwidth.sdk.model.Link1; +import com.bandwidth.sdk.model.Error; +import com.bandwidth.sdk.model.Link; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -60,7 +60,7 @@ public class EndpointResponse { public static final String SERIALIZED_NAME_LINKS = "links"; @SerializedName(SERIALIZED_NAME_LINKS) @javax.annotation.Nonnull - private List links = new ArrayList<>(); + private List links = new ArrayList<>(); public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) @@ -70,17 +70,17 @@ public class EndpointResponse { public static final String SERIALIZED_NAME_ERRORS = "errors"; @SerializedName(SERIALIZED_NAME_ERRORS) @javax.annotation.Nonnull - private List errors = new ArrayList<>(); + private List errors = new ArrayList<>(); public EndpointResponse() { } - public EndpointResponse links(@javax.annotation.Nonnull List links) { + public EndpointResponse links(@javax.annotation.Nonnull List links) { this.links = links; return this; } - public EndpointResponse addLinksItem(Link1 linksItem) { + public EndpointResponse addLinksItem(Link linksItem) { if (this.links == null) { this.links = new ArrayList<>(); } @@ -93,11 +93,11 @@ public EndpointResponse addLinksItem(Link1 linksItem) { * @return links */ @javax.annotation.Nonnull - public List getLinks() { + public List getLinks() { return links; } - public void setLinks(@javax.annotation.Nonnull List links) { + public void setLinks(@javax.annotation.Nonnull List links) { this.links = links; } @@ -121,12 +121,12 @@ public void setData(@javax.annotation.Nonnull Endpoint data) { } - public EndpointResponse errors(@javax.annotation.Nonnull List errors) { + public EndpointResponse errors(@javax.annotation.Nonnull List errors) { this.errors = errors; return this; } - public EndpointResponse addErrorsItem(Error1 errorsItem) { + public EndpointResponse addErrorsItem(Error errorsItem) { if (this.errors == null) { this.errors = new ArrayList<>(); } @@ -139,11 +139,11 @@ public EndpointResponse addErrorsItem(Error1 errorsItem) { * @return errors */ @javax.annotation.Nonnull - public List getErrors() { + public List getErrors() { return errors; } - public void setErrors(@javax.annotation.Nonnull List errors) { + public void setErrors(@javax.annotation.Nonnull List errors) { this.errors = errors; } @@ -276,7 +276,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti JsonArray jsonArraylinks = jsonObj.getAsJsonArray("links"); // validate the required field `links` (array) for (int i = 0; i < jsonArraylinks.size(); i++) { - Link1.validateJsonElement(jsonArraylinks.get(i)); + Link.validateJsonElement(jsonArraylinks.get(i)); }; // validate the required field `data` Endpoint.validateJsonElement(jsonObj.get("data")); @@ -288,7 +288,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); // validate the required field `errors` (array) for (int i = 0; i < jsonArrayerrors.size(); i++) { - Error1.validateJsonElement(jsonArrayerrors.get(i)); + Error.validateJsonElement(jsonArrayerrors.get(i)); }; } diff --git a/src/main/java/com/bandwidth/sdk/model/ErrorResponse.java b/src/main/java/com/bandwidth/sdk/model/ErrorResponse.java index 8c59b063..506e1d91 100644 --- a/src/main/java/com/bandwidth/sdk/model/ErrorResponse.java +++ b/src/main/java/com/bandwidth/sdk/model/ErrorResponse.java @@ -15,8 +15,8 @@ import java.util.Objects; import java.util.Locale; -import com.bandwidth.sdk.model.Error1; -import com.bandwidth.sdk.model.Link1; +import com.bandwidth.sdk.model.Error; +import com.bandwidth.sdk.model.Link; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -59,7 +59,7 @@ public class ErrorResponse { public static final String SERIALIZED_NAME_LINKS = "links"; @SerializedName(SERIALIZED_NAME_LINKS) @javax.annotation.Nonnull - private List links = new ArrayList<>(); + private List links = new ArrayList<>(); public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) @@ -69,17 +69,17 @@ public class ErrorResponse { public static final String SERIALIZED_NAME_ERRORS = "errors"; @SerializedName(SERIALIZED_NAME_ERRORS) @javax.annotation.Nonnull - private List errors = new ArrayList<>(); + private List errors = new ArrayList<>(); public ErrorResponse() { } - public ErrorResponse links(@javax.annotation.Nonnull List links) { + public ErrorResponse links(@javax.annotation.Nonnull List links) { this.links = links; return this; } - public ErrorResponse addLinksItem(Link1 linksItem) { + public ErrorResponse addLinksItem(Link linksItem) { if (this.links == null) { this.links = new ArrayList<>(); } @@ -92,11 +92,11 @@ public ErrorResponse addLinksItem(Link1 linksItem) { * @return links */ @javax.annotation.Nonnull - public List getLinks() { + public List getLinks() { return links; } - public void setLinks(@javax.annotation.Nonnull List links) { + public void setLinks(@javax.annotation.Nonnull List links) { this.links = links; } @@ -120,12 +120,12 @@ public void setData(@javax.annotation.Nullable Object data) { } - public ErrorResponse errors(@javax.annotation.Nonnull List errors) { + public ErrorResponse errors(@javax.annotation.Nonnull List errors) { this.errors = errors; return this; } - public ErrorResponse addErrorsItem(Error1 errorsItem) { + public ErrorResponse addErrorsItem(Error errorsItem) { if (this.errors == null) { this.errors = new ArrayList<>(); } @@ -138,11 +138,11 @@ public ErrorResponse addErrorsItem(Error1 errorsItem) { * @return errors */ @javax.annotation.Nonnull - public List getErrors() { + public List getErrors() { return errors; } - public void setErrors(@javax.annotation.Nonnull List errors) { + public void setErrors(@javax.annotation.Nonnull List errors) { this.errors = errors; } @@ -275,7 +275,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti JsonArray jsonArraylinks = jsonObj.getAsJsonArray("links"); // validate the required field `links` (array) for (int i = 0; i < jsonArraylinks.size(); i++) { - Link1.validateJsonElement(jsonArraylinks.get(i)); + Link.validateJsonElement(jsonArraylinks.get(i)); }; // ensure the json data is an array if (!jsonObj.get("errors").isJsonArray()) { @@ -285,7 +285,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); // validate the required field `errors` (array) for (int i = 0; i < jsonArrayerrors.size(); i++) { - Error1.validateJsonElement(jsonArrayerrors.get(i)); + Error.validateJsonElement(jsonArrayerrors.get(i)); }; } diff --git a/src/main/java/com/bandwidth/sdk/model/InboundCallback.java b/src/main/java/com/bandwidth/sdk/model/InboundCallback.java index bf27d076..17e398fe 100644 --- a/src/main/java/com/bandwidth/sdk/model/InboundCallback.java +++ b/src/main/java/com/bandwidth/sdk/model/InboundCallback.java @@ -132,7 +132,7 @@ public InboundCallback to(@javax.annotation.Nonnull String to) { } /** - * The destination phone number the message was sent to. For inbound callbacks, this is the Bandwidth number or alphanumeric identifier that received the message. + * The destination phone number the message was sent to. For inbound callbacks, this is the Bandwidth number or alphanumeric identifier that received the message. * @return to */ @javax.annotation.Nonnull @@ -189,7 +189,7 @@ public InboundCallback carrierName(@javax.annotation.Nullable String carrierName } /** - * The name of the Authorized Message Provider (AMP) that handled this message. In the US, this is the carrier that the message was sent to. This field is present only when this account feature has been enabled. + * The name of the Authorized Message Provider (AMP) that handled this message. In the US, this is the carrier that the message was sent to. This field is present only when this account feature has been enabled. * @return carrierName */ @javax.annotation.Nullable diff --git a/src/main/java/com/bandwidth/sdk/model/InboundCallbackTypeEnum.java b/src/main/java/com/bandwidth/sdk/model/InboundCallbackTypeEnum.java index cb3a5b64..2c09896b 100644 --- a/src/main/java/com/bandwidth/sdk/model/InboundCallbackTypeEnum.java +++ b/src/main/java/com/bandwidth/sdk/model/InboundCallbackTypeEnum.java @@ -26,7 +26,7 @@ import com.google.gson.stream.JsonWriter; /** - * The possible inbound callback types originating from MO messages or multichannel message client responses: - `message-received` indicates an MO message from a Bandwidth user's client to a Bandwidth number. - `request-location-response` indicates a response to a location request sent by the Bandwidth user's client after receiving an RBM message. - `suggestion-response` indicates a response to a suggestion sent by the Bandwidth user's client after receiving an RBM message. + * The possible inbound callback types originating from MO messages or multichannel message client responses: - `message-received` indicates an MO message from a Bandwidth user's client to a Bandwidth number. - `request-location-response` indicates a response to a location request sent by the Bandwidth user's client after receiving an RBM message. - `suggestion-response` indicates a response to a suggestion sent by the Bandwidth user's client after receiving an RBM message. */ @JsonAdapter(InboundCallbackTypeEnum.Adapter.class) public enum InboundCallbackTypeEnum { diff --git a/src/main/java/com/bandwidth/sdk/model/ListEndpointsResponse.java b/src/main/java/com/bandwidth/sdk/model/ListEndpointsResponse.java index b343746a..ceba96e9 100644 --- a/src/main/java/com/bandwidth/sdk/model/ListEndpointsResponse.java +++ b/src/main/java/com/bandwidth/sdk/model/ListEndpointsResponse.java @@ -16,8 +16,8 @@ import java.util.Objects; import java.util.Locale; import com.bandwidth.sdk.model.Endpoints; -import com.bandwidth.sdk.model.Error1; -import com.bandwidth.sdk.model.Link1; +import com.bandwidth.sdk.model.Error; +import com.bandwidth.sdk.model.Link; import com.bandwidth.sdk.model.Page; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; @@ -61,7 +61,7 @@ public class ListEndpointsResponse { public static final String SERIALIZED_NAME_LINKS = "links"; @SerializedName(SERIALIZED_NAME_LINKS) @javax.annotation.Nonnull - private List links = new ArrayList<>(); + private List links = new ArrayList<>(); public static final String SERIALIZED_NAME_PAGE = "page"; @SerializedName(SERIALIZED_NAME_PAGE) @@ -76,17 +76,17 @@ public class ListEndpointsResponse { public static final String SERIALIZED_NAME_ERRORS = "errors"; @SerializedName(SERIALIZED_NAME_ERRORS) @javax.annotation.Nonnull - private List errors = new ArrayList<>(); + private List errors = new ArrayList<>(); public ListEndpointsResponse() { } - public ListEndpointsResponse links(@javax.annotation.Nonnull List links) { + public ListEndpointsResponse links(@javax.annotation.Nonnull List links) { this.links = links; return this; } - public ListEndpointsResponse addLinksItem(Link1 linksItem) { + public ListEndpointsResponse addLinksItem(Link linksItem) { if (this.links == null) { this.links = new ArrayList<>(); } @@ -99,11 +99,11 @@ public ListEndpointsResponse addLinksItem(Link1 linksItem) { * @return links */ @javax.annotation.Nonnull - public List getLinks() { + public List getLinks() { return links; } - public void setLinks(@javax.annotation.Nonnull List links) { + public void setLinks(@javax.annotation.Nonnull List links) { this.links = links; } @@ -154,12 +154,12 @@ public void setData(@javax.annotation.Nonnull List data) { } - public ListEndpointsResponse errors(@javax.annotation.Nonnull List errors) { + public ListEndpointsResponse errors(@javax.annotation.Nonnull List errors) { this.errors = errors; return this; } - public ListEndpointsResponse addErrorsItem(Error1 errorsItem) { + public ListEndpointsResponse addErrorsItem(Error errorsItem) { if (this.errors == null) { this.errors = new ArrayList<>(); } @@ -172,11 +172,11 @@ public ListEndpointsResponse addErrorsItem(Error1 errorsItem) { * @return errors */ @javax.annotation.Nonnull - public List getErrors() { + public List getErrors() { return errors; } - public void setErrors(@javax.annotation.Nonnull List errors) { + public void setErrors(@javax.annotation.Nonnull List errors) { this.errors = errors; } @@ -311,7 +311,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti JsonArray jsonArraylinks = jsonObj.getAsJsonArray("links"); // validate the required field `links` (array) for (int i = 0; i < jsonArraylinks.size(); i++) { - Link1.validateJsonElement(jsonArraylinks.get(i)); + Link.validateJsonElement(jsonArraylinks.get(i)); }; // validate the optional field `page` if (jsonObj.get("page") != null && !jsonObj.get("page").isJsonNull()) { @@ -335,7 +335,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); // validate the required field `errors` (array) for (int i = 0; i < jsonArrayerrors.size(); i++) { - Error1.validateJsonElement(jsonArrayerrors.get(i)); + Error.validateJsonElement(jsonArrayerrors.get(i)); }; } diff --git a/src/main/java/com/bandwidth/sdk/model/LookupResult.java b/src/main/java/com/bandwidth/sdk/model/LookupResult.java index eaec460e..65fc7a99 100644 --- a/src/main/java/com/bandwidth/sdk/model/LookupResult.java +++ b/src/main/java/com/bandwidth/sdk/model/LookupResult.java @@ -291,7 +291,7 @@ public LookupResult initialMessageDeliveryStatusDate(@javax.annotation.Nullable } /** - * [DNI-Only](#section/DNI-Only). The date the phone number entered the status described in `latestMessageDeliveryStatus`. Think of this as the \"start time\" for that status. Value resets every time the `latestMessageDeliveryStatus` changes. + * [DNI-Only](#section/DNI-Only). The date the phone number entered the status described in `latestMessageDeliveryStatus`. Think of this as the \"start time\" for that status. Value resets every time the `latestMessageDeliveryStatus` changes. * @return initialMessageDeliveryStatusDate */ @javax.annotation.Nullable @@ -310,7 +310,7 @@ public LookupResult latestMessageDeliveryStatusDate(@javax.annotation.Nullable L } /** - * [DNI-Only](#section/DNI-Only). The date bandwidth last received delivery status information for this phone number. Use this field to understand how up-to-date the `latestMessageDeliveryStatus` is. Value resets every time the `latestMessageDeliveryStatus` changes. + * [DNI-Only](#section/DNI-Only). The date bandwidth last received delivery status information for this phone number. Use this field to understand how up-to-date the `latestMessageDeliveryStatus` is. Value resets every time the `latestMessageDeliveryStatus` changes. * @return latestMessageDeliveryStatusDate */ @javax.annotation.Nullable diff --git a/src/main/java/com/bandwidth/sdk/model/MachineDetectionConfiguration.java b/src/main/java/com/bandwidth/sdk/model/MachineDetectionConfiguration.java index 0b46bbae..4adad0ce 100644 --- a/src/main/java/com/bandwidth/sdk/model/MachineDetectionConfiguration.java +++ b/src/main/java/com/bandwidth/sdk/model/MachineDetectionConfiguration.java @@ -235,7 +235,7 @@ public MachineDetectionConfiguration machineSpeechEndThreshold(@javax.annotation } /** - * When an answering machine is detected, the amount of silence (in seconds) before assuming the message has finished playing. If not provided it will default to the speechEndThreshold value. + * When an answering machine is detected, the amount of silence (in seconds) before assuming the message has finished playing. If not provided it will default to the speechEndThreshold value. * @return machineSpeechEndThreshold */ @javax.annotation.Nullable diff --git a/src/main/java/com/bandwidth/sdk/model/MessageRequest.java b/src/main/java/com/bandwidth/sdk/model/MessageRequest.java index 420bda03..f3515fcf 100644 --- a/src/main/java/com/bandwidth/sdk/model/MessageRequest.java +++ b/src/main/java/com/bandwidth/sdk/model/MessageRequest.java @@ -154,7 +154,7 @@ public MessageRequest from(@javax.annotation.Nonnull String from) { } /** - * Either an alphanumeric sender ID or the sender's Bandwidth phone number in E.164 format, which must be hosted within Bandwidth and linked to the account that is generating the message. Alphanumeric Sender IDs can contain up to 11 characters, upper-case letters A-Z, lower-case letters a-z, numbers 0-9, space, hyphen -, plus +, underscore _ and ampersand &. Alphanumeric Sender IDs must contain at least one letter. + * Either an alphanumeric sender ID or the sender's Bandwidth phone number in E.164 format, which must be hosted within Bandwidth and linked to the account that is generating the message. Alphanumeric Sender IDs can contain up to 11 characters, upper-case letters A-Z, lower-case letters a-z, numbers 0-9, space, hyphen -, plus +, underscore _ and ampersand &. Alphanumeric Sender IDs must contain at least one letter. * @return from */ @javax.annotation.Nonnull diff --git a/src/main/java/com/bandwidth/sdk/model/RbmOpenUrlEnum.java b/src/main/java/com/bandwidth/sdk/model/RbmOpenUrlEnum.java index a5749e75..ebad86e5 100644 --- a/src/main/java/com/bandwidth/sdk/model/RbmOpenUrlEnum.java +++ b/src/main/java/com/bandwidth/sdk/model/RbmOpenUrlEnum.java @@ -26,7 +26,7 @@ import com.google.gson.stream.JsonWriter; /** - * Specifies how the URL should be opened on a mobile device. - `BROWSER` Opens the URL in the device's default browser. If application is not set or the device doesn’t support WebView, this option is used by default. - `WEBVIEW` Opens the URL in an in-app WebView. + * Specifies how the URL should be opened on a mobile device. - `BROWSER` Opens the URL in the device's default browser. If application is not set or the device doesn’t support WebView, this option is used by default. - `WEBVIEW` Opens the URL in an in-app WebView. */ @JsonAdapter(RbmOpenUrlEnum.Adapter.class) public enum RbmOpenUrlEnum { diff --git a/src/main/java/com/bandwidth/sdk/model/RbmWebViewEnum.java b/src/main/java/com/bandwidth/sdk/model/RbmWebViewEnum.java index 882b76fd..66d6526a 100644 --- a/src/main/java/com/bandwidth/sdk/model/RbmWebViewEnum.java +++ b/src/main/java/com/bandwidth/sdk/model/RbmWebViewEnum.java @@ -26,7 +26,7 @@ import com.google.gson.stream.JsonWriter; /** - * Defines the layout of the WebView on a mobile device. It must be defined when application is set to `WEBVIEW` - `FULL` WebView takes the full screen. - `HALF` WebView takes half of the screen. - `TALL` WebView takes three-quarters of the screen. + * Defines the layout of the WebView on a mobile device. It must be defined when application is set to `WEBVIEW` - `FULL` WebView takes the full screen. - `HALF` WebView takes half of the screen. - `TALL` WebView takes three-quarters of the screen. */ @JsonAdapter(RbmWebViewEnum.Adapter.class) public enum RbmWebViewEnum { diff --git a/src/main/java/com/bandwidth/sdk/model/StatusCallback.java b/src/main/java/com/bandwidth/sdk/model/StatusCallback.java index f0ac27a2..d3c67ac6 100644 --- a/src/main/java/com/bandwidth/sdk/model/StatusCallback.java +++ b/src/main/java/com/bandwidth/sdk/model/StatusCallback.java @@ -237,7 +237,7 @@ public StatusCallback carrierName(@javax.annotation.Nullable String carrierName) } /** - * The name of the Authorized Message Provider (AMP) that handled this message. In the US, this is the carrier that the message was sent to. This field is present only when this account feature has been enabled. + * The name of the Authorized Message Provider (AMP) that handled this message. In the US, this is the carrier that the message was sent to. This field is present only when this account feature has been enabled. * @return carrierName */ @javax.annotation.Nullable From a8d2580dd450808b61b5836e21d77182807fa38f Mon Sep 17 00:00:00 2001 From: Sudhanshu Moghe Date: Mon, 16 Mar 2026 14:22:15 -0400 Subject: [PATCH 4/7] Add unit tests for endpoint models and enums --- .../models/CreateEndpointRequestBaseTest.java | 84 ++++++++++++ .../CreateEndpointResponseDataTest.java | 115 +++++++++++++++++ .../CreateEndpointResponseObjectTest.java | 115 +++++++++++++++++ .../models/CreateEndpointResponseTest.java | 69 ++++++++++ .../models/EndpointDirectionEnumTest.java | 36 ++++++ .../sdk/unit/models/EndpointEventTest.java | 122 ++++++++++++++++++ .../models/EndpointEventTypeEnumTest.java | 35 +++++ .../sdk/unit/models/EndpointResponseTest.java | 69 ++++++++++ .../unit/models/EndpointStatusEnumTest.java | 35 +++++ .../sdk/unit/models/EndpointTest.java | 106 +++++++++++++++ .../sdk/unit/models/EndpointTypeEnumTest.java | 34 +++++ .../sdk/unit/models/EndpointsTest.java | 93 +++++++++++++ .../models/ListEndpointsResponseTest.java | 79 ++++++++++++ 13 files changed, 992 insertions(+) create mode 100644 src/test/java/com/bandwidth/sdk/unit/models/CreateEndpointRequestBaseTest.java create mode 100644 src/test/java/com/bandwidth/sdk/unit/models/CreateEndpointResponseDataTest.java create mode 100644 src/test/java/com/bandwidth/sdk/unit/models/CreateEndpointResponseObjectTest.java create mode 100644 src/test/java/com/bandwidth/sdk/unit/models/CreateEndpointResponseTest.java create mode 100644 src/test/java/com/bandwidth/sdk/unit/models/EndpointDirectionEnumTest.java create mode 100644 src/test/java/com/bandwidth/sdk/unit/models/EndpointEventTest.java create mode 100644 src/test/java/com/bandwidth/sdk/unit/models/EndpointEventTypeEnumTest.java create mode 100644 src/test/java/com/bandwidth/sdk/unit/models/EndpointResponseTest.java create mode 100644 src/test/java/com/bandwidth/sdk/unit/models/EndpointStatusEnumTest.java create mode 100644 src/test/java/com/bandwidth/sdk/unit/models/EndpointTest.java create mode 100644 src/test/java/com/bandwidth/sdk/unit/models/EndpointTypeEnumTest.java create mode 100644 src/test/java/com/bandwidth/sdk/unit/models/EndpointsTest.java create mode 100644 src/test/java/com/bandwidth/sdk/unit/models/ListEndpointsResponseTest.java diff --git a/src/test/java/com/bandwidth/sdk/unit/models/CreateEndpointRequestBaseTest.java b/src/test/java/com/bandwidth/sdk/unit/models/CreateEndpointRequestBaseTest.java new file mode 100644 index 00000000..71956995 --- /dev/null +++ b/src/test/java/com/bandwidth/sdk/unit/models/CreateEndpointRequestBaseTest.java @@ -0,0 +1,84 @@ +/* + * Bandwidth + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.bandwidth.sdk.unit.models; + +import org.junit.jupiter.api.Test; + +import java.net.URI; +import com.bandwidth.sdk.model.CreateEndpointRequestBase; +import com.bandwidth.sdk.model.EndpointTypeEnum; +import com.bandwidth.sdk.model.EndpointDirectionEnum; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.CoreMatchers.instanceOf; + +/** + * Model tests for CreateEndpointRequestBase + */ +public class CreateEndpointRequestBaseTest { + private final CreateEndpointRequestBase model = new CreateEndpointRequestBase() + .type(EndpointTypeEnum.WEBRTC) + .direction(EndpointDirectionEnum.INBOUND) + .eventCallbackUrl(URI.create("https://example.com/callback")) + .eventFallbackUrl(URI.create("https://example.com/fallback")) + .tag("tag"); + + /** + * Model tests for CreateEndpointRequestBase + */ + @Test + public void testCreateEndpointRequestBase() { + assertThat(model, instanceOf(CreateEndpointRequestBase.class)); + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + assertThat(model.getType(), instanceOf(EndpointTypeEnum.class)); + } + + /** + * Test the property 'direction' + */ + @Test + public void directionTest() { + assertThat(model.getDirection(), instanceOf(EndpointDirectionEnum.class)); + } + + /** + * Test the property 'eventCallbackUrl' + */ + @Test + public void eventCallbackUrlTest() { + assertThat(model.getEventCallbackUrl(), instanceOf(URI.class)); + } + + /** + * Test the property 'eventFallbackUrl' + */ + @Test + public void eventFallbackUrlTest() { + assertThat(model.getEventFallbackUrl(), instanceOf(URI.class)); + } + + /** + * Test the property 'tag' + */ + @Test + public void tagTest() { + assertThat(model.getTag(), instanceOf(String.class)); + } + +} diff --git a/src/test/java/com/bandwidth/sdk/unit/models/CreateEndpointResponseDataTest.java b/src/test/java/com/bandwidth/sdk/unit/models/CreateEndpointResponseDataTest.java new file mode 100644 index 00000000..ed05418f --- /dev/null +++ b/src/test/java/com/bandwidth/sdk/unit/models/CreateEndpointResponseDataTest.java @@ -0,0 +1,115 @@ +/* + * Bandwidth + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.bandwidth.sdk.unit.models; + +import org.junit.jupiter.api.Test; + +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Arrays; +import java.util.ArrayList; +import com.bandwidth.sdk.model.CreateEndpointResponseData; +import com.bandwidth.sdk.model.EndpointTypeEnum; +import com.bandwidth.sdk.model.EndpointStatusEnum; +import com.bandwidth.sdk.model.Device; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.CoreMatchers.instanceOf; + +/** + * Model tests for CreateEndpointResponseData + */ +public class CreateEndpointResponseDataTest { + private final CreateEndpointResponseData model = new CreateEndpointResponseData() + .endpointId("endpointId") + .type(EndpointTypeEnum.WEBRTC) + .status(EndpointStatusEnum.CONNECTED) + .creationTimestamp(OffsetDateTime.now()) + .expirationTimestamp(OffsetDateTime.now()) + .tag("tag") + .devices(new ArrayList(Arrays.asList(new Device()))) + .token("token"); + + /** + * Model tests for CreateEndpointResponseData + */ + @Test + public void testCreateEndpointResponseData() { + assertThat(model, instanceOf(CreateEndpointResponseData.class)); + } + + /** + * Test the property 'endpointId' + */ + @Test + public void endpointIdTest() { + assertThat(model.getEndpointId(), instanceOf(String.class)); + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + assertThat(model.getType(), instanceOf(EndpointTypeEnum.class)); + } + + /** + * Test the property 'status' + */ + @Test + public void statusTest() { + assertThat(model.getStatus(), instanceOf(EndpointStatusEnum.class)); + } + + /** + * Test the property 'creationTimestamp' + */ + @Test + public void creationTimestampTest() { + assertThat(model.getCreationTimestamp(), instanceOf(OffsetDateTime.class)); + } + + /** + * Test the property 'expirationTimestamp' + */ + @Test + public void expirationTimestampTest() { + assertThat(model.getExpirationTimestamp(), instanceOf(OffsetDateTime.class)); + } + + /** + * Test the property 'tag' + */ + @Test + public void tagTest() { + assertThat(model.getTag(), instanceOf(String.class)); + } + + /** + * Test the property 'devices' + */ + @Test + public void devicesTest() { + assertThat(model.getDevices(), instanceOf(List.class)); + } + + /** + * Test the property 'token' + */ + @Test + public void tokenTest() { + assertThat(model.getToken(), instanceOf(String.class)); + } + +} diff --git a/src/test/java/com/bandwidth/sdk/unit/models/CreateEndpointResponseObjectTest.java b/src/test/java/com/bandwidth/sdk/unit/models/CreateEndpointResponseObjectTest.java new file mode 100644 index 00000000..d3be488f --- /dev/null +++ b/src/test/java/com/bandwidth/sdk/unit/models/CreateEndpointResponseObjectTest.java @@ -0,0 +1,115 @@ +/* + * Bandwidth + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.bandwidth.sdk.unit.models; + +import org.junit.jupiter.api.Test; + +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Arrays; +import java.util.ArrayList; +import com.bandwidth.sdk.model.CreateEndpointResponseObject; +import com.bandwidth.sdk.model.EndpointTypeEnum; +import com.bandwidth.sdk.model.EndpointStatusEnum; +import com.bandwidth.sdk.model.Device; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.CoreMatchers.instanceOf; + +/** + * Model tests for CreateEndpointResponseObject + */ +public class CreateEndpointResponseObjectTest { + private final CreateEndpointResponseObject model = new CreateEndpointResponseObject() + .endpointId("endpointId") + .type(EndpointTypeEnum.WEBRTC) + .status(EndpointStatusEnum.CONNECTED) + .creationTimestamp(OffsetDateTime.now()) + .expirationTimestamp(OffsetDateTime.now()) + .tag("tag") + .devices(new ArrayList(Arrays.asList(new Device()))) + .token("token"); + + /** + * Model tests for CreateEndpointResponseObject + */ + @Test + public void testCreateEndpointResponseObject() { + assertThat(model, instanceOf(CreateEndpointResponseObject.class)); + } + + /** + * Test the property 'endpointId' + */ + @Test + public void endpointIdTest() { + assertThat(model.getEndpointId(), instanceOf(String.class)); + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + assertThat(model.getType(), instanceOf(EndpointTypeEnum.class)); + } + + /** + * Test the property 'status' + */ + @Test + public void statusTest() { + assertThat(model.getStatus(), instanceOf(EndpointStatusEnum.class)); + } + + /** + * Test the property 'creationTimestamp' + */ + @Test + public void creationTimestampTest() { + assertThat(model.getCreationTimestamp(), instanceOf(OffsetDateTime.class)); + } + + /** + * Test the property 'expirationTimestamp' + */ + @Test + public void expirationTimestampTest() { + assertThat(model.getExpirationTimestamp(), instanceOf(OffsetDateTime.class)); + } + + /** + * Test the property 'tag' + */ + @Test + public void tagTest() { + assertThat(model.getTag(), instanceOf(String.class)); + } + + /** + * Test the property 'devices' + */ + @Test + public void devicesTest() { + assertThat(model.getDevices(), instanceOf(List.class)); + } + + /** + * Test the property 'token' + */ + @Test + public void tokenTest() { + assertThat(model.getToken(), instanceOf(String.class)); + } + +} diff --git a/src/test/java/com/bandwidth/sdk/unit/models/CreateEndpointResponseTest.java b/src/test/java/com/bandwidth/sdk/unit/models/CreateEndpointResponseTest.java new file mode 100644 index 00000000..22cf38e6 --- /dev/null +++ b/src/test/java/com/bandwidth/sdk/unit/models/CreateEndpointResponseTest.java @@ -0,0 +1,69 @@ +/* + * Bandwidth + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.bandwidth.sdk.unit.models; + +import org.junit.jupiter.api.Test; + +import java.util.List; +import java.util.Arrays; +import java.util.ArrayList; +import com.bandwidth.sdk.model.CreateEndpointResponse; +import com.bandwidth.sdk.model.CreateEndpointResponseData; +import com.bandwidth.sdk.model.Link; +import com.bandwidth.sdk.model.Error; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.CoreMatchers.instanceOf; + +/** + * Model tests for CreateEndpointResponse + */ +public class CreateEndpointResponseTest { + private final CreateEndpointResponse model = new CreateEndpointResponse() + .links(new ArrayList(Arrays.asList(new Link()))) + .data(new CreateEndpointResponseData()) + .errors(new ArrayList(Arrays.asList(new Error()))); + + /** + * Model tests for CreateEndpointResponse + */ + @Test + public void testCreateEndpointResponse() { + assertThat(model, instanceOf(CreateEndpointResponse.class)); + } + + /** + * Test the property 'links' + */ + @Test + public void linksTest() { + assertThat(model.getLinks(), instanceOf(List.class)); + } + + /** + * Test the property 'data' + */ + @Test + public void dataTest() { + assertThat(model.getData(), instanceOf(CreateEndpointResponseData.class)); + } + + /** + * Test the property 'errors' + */ + @Test + public void errorsTest() { + assertThat(model.getErrors(), instanceOf(List.class)); + } + +} diff --git a/src/test/java/com/bandwidth/sdk/unit/models/EndpointDirectionEnumTest.java b/src/test/java/com/bandwidth/sdk/unit/models/EndpointDirectionEnumTest.java new file mode 100644 index 00000000..e6977adb --- /dev/null +++ b/src/test/java/com/bandwidth/sdk/unit/models/EndpointDirectionEnumTest.java @@ -0,0 +1,36 @@ +/* + * Bandwidth + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.bandwidth.sdk.unit.models; + +import org.junit.jupiter.api.Test; + +import com.bandwidth.sdk.model.EndpointDirectionEnum; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.CoreMatchers.equalTo; + +/** + * Model tests for EndpointDirectionEnum + */ +public class EndpointDirectionEnumTest { + /** + * Model tests for EndpointDirectionEnum + */ + @Test + public void testEndpointDirectionEnum() { + assertThat(EndpointDirectionEnum.INBOUND.toString(), equalTo("INBOUND")); + assertThat(EndpointDirectionEnum.OUTBOUND.toString(), equalTo("OUTBOUND")); + assertThat(EndpointDirectionEnum.BIDIRECTIONAL.toString(), equalTo("BIDIRECTIONAL")); + } + +} diff --git a/src/test/java/com/bandwidth/sdk/unit/models/EndpointEventTest.java b/src/test/java/com/bandwidth/sdk/unit/models/EndpointEventTest.java new file mode 100644 index 00000000..a3ef493d --- /dev/null +++ b/src/test/java/com/bandwidth/sdk/unit/models/EndpointEventTest.java @@ -0,0 +1,122 @@ +/* + * Bandwidth + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.bandwidth.sdk.unit.models; + +import org.junit.jupiter.api.Test; + +import java.time.OffsetDateTime; +import com.bandwidth.sdk.model.EndpointEvent; +import com.bandwidth.sdk.model.EndpointTypeEnum; +import com.bandwidth.sdk.model.EndpointStatusEnum; +import com.bandwidth.sdk.model.EndpointEventTypeEnum; +import com.bandwidth.sdk.model.Device; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.CoreMatchers.instanceOf; + +/** + * Model tests for EndpointEvent + */ +public class EndpointEventTest { + private final EndpointEvent model = new EndpointEvent() + .endpointId("endpointId") + .type(EndpointTypeEnum.WEBRTC) + .status(EndpointStatusEnum.CONNECTED) + .creationTimestamp(OffsetDateTime.now()) + .expirationTimestamp(OffsetDateTime.now()) + .tag("tag") + .eventTime(OffsetDateTime.now()) + .eventType(EndpointEventTypeEnum.DEVICE_CONNECTED) + .device(new Device()); + + /** + * Model tests for EndpointEvent + */ + @Test + public void testEndpointEvent() { + assertThat(model, instanceOf(EndpointEvent.class)); + } + + /** + * Test the property 'endpointId' + */ + @Test + public void endpointIdTest() { + assertThat(model.getEndpointId(), instanceOf(String.class)); + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + assertThat(model.getType(), instanceOf(EndpointTypeEnum.class)); + } + + /** + * Test the property 'status' + */ + @Test + public void statusTest() { + assertThat(model.getStatus(), instanceOf(EndpointStatusEnum.class)); + } + + /** + * Test the property 'creationTimestamp' + */ + @Test + public void creationTimestampTest() { + assertThat(model.getCreationTimestamp(), instanceOf(OffsetDateTime.class)); + } + + /** + * Test the property 'expirationTimestamp' + */ + @Test + public void expirationTimestampTest() { + assertThat(model.getExpirationTimestamp(), instanceOf(OffsetDateTime.class)); + } + + /** + * Test the property 'tag' + */ + @Test + public void tagTest() { + assertThat(model.getTag(), instanceOf(String.class)); + } + + /** + * Test the property 'eventTime' + */ + @Test + public void eventTimeTest() { + assertThat(model.getEventTime(), instanceOf(OffsetDateTime.class)); + } + + /** + * Test the property 'eventType' + */ + @Test + public void eventTypeTest() { + assertThat(model.getEventType(), instanceOf(EndpointEventTypeEnum.class)); + } + + /** + * Test the property 'device' + */ + @Test + public void deviceTest() { + assertThat(model.getDevice(), instanceOf(Device.class)); + } + +} diff --git a/src/test/java/com/bandwidth/sdk/unit/models/EndpointEventTypeEnumTest.java b/src/test/java/com/bandwidth/sdk/unit/models/EndpointEventTypeEnumTest.java new file mode 100644 index 00000000..813b17e8 --- /dev/null +++ b/src/test/java/com/bandwidth/sdk/unit/models/EndpointEventTypeEnumTest.java @@ -0,0 +1,35 @@ +/* + * Bandwidth + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.bandwidth.sdk.unit.models; + +import org.junit.jupiter.api.Test; + +import com.bandwidth.sdk.model.EndpointEventTypeEnum; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.CoreMatchers.equalTo; + +/** + * Model tests for EndpointEventTypeEnum + */ +public class EndpointEventTypeEnumTest { + /** + * Model tests for EndpointEventTypeEnum + */ + @Test + public void testEndpointEventTypeEnum() { + assertThat(EndpointEventTypeEnum.DEVICE_CONNECTED.toString(), equalTo("DEVICE_CONNECTED")); + assertThat(EndpointEventTypeEnum.DEVICE_DISCONNECTED.toString(), equalTo("DEVICE_DISCONNECTED")); + } + +} diff --git a/src/test/java/com/bandwidth/sdk/unit/models/EndpointResponseTest.java b/src/test/java/com/bandwidth/sdk/unit/models/EndpointResponseTest.java new file mode 100644 index 00000000..a4c268dc --- /dev/null +++ b/src/test/java/com/bandwidth/sdk/unit/models/EndpointResponseTest.java @@ -0,0 +1,69 @@ +/* + * Bandwidth + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.bandwidth.sdk.unit.models; + +import org.junit.jupiter.api.Test; + +import java.util.List; +import java.util.Arrays; +import java.util.ArrayList; +import com.bandwidth.sdk.model.EndpointResponse; +import com.bandwidth.sdk.model.Endpoint; +import com.bandwidth.sdk.model.Link; +import com.bandwidth.sdk.model.Error; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.CoreMatchers.instanceOf; + +/** + * Model tests for EndpointResponse + */ +public class EndpointResponseTest { + private final EndpointResponse model = new EndpointResponse() + .links(new ArrayList(Arrays.asList(new Link()))) + .data(new Endpoint()) + .errors(new ArrayList(Arrays.asList(new Error()))); + + /** + * Model tests for EndpointResponse + */ + @Test + public void testEndpointResponse() { + assertThat(model, instanceOf(EndpointResponse.class)); + } + + /** + * Test the property 'links' + */ + @Test + public void linksTest() { + assertThat(model.getLinks(), instanceOf(List.class)); + } + + /** + * Test the property 'data' + */ + @Test + public void dataTest() { + assertThat(model.getData(), instanceOf(Endpoint.class)); + } + + /** + * Test the property 'errors' + */ + @Test + public void errorsTest() { + assertThat(model.getErrors(), instanceOf(List.class)); + } + +} diff --git a/src/test/java/com/bandwidth/sdk/unit/models/EndpointStatusEnumTest.java b/src/test/java/com/bandwidth/sdk/unit/models/EndpointStatusEnumTest.java new file mode 100644 index 00000000..5e18b2a6 --- /dev/null +++ b/src/test/java/com/bandwidth/sdk/unit/models/EndpointStatusEnumTest.java @@ -0,0 +1,35 @@ +/* + * Bandwidth + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.bandwidth.sdk.unit.models; + +import org.junit.jupiter.api.Test; + +import com.bandwidth.sdk.model.EndpointStatusEnum; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.CoreMatchers.equalTo; + +/** + * Model tests for EndpointStatusEnum + */ +public class EndpointStatusEnumTest { + /** + * Model tests for EndpointStatusEnum + */ + @Test + public void testEndpointStatusEnum() { + assertThat(EndpointStatusEnum.CONNECTED.toString(), equalTo("CONNECTED")); + assertThat(EndpointStatusEnum.DISCONNECTED.toString(), equalTo("DISCONNECTED")); + } + +} diff --git a/src/test/java/com/bandwidth/sdk/unit/models/EndpointTest.java b/src/test/java/com/bandwidth/sdk/unit/models/EndpointTest.java new file mode 100644 index 00000000..b67f526f --- /dev/null +++ b/src/test/java/com/bandwidth/sdk/unit/models/EndpointTest.java @@ -0,0 +1,106 @@ +/* + * Bandwidth + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.bandwidth.sdk.unit.models; + +import org.junit.jupiter.api.Test; + +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Arrays; +import java.util.ArrayList; +import com.bandwidth.sdk.model.Endpoint; +import com.bandwidth.sdk.model.EndpointTypeEnum; +import com.bandwidth.sdk.model.EndpointStatusEnum; +import com.bandwidth.sdk.model.Device; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.CoreMatchers.instanceOf; + +/** + * Model tests for Endpoint + */ +public class EndpointTest { + private final Endpoint model = new Endpoint() + .endpointId("endpointId") + .type(EndpointTypeEnum.WEBRTC) + .status(EndpointStatusEnum.CONNECTED) + .creationTimestamp(OffsetDateTime.now()) + .expirationTimestamp(OffsetDateTime.now()) + .tag("tag") + .devices(new ArrayList(Arrays.asList(new Device()))); + + /** + * Model tests for Endpoint + */ + @Test + public void testEndpoint() { + assertThat(model, instanceOf(Endpoint.class)); + } + + /** + * Test the property 'endpointId' + */ + @Test + public void endpointIdTest() { + assertThat(model.getEndpointId(), instanceOf(String.class)); + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + assertThat(model.getType(), instanceOf(EndpointTypeEnum.class)); + } + + /** + * Test the property 'status' + */ + @Test + public void statusTest() { + assertThat(model.getStatus(), instanceOf(EndpointStatusEnum.class)); + } + + /** + * Test the property 'creationTimestamp' + */ + @Test + public void creationTimestampTest() { + assertThat(model.getCreationTimestamp(), instanceOf(OffsetDateTime.class)); + } + + /** + * Test the property 'expirationTimestamp' + */ + @Test + public void expirationTimestampTest() { + assertThat(model.getExpirationTimestamp(), instanceOf(OffsetDateTime.class)); + } + + /** + * Test the property 'tag' + */ + @Test + public void tagTest() { + assertThat(model.getTag(), instanceOf(String.class)); + } + + /** + * Test the property 'devices' + */ + @Test + public void devicesTest() { + assertThat(model.getDevices(), instanceOf(List.class)); + } + +} diff --git a/src/test/java/com/bandwidth/sdk/unit/models/EndpointTypeEnumTest.java b/src/test/java/com/bandwidth/sdk/unit/models/EndpointTypeEnumTest.java new file mode 100644 index 00000000..4c0c8256 --- /dev/null +++ b/src/test/java/com/bandwidth/sdk/unit/models/EndpointTypeEnumTest.java @@ -0,0 +1,34 @@ +/* + * Bandwidth + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.bandwidth.sdk.unit.models; + +import org.junit.jupiter.api.Test; + +import com.bandwidth.sdk.model.EndpointTypeEnum; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.CoreMatchers.equalTo; + +/** + * Model tests for EndpointTypeEnum + */ +public class EndpointTypeEnumTest { + /** + * Model tests for EndpointTypeEnum + */ + @Test + public void testEndpointTypeEnum() { + assertThat(EndpointTypeEnum.WEBRTC.toString(), equalTo("WEBRTC")); + } + +} diff --git a/src/test/java/com/bandwidth/sdk/unit/models/EndpointsTest.java b/src/test/java/com/bandwidth/sdk/unit/models/EndpointsTest.java new file mode 100644 index 00000000..99dd1f65 --- /dev/null +++ b/src/test/java/com/bandwidth/sdk/unit/models/EndpointsTest.java @@ -0,0 +1,93 @@ +/* + * Bandwidth + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.bandwidth.sdk.unit.models; + +import org.junit.jupiter.api.Test; + +import java.time.OffsetDateTime; +import com.bandwidth.sdk.model.Endpoints; +import com.bandwidth.sdk.model.EndpointTypeEnum; +import com.bandwidth.sdk.model.EndpointStatusEnum; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.CoreMatchers.instanceOf; + +/** + * Model tests for Endpoints + */ +public class EndpointsTest { + private final Endpoints model = new Endpoints() + .endpointId("endpointId") + .type(EndpointTypeEnum.WEBRTC) + .status(EndpointStatusEnum.CONNECTED) + .creationTimestamp(OffsetDateTime.now()) + .expirationTimestamp(OffsetDateTime.now()) + .tag("tag"); + + /** + * Model tests for Endpoints + */ + @Test + public void testEndpoints() { + assertThat(model, instanceOf(Endpoints.class)); + } + + /** + * Test the property 'endpointId' + */ + @Test + public void endpointIdTest() { + assertThat(model.getEndpointId(), instanceOf(String.class)); + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + assertThat(model.getType(), instanceOf(EndpointTypeEnum.class)); + } + + /** + * Test the property 'status' + */ + @Test + public void statusTest() { + assertThat(model.getStatus(), instanceOf(EndpointStatusEnum.class)); + } + + /** + * Test the property 'creationTimestamp' + */ + @Test + public void creationTimestampTest() { + assertThat(model.getCreationTimestamp(), instanceOf(OffsetDateTime.class)); + } + + /** + * Test the property 'expirationTimestamp' + */ + @Test + public void expirationTimestampTest() { + assertThat(model.getExpirationTimestamp(), instanceOf(OffsetDateTime.class)); + } + + /** + * Test the property 'tag' + */ + @Test + public void tagTest() { + assertThat(model.getTag(), instanceOf(String.class)); + } + +} diff --git a/src/test/java/com/bandwidth/sdk/unit/models/ListEndpointsResponseTest.java b/src/test/java/com/bandwidth/sdk/unit/models/ListEndpointsResponseTest.java new file mode 100644 index 00000000..9adc8de8 --- /dev/null +++ b/src/test/java/com/bandwidth/sdk/unit/models/ListEndpointsResponseTest.java @@ -0,0 +1,79 @@ +/* + * Bandwidth + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.bandwidth.sdk.unit.models; + +import org.junit.jupiter.api.Test; + +import java.util.List; +import java.util.Arrays; +import java.util.ArrayList; +import com.bandwidth.sdk.model.ListEndpointsResponse; +import com.bandwidth.sdk.model.Endpoints; +import com.bandwidth.sdk.model.Link; +import com.bandwidth.sdk.model.Error; +import com.bandwidth.sdk.model.Page; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.CoreMatchers.instanceOf; + +/** + * Model tests for ListEndpointsResponse + */ +public class ListEndpointsResponseTest { + private final ListEndpointsResponse model = new ListEndpointsResponse() + .links(new ArrayList(Arrays.asList(new Link()))) + .page(new Page()) + .data(new ArrayList(Arrays.asList(new Endpoints()))) + .errors(new ArrayList(Arrays.asList(new Error()))); + + /** + * Model tests for ListEndpointsResponse + */ + @Test + public void testListEndpointsResponse() { + assertThat(model, instanceOf(ListEndpointsResponse.class)); + } + + /** + * Test the property 'links' + */ + @Test + public void linksTest() { + assertThat(model.getLinks(), instanceOf(List.class)); + } + + /** + * Test the property 'page' + */ + @Test + public void pageTest() { + assertThat(model.getPage(), instanceOf(Page.class)); + } + + /** + * Test the property 'data' + */ + @Test + public void dataTest() { + assertThat(model.getData(), instanceOf(List.class)); + } + + /** + * Test the property 'errors' + */ + @Test + public void errorsTest() { + assertThat(model.getErrors(), instanceOf(List.class)); + } + +} From 576f572961fe8f3cbb1a9c8146581ff5c2ca2f06 Mon Sep 17 00:00:00 2001 From: Sudhanshu Moghe Date: Mon, 16 Mar 2026 14:33:20 -0400 Subject: [PATCH 5/7] Add unit tests for EndpointsApi functionality --- .../bandwidth/sdk/smoke/EndpointsApiTest.java | 158 ++++++++++++++++++ 1 file changed, 158 insertions(+) create mode 100644 src/test/java/com/bandwidth/sdk/smoke/EndpointsApiTest.java diff --git a/src/test/java/com/bandwidth/sdk/smoke/EndpointsApiTest.java b/src/test/java/com/bandwidth/sdk/smoke/EndpointsApiTest.java new file mode 100644 index 00000000..02667559 --- /dev/null +++ b/src/test/java/com/bandwidth/sdk/smoke/EndpointsApiTest.java @@ -0,0 +1,158 @@ +package com.bandwidth.sdk.smoke; + +import com.bandwidth.sdk.api.EndpointsApi; +import com.bandwidth.sdk.ApiResponse; +import com.bandwidth.sdk.ApiException; +import com.bandwidth.sdk.ApiClient; +import com.bandwidth.sdk.model.CreateWebRtcConnectionRequest; +import com.bandwidth.sdk.model.CreateEndpointResponse; +import com.bandwidth.sdk.model.EndpointResponse; +import com.bandwidth.sdk.model.Endpoints; +import com.bandwidth.sdk.model.EndpointDirectionEnum; +import com.bandwidth.sdk.model.EndpointStatusEnum; +import com.bandwidth.sdk.model.EndpointTypeEnum; +import com.bandwidth.sdk.model.ListEndpointsResponse; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.MethodOrderer; +import org.junit.jupiter.api.Order; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInstance; +import org.junit.jupiter.api.TestMethodOrder; +import org.junit.jupiter.api.Assertions; + +import java.util.List; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.CoreMatchers.instanceOf; +import static org.hamcrest.Matchers.is; +import static org.hamcrest.Matchers.notNullValue; +import static org.hamcrest.Matchers.hasSize; +import static org.hamcrest.beans.HasPropertyWithValue.hasProperty; + +import static com.bandwidth.sdk.utils.TestingEnvironmentVariables.*; + +@SuppressWarnings("null") +@TestMethodOrder(MethodOrderer.OrderAnnotation.class) +@TestInstance(TestInstance.Lifecycle.PER_CLASS) +public class EndpointsApiTest { + private static ApiClient oauthClient = new ApiClient(BW_CLIENT_ID, BW_CLIENT_SECRET, null); + public final EndpointsApi api = new EndpointsApi(oauthClient); + + private String endpointId; + + @Test + @Order(1) + public void shouldCreateNewEndpoint() throws ApiException { + CreateWebRtcConnectionRequest endpointBody = new CreateWebRtcConnectionRequest(); + endpointBody.setType(EndpointTypeEnum.WEBRTC); + endpointBody.setDirection(EndpointDirectionEnum.BIDIRECTIONAL); + + ApiResponse response = api.createEndpointWithHttpInfo(BW_ACCOUNT_ID, endpointBody); + + assertThat(response.getStatusCode(), is(201)); + assertThat(response.getData(), notNullValue()); + assertThat(response.getData().getData(), notNullValue()); + assertThat(response.getData().getData(), hasProperty("endpointId", is(instanceOf(String.class)))); + assertThat(response.getData().getData(), hasProperty("token", is(instanceOf(String.class)))); + assertThat(response.getData().getData(), hasProperty("type", is(EndpointTypeEnum.WEBRTC))); + assertThat(response.getData().getData(), hasProperty("status", notNullValue())); + assertThat(response.getData().getData(), hasProperty("creationTimestamp", notNullValue())); + assertThat(response.getData().getData(), hasProperty("expirationTimestamp", notNullValue())); + assertThat(response.getData().getErrors(), instanceOf(List.class)); + assertThat(response.getData().getErrors(), hasSize(0)); + + endpointId = response.getData().getData().getEndpointId(); + } + + @Test + @Order(2) + public void shouldListEndpointsForAccount() throws ApiException { + ApiResponse response = api.listEndpointsWithHttpInfo(BW_ACCOUNT_ID, null, null, null, null); + + assertThat(response.getStatusCode(), is(200)); + assertThat(response.getData(), notNullValue()); + assertThat(response.getData().getData(), instanceOf(List.class)); + assertThat(response.getData().getPage(), notNullValue()); + assertThat(response.getData().getPage().getTotalElements(), notNullValue()); + assertThat(response.getData().getErrors(), instanceOf(List.class)); + + Endpoints createdEndpoint = response.getData().getData().stream() + .filter(item -> item.getEndpointId().equals(endpointId)) + .findFirst() + .orElse(null); + + assertThat(createdEndpoint, notNullValue()); + assertThat(createdEndpoint, hasProperty("type", is(EndpointTypeEnum.WEBRTC))); + assertThat(createdEndpoint, hasProperty("status", notNullValue())); + assertThat(createdEndpoint, hasProperty("creationTimestamp", notNullValue())); + assertThat(createdEndpoint, hasProperty("expirationTimestamp", notNullValue())); + } + + @Test + @Order(3) + public void shouldListEndpointsFilteredByType() throws ApiException { + ApiResponse response = api.listEndpointsWithHttpInfo(BW_ACCOUNT_ID, EndpointTypeEnum.WEBRTC, null, null, null); + + assertThat(response.getStatusCode(), is(200)); + assertThat(response.getData().getData(), instanceOf(List.class)); + assertThat(response.getData().getErrors(), instanceOf(List.class)); + + if (response.getData().getData().size() > 0) { + boolean allWebRtc = response.getData().getData().stream() + .allMatch(item -> item.getType() == EndpointTypeEnum.WEBRTC); + assertThat(allWebRtc, is(true)); + } + } + + @Test + @Order(4) + public void shouldRetrieveDetailsOfSpecificEndpoint() throws ApiException { + ApiResponse response = api.getEndpointWithHttpInfo(BW_ACCOUNT_ID, endpointId); + + assertThat(response.getStatusCode(), is(200)); + assertThat(response.getData(), notNullValue()); + assertThat(response.getData().getErrors(), instanceOf(List.class)); + assertThat(response.getData().getErrors(), hasSize(0)); + assertThat(response.getData(), hasProperty("endpointId", is(endpointId))); + assertThat(response.getData(), hasProperty("type", is(EndpointTypeEnum.WEBRTC))); + assertThat(response.getData(), hasProperty("status", notNullValue())); + assertThat(response.getData(), hasProperty("creationTimestamp", notNullValue())); + assertThat(response.getData(), hasProperty("expirationTimestamp", notNullValue())); + } + + @Test + @Order(5) + public void shouldDeleteEndpoint() throws ApiException { + ApiResponse response = api.deleteEndpointWithHttpInfo(BW_ACCOUNT_ID, endpointId); + + assertThat(response.getStatusCode(), is(204)); + } + + @Test + public void shouldThrow401UnauthorizedWithInvalidCredentials() throws ApiException { + ApiClient badOauthClient = new ApiClient("invalid-client-id", "invalid-client-secret", null); + EndpointsApi endpointsApiBad = new EndpointsApi(badOauthClient); + + ApiException exception = Assertions.assertThrows(ApiException.class, + () -> endpointsApiBad.listEndpointsWithHttpInfo(BW_ACCOUNT_ID, null, null, null, null)); + + assertThat(exception.getCode(), is(401)); + } + + @Test + public void shouldThrow404NotFoundWithInvalidAccount() throws ApiException { + ApiException exception = Assertions.assertThrows(ApiException.class, + () -> api.listEndpointsWithHttpInfo("invalid-account-id", null, null, null, null)); + + assertThat(exception.getCode(), is(404)); + } + + @Test + public void shouldThrow404NotFoundForNonExistentEndpoint() throws ApiException { + ApiException exception = Assertions.assertThrows(ApiException.class, + () -> api.getEndpointWithHttpInfo(BW_ACCOUNT_ID, "does-not-exist")); + + assertThat(exception.getCode(), is(404)); + } +} From cced0d0122375d459dd14b0857b16cc9d3e54fd9 Mon Sep 17 00:00:00 2001 From: Sudhanshu Moghe Date: Mon, 16 Mar 2026 16:12:31 -0400 Subject: [PATCH 6/7] Refactor EndpointsApiTest to correct response data assertions and simplify unauthorized exception handling --- .../bandwidth/sdk/smoke/EndpointsApiTest.java | 20 ++++++++----------- 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/src/test/java/com/bandwidth/sdk/smoke/EndpointsApiTest.java b/src/test/java/com/bandwidth/sdk/smoke/EndpointsApiTest.java index 02667559..be698170 100644 --- a/src/test/java/com/bandwidth/sdk/smoke/EndpointsApiTest.java +++ b/src/test/java/com/bandwidth/sdk/smoke/EndpointsApiTest.java @@ -9,13 +9,10 @@ import com.bandwidth.sdk.model.EndpointResponse; import com.bandwidth.sdk.model.Endpoints; import com.bandwidth.sdk.model.EndpointDirectionEnum; -import com.bandwidth.sdk.model.EndpointStatusEnum; import com.bandwidth.sdk.model.EndpointTypeEnum; import com.bandwidth.sdk.model.ListEndpointsResponse; -import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.MethodOrderer; import org.junit.jupiter.api.Order; -import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInstance; import org.junit.jupiter.api.TestMethodOrder; @@ -114,11 +111,12 @@ public void shouldRetrieveDetailsOfSpecificEndpoint() throws ApiException { assertThat(response.getData(), notNullValue()); assertThat(response.getData().getErrors(), instanceOf(List.class)); assertThat(response.getData().getErrors(), hasSize(0)); - assertThat(response.getData(), hasProperty("endpointId", is(endpointId))); - assertThat(response.getData(), hasProperty("type", is(EndpointTypeEnum.WEBRTC))); - assertThat(response.getData(), hasProperty("status", notNullValue())); - assertThat(response.getData(), hasProperty("creationTimestamp", notNullValue())); - assertThat(response.getData(), hasProperty("expirationTimestamp", notNullValue())); + assertThat(response.getData().getData(), notNullValue()); + assertThat(response.getData().getData(), hasProperty("endpointId", is(endpointId))); + assertThat(response.getData().getData(), hasProperty("type", is(EndpointTypeEnum.WEBRTC))); + assertThat(response.getData().getData(), hasProperty("status", notNullValue())); + assertThat(response.getData().getData(), hasProperty("creationTimestamp", notNullValue())); + assertThat(response.getData().getData(), hasProperty("expirationTimestamp", notNullValue())); } @Test @@ -130,14 +128,12 @@ public void shouldDeleteEndpoint() throws ApiException { } @Test - public void shouldThrow401UnauthorizedWithInvalidCredentials() throws ApiException { + public void shouldThrow401UnauthorizedWithInvalidCredentials() { ApiClient badOauthClient = new ApiClient("invalid-client-id", "invalid-client-secret", null); EndpointsApi endpointsApiBad = new EndpointsApi(badOauthClient); - ApiException exception = Assertions.assertThrows(ApiException.class, + Assertions.assertThrows(ApiException.class, () -> endpointsApiBad.listEndpointsWithHttpInfo(BW_ACCOUNT_ID, null, null, null, null)); - - assertThat(exception.getCode(), is(401)); } @Test From 8bb50632800e5e917ba70d0b8c25142614e7ba7f Mon Sep 17 00:00:00 2001 From: Sudhanshu Moghe Date: Mon, 16 Mar 2026 16:23:17 -0400 Subject: [PATCH 7/7] Remove obsolete error and link documentation files --- docs/Error1.md | 17 - docs/Error1Source.md | 16 - docs/Link1.md | 25 -- .../java/com/bandwidth/sdk/model/Error1.java | 414 ------------------ .../com/bandwidth/sdk/model/Error1Source.java | 375 ---------------- .../java/com/bandwidth/sdk/model/Link1.java | 404 ----------------- 6 files changed, 1251 deletions(-) delete mode 100644 docs/Error1.md delete mode 100644 docs/Error1Source.md delete mode 100644 docs/Link1.md delete mode 100644 src/main/java/com/bandwidth/sdk/model/Error1.java delete mode 100644 src/main/java/com/bandwidth/sdk/model/Error1Source.java delete mode 100644 src/main/java/com/bandwidth/sdk/model/Link1.java diff --git a/docs/Error1.md b/docs/Error1.md deleted file mode 100644 index 60b9f5a6..00000000 --- a/docs/Error1.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# Error1 - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**id** | **UUID** | A unique identifier for the error. | | -|**type** | **String** | The type of error. | | -|**description** | **String** | A description of the error. | | -|**code** | **String** | A code that uniquely identifies the error. | | -|**source** | [**Error1Source**](Error1Source.md) | | [optional] | - - - diff --git a/docs/Error1Source.md b/docs/Error1Source.md deleted file mode 100644 index 4665f119..00000000 --- a/docs/Error1Source.md +++ /dev/null @@ -1,16 +0,0 @@ - - -# Error1Source - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**parameter** | **String** | The URI parameter that caused the error. | [optional] | -|**field** | **String** | The request body field that caused the error. | [optional] | -|**header** | **String** | The header that caused the error. | [optional] | -|**reference** | **String** | The resource ID or path to the resource (or non-existent resource) causing the error. | [optional] | - - - diff --git a/docs/Link1.md b/docs/Link1.md deleted file mode 100644 index e2023ab1..00000000 --- a/docs/Link1.md +++ /dev/null @@ -1,25 +0,0 @@ - - -# Link1 - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**href** | **String** | The full URL of the link. | [optional] | -|**rel** | **String** | The relationship of the link to the current resource. | [optional] | -|**method** | [**MethodEnum**](#MethodEnum) | The HTTP method to use when making the request. | [optional] | - - - -## Enum: MethodEnum - -| Name | Value | -|---- | -----| -| GET | "GET" | -| POST | "POST" | -| DELETE | "DELETE" | - - - diff --git a/src/main/java/com/bandwidth/sdk/model/Error1.java b/src/main/java/com/bandwidth/sdk/model/Error1.java deleted file mode 100644 index 0f1595f5..00000000 --- a/src/main/java/com/bandwidth/sdk/model/Error1.java +++ /dev/null @@ -1,414 +0,0 @@ -/* - * Bandwidth - * Bandwidth's Communication APIs - * - * The version of the OpenAPI document: 1.0.0 - * Contact: letstalk@bandwidth.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.bandwidth.sdk.model; - -import java.util.Objects; -import java.util.Locale; -import com.bandwidth.sdk.model.Error1Source; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; -import java.util.UUID; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.Locale; - -import com.bandwidth.sdk.JSON; - -/** - * Error1 - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0") -public class Error1 { - public static final String SERIALIZED_NAME_ID = "id"; - @SerializedName(SERIALIZED_NAME_ID) - @javax.annotation.Nonnull - private UUID id; - - public static final String SERIALIZED_NAME_TYPE = "type"; - @SerializedName(SERIALIZED_NAME_TYPE) - @javax.annotation.Nonnull - private String type; - - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - @javax.annotation.Nonnull - private String description; - - public static final String SERIALIZED_NAME_CODE = "code"; - @SerializedName(SERIALIZED_NAME_CODE) - @javax.annotation.Nonnull - private String code; - - public static final String SERIALIZED_NAME_SOURCE = "source"; - @SerializedName(SERIALIZED_NAME_SOURCE) - @javax.annotation.Nullable - private Error1Source source; - - public Error1() { - } - - public Error1 id(@javax.annotation.Nonnull UUID id) { - this.id = id; - return this; - } - - /** - * A unique identifier for the error. - * @return id - */ - @javax.annotation.Nonnull - public UUID getId() { - return id; - } - - public void setId(@javax.annotation.Nonnull UUID id) { - this.id = id; - } - - - public Error1 type(@javax.annotation.Nonnull String type) { - this.type = type; - return this; - } - - /** - * The type of error. - * @return type - */ - @javax.annotation.Nonnull - public String getType() { - return type; - } - - public void setType(@javax.annotation.Nonnull String type) { - this.type = type; - } - - - public Error1 description(@javax.annotation.Nonnull String description) { - this.description = description; - return this; - } - - /** - * A description of the error. - * @return description - */ - @javax.annotation.Nonnull - public String getDescription() { - return description; - } - - public void setDescription(@javax.annotation.Nonnull String description) { - this.description = description; - } - - - public Error1 code(@javax.annotation.Nonnull String code) { - this.code = code; - return this; - } - - /** - * A code that uniquely identifies the error. - * @return code - */ - @javax.annotation.Nonnull - public String getCode() { - return code; - } - - public void setCode(@javax.annotation.Nonnull String code) { - this.code = code; - } - - - public Error1 source(@javax.annotation.Nullable Error1Source source) { - this.source = source; - return this; - } - - /** - * Get source - * @return source - */ - @javax.annotation.Nullable - public Error1Source getSource() { - return source; - } - - public void setSource(@javax.annotation.Nullable Error1Source source) { - this.source = source; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the Error1 instance itself - */ - public Error1 putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Error1 error1 = (Error1) o; - return Objects.equals(this.id, error1.id) && - Objects.equals(this.type, error1.type) && - Objects.equals(this.description, error1.description) && - Objects.equals(this.code, error1.code) && - Objects.equals(this.source, error1.source)&& - Objects.equals(this.additionalProperties, error1.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(id, type, description, code, source, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Error1 {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" code: ").append(toIndentedString(code)).append("\n"); - sb.append(" source: ").append(toIndentedString(source)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("id", "type", "description", "code", "source")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("id", "type", "description", "code")); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to Error1 - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!Error1.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in Error1 is not found in the empty JSON string", Error1.openapiRequiredFields.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Error1.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); - } - if (!jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); - } - if (!jsonObj.get("description").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); - } - if (!jsonObj.get("code").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("code").toString())); - } - // validate the optional field `source` - if (jsonObj.get("source") != null && !jsonObj.get("source").isJsonNull()) { - Error1Source.validateJsonElement(jsonObj.get("source")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Error1.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Error1' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(Error1.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, Error1 value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public Error1 read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - Error1 instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of Error1 given an JSON string - * - * @param jsonString JSON string - * @return An instance of Error1 - * @throws IOException if the JSON string is invalid with respect to Error1 - */ - public static Error1 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Error1.class); - } - - /** - * Convert an instance of Error1 to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/bandwidth/sdk/model/Error1Source.java b/src/main/java/com/bandwidth/sdk/model/Error1Source.java deleted file mode 100644 index d0bc96ac..00000000 --- a/src/main/java/com/bandwidth/sdk/model/Error1Source.java +++ /dev/null @@ -1,375 +0,0 @@ -/* - * Bandwidth - * Bandwidth's Communication APIs - * - * The version of the OpenAPI document: 1.0.0 - * Contact: letstalk@bandwidth.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.bandwidth.sdk.model; - -import java.util.Objects; -import java.util.Locale; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.Locale; - -import com.bandwidth.sdk.JSON; - -/** - * Error1Source - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0") -public class Error1Source { - public static final String SERIALIZED_NAME_PARAMETER = "parameter"; - @SerializedName(SERIALIZED_NAME_PARAMETER) - @javax.annotation.Nullable - private String parameter; - - public static final String SERIALIZED_NAME_FIELD = "field"; - @SerializedName(SERIALIZED_NAME_FIELD) - @javax.annotation.Nullable - private String field; - - public static final String SERIALIZED_NAME_HEADER = "header"; - @SerializedName(SERIALIZED_NAME_HEADER) - @javax.annotation.Nullable - private String header; - - public static final String SERIALIZED_NAME_REFERENCE = "reference"; - @SerializedName(SERIALIZED_NAME_REFERENCE) - @javax.annotation.Nullable - private String reference; - - public Error1Source() { - } - - public Error1Source parameter(@javax.annotation.Nullable String parameter) { - this.parameter = parameter; - return this; - } - - /** - * The URI parameter that caused the error. - * @return parameter - */ - @javax.annotation.Nullable - public String getParameter() { - return parameter; - } - - public void setParameter(@javax.annotation.Nullable String parameter) { - this.parameter = parameter; - } - - - public Error1Source field(@javax.annotation.Nullable String field) { - this.field = field; - return this; - } - - /** - * The request body field that caused the error. - * @return field - */ - @javax.annotation.Nullable - public String getField() { - return field; - } - - public void setField(@javax.annotation.Nullable String field) { - this.field = field; - } - - - public Error1Source header(@javax.annotation.Nullable String header) { - this.header = header; - return this; - } - - /** - * The header that caused the error. - * @return header - */ - @javax.annotation.Nullable - public String getHeader() { - return header; - } - - public void setHeader(@javax.annotation.Nullable String header) { - this.header = header; - } - - - public Error1Source reference(@javax.annotation.Nullable String reference) { - this.reference = reference; - return this; - } - - /** - * The resource ID or path to the resource (or non-existent resource) causing the error. - * @return reference - */ - @javax.annotation.Nullable - public String getReference() { - return reference; - } - - public void setReference(@javax.annotation.Nullable String reference) { - this.reference = reference; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the Error1Source instance itself - */ - public Error1Source putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Error1Source error1Source = (Error1Source) o; - return Objects.equals(this.parameter, error1Source.parameter) && - Objects.equals(this.field, error1Source.field) && - Objects.equals(this.header, error1Source.header) && - Objects.equals(this.reference, error1Source.reference)&& - Objects.equals(this.additionalProperties, error1Source.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(parameter, field, header, reference, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Error1Source {\n"); - sb.append(" parameter: ").append(toIndentedString(parameter)).append("\n"); - sb.append(" field: ").append(toIndentedString(field)).append("\n"); - sb.append(" header: ").append(toIndentedString(header)).append("\n"); - sb.append(" reference: ").append(toIndentedString(reference)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("parameter", "field", "header", "reference")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(0); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to Error1Source - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!Error1Source.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in Error1Source is not found in the empty JSON string", Error1Source.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("parameter") != null && !jsonObj.get("parameter").isJsonNull()) && !jsonObj.get("parameter").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `parameter` to be a primitive type in the JSON string but got `%s`", jsonObj.get("parameter").toString())); - } - if ((jsonObj.get("field") != null && !jsonObj.get("field").isJsonNull()) && !jsonObj.get("field").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `field` to be a primitive type in the JSON string but got `%s`", jsonObj.get("field").toString())); - } - if ((jsonObj.get("header") != null && !jsonObj.get("header").isJsonNull()) && !jsonObj.get("header").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `header` to be a primitive type in the JSON string but got `%s`", jsonObj.get("header").toString())); - } - if ((jsonObj.get("reference") != null && !jsonObj.get("reference").isJsonNull()) && !jsonObj.get("reference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `reference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("reference").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Error1Source.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Error1Source' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(Error1Source.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, Error1Source value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public Error1Source read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - Error1Source instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of Error1Source given an JSON string - * - * @param jsonString JSON string - * @return An instance of Error1Source - * @throws IOException if the JSON string is invalid with respect to Error1Source - */ - public static Error1Source fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Error1Source.class); - } - - /** - * Convert an instance of Error1Source to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/bandwidth/sdk/model/Link1.java b/src/main/java/com/bandwidth/sdk/model/Link1.java deleted file mode 100644 index 46428c5e..00000000 --- a/src/main/java/com/bandwidth/sdk/model/Link1.java +++ /dev/null @@ -1,404 +0,0 @@ -/* - * Bandwidth - * Bandwidth's Communication APIs - * - * The version of the OpenAPI document: 1.0.0 - * Contact: letstalk@bandwidth.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.bandwidth.sdk.model; - -import java.util.Objects; -import java.util.Locale; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.Locale; - -import com.bandwidth.sdk.JSON; - -/** - * Link1 - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0") -public class Link1 { - public static final String SERIALIZED_NAME_HREF = "href"; - @SerializedName(SERIALIZED_NAME_HREF) - @javax.annotation.Nullable - private String href; - - public static final String SERIALIZED_NAME_REL = "rel"; - @SerializedName(SERIALIZED_NAME_REL) - @javax.annotation.Nullable - private String rel; - - /** - * The HTTP method to use when making the request. - */ - @JsonAdapter(MethodEnum.Adapter.class) - public enum MethodEnum { - GET("GET"), - - POST("POST"), - - DELETE("DELETE"); - - private String value; - - MethodEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static MethodEnum fromValue(String value) { - for (MethodEnum b : MethodEnum.values()) { - if (b.value.equalsIgnoreCase(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final MethodEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public MethodEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return MethodEnum.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - MethodEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_METHOD = "method"; - @SerializedName(SERIALIZED_NAME_METHOD) - @javax.annotation.Nullable - private MethodEnum method; - - public Link1() { - } - - public Link1 href(@javax.annotation.Nullable String href) { - this.href = href; - return this; - } - - /** - * The full URL of the link. - * @return href - */ - @javax.annotation.Nullable - public String getHref() { - return href; - } - - public void setHref(@javax.annotation.Nullable String href) { - this.href = href; - } - - - public Link1 rel(@javax.annotation.Nullable String rel) { - this.rel = rel; - return this; - } - - /** - * The relationship of the link to the current resource. - * @return rel - */ - @javax.annotation.Nullable - public String getRel() { - return rel; - } - - public void setRel(@javax.annotation.Nullable String rel) { - this.rel = rel; - } - - - public Link1 method(@javax.annotation.Nullable MethodEnum method) { - this.method = method; - return this; - } - - /** - * The HTTP method to use when making the request. - * @return method - */ - @javax.annotation.Nullable - public MethodEnum getMethod() { - return method; - } - - public void setMethod(@javax.annotation.Nullable MethodEnum method) { - this.method = method; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * - * @param key name of the property - * @param value value of the property - * @return the Link1 instance itself - */ - public Link1 putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return a map of objects - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key name of the property - * @return an object - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Link1 link1 = (Link1) o; - return Objects.equals(this.href, link1.href) && - Objects.equals(this.rel, link1.rel) && - Objects.equals(this.method, link1.method)&& - Objects.equals(this.additionalProperties, link1.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(href, rel, method, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Link1 {\n"); - sb.append(" href: ").append(toIndentedString(href)).append("\n"); - sb.append(" rel: ").append(toIndentedString(rel)).append("\n"); - sb.append(" method: ").append(toIndentedString(method)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(Arrays.asList("href", "rel", "method")); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(0); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to Link1 - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!Link1.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in Link1 is not found in the empty JSON string", Link1.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("href") != null && !jsonObj.get("href").isJsonNull()) && !jsonObj.get("href").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `href` to be a primitive type in the JSON string but got `%s`", jsonObj.get("href").toString())); - } - if ((jsonObj.get("rel") != null && !jsonObj.get("rel").isJsonNull()) && !jsonObj.get("rel").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `rel` to be a primitive type in the JSON string but got `%s`", jsonObj.get("rel").toString())); - } - if ((jsonObj.get("method") != null && !jsonObj.get("method").isJsonNull()) && !jsonObj.get("method").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `method` to be a primitive type in the JSON string but got `%s`", jsonObj.get("method").toString())); - } - // validate the optional field `method` - if (jsonObj.get("method") != null && !jsonObj.get("method").isJsonNull()) { - MethodEnum.validateJsonElement(jsonObj.get("method")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Link1.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Link1' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(Link1.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, Link1 value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additional properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - JsonElement jsonElement = gson.toJsonTree(entry.getValue()); - if (jsonElement.isJsonArray()) { - obj.add(entry.getKey(), jsonElement.getAsJsonArray()); - } else { - obj.add(entry.getKey(), jsonElement.getAsJsonObject()); - } - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public Link1 read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // store additional fields in the deserialized instance - Link1 instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format(Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else if (entry.getValue().isJsonArray()) { - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); - } else { // JSON object - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of Link1 given an JSON string - * - * @param jsonString JSON string - * @return An instance of Link1 - * @throws IOException if the JSON string is invalid with respect to Link1 - */ - public static Link1 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Link1.class); - } - - /** - * Convert an instance of Link1 to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} -