From 5582429832db0d44f2dec100f1d621d6d0db5418 Mon Sep 17 00:00:00 2001 From: DX-Bandwidth Date: Tue, 28 Apr 2026 14:55:07 +0000 Subject: [PATCH] Generate SDK with OpenAPI Generator Version --- .openapi-generator/FILES | 50 +- README.md | 29 +- bandwidth.yml | 956 +++++++++++++++++- docs/BrtcError.md | 26 + docs/BrtcErrorResponse.md | 22 + docs/BrtcErrorSource.md | 24 + docs/BrtcLink.md | 22 + docs/CreateCall.md | 4 +- docs/CreateEndpointRequestBase.md | 26 + docs/CreateEndpointResponse.md | 22 + docs/CreateEndpointResponseData.md | 32 + docs/CreateWebRtcConnectionRequest.md | 28 + docs/Device.md | 24 + docs/DeviceStatusEnum.md | 15 + docs/Endpoint.md | 30 + docs/EndpointDirectionEnum.md | 15 + docs/EndpointEvent.md | 34 + docs/EndpointEventTypeEnum.md | 15 + docs/EndpointResponse.md | 22 + docs/EndpointStatusEnum.md | 15 + docs/EndpointTypeEnum.md | 15 + docs/Endpoints.md | 28 + docs/EndpointsApi.md | 395 ++++++++ docs/InboundCallback.md | 4 +- docs/ListEndpointsResponse.md | 24 + docs/LookupResult.md | 2 +- docs/MachineDetectionConfiguration.md | 2 +- docs/MessageRequest.md | 2 +- docs/Page.md | 24 + docs/RbmActionBase.md | 2 +- docs/RbmSuggestionResponse.md | 2 +- docs/SipConnectionMetadata.md | 24 + docs/SipCredentials.md | 20 + docs/StatusCallback.md | 2 +- docs/UpdateCall.md | 2 +- docs/WebhookSubscriptionError.md | 22 + docs/WebhookSubscriptionsListBody.md | 2 +- lib/bandwidth-sdk.rb | 25 +- lib/bandwidth-sdk/api/endpoints_api.rb | 397 ++++++++ lib/bandwidth-sdk/configuration.rb | 30 + lib/bandwidth-sdk/models/brtc_error.rb | 219 ++++ .../models/brtc_error_response.rb | 204 ++++ lib/bandwidth-sdk/models/brtc_error_source.rb | 176 ++++ lib/bandwidth-sdk/models/brtc_link.rb | 166 +++ lib/bandwidth-sdk/models/create_call.rb | 14 +- .../models/create_endpoint_request_base.rb | 250 +++++ .../models/create_endpoint_response.rb | 218 ++++ .../models/create_endpoint_response_data.rb | 356 +++++++ .../create_web_rtc_connection_request.rb | 266 +++++ lib/bandwidth-sdk/models/device.rb | 258 +++++ .../models/device_status_enum.rb | 40 + lib/bandwidth-sdk/models/endpoint.rb | 329 ++++++ .../models/endpoint_direction_enum.rb | 41 + lib/bandwidth-sdk/models/endpoint_event.rb | 381 +++++++ .../models/endpoint_event_type_enum.rb | 40 + lib/bandwidth-sdk/models/endpoint_response.rb | 218 ++++ .../models/endpoint_status_enum.rb | 40 + .../models/endpoint_type_enum.rb | 39 + lib/bandwidth-sdk/models/endpoints.rb | 311 ++++++ lib/bandwidth-sdk/models/inbound_callback.rb | 4 +- .../models/list_endpoints_response.rb | 229 +++++ lib/bandwidth-sdk/models/lookup_result.rb | 2 +- .../models/machine_detection_configuration.rb | 2 +- lib/bandwidth-sdk/models/message_request.rb | 2 +- lib/bandwidth-sdk/models/page.rb | 259 +++++ .../models/sip_connection_metadata.rb | 175 ++++ lib/bandwidth-sdk/models/sip_credentials.rb | 156 +++ lib/bandwidth-sdk/models/status_callback.rb | 2 +- lib/bandwidth-sdk/models/update_call.rb | 12 +- .../models/webhook_subscription_error.rb | 165 +++ .../models/webhook_subscriptions_list_body.rb | 2 +- 71 files changed, 6956 insertions(+), 55 deletions(-) create mode 100644 docs/BrtcError.md create mode 100644 docs/BrtcErrorResponse.md create mode 100644 docs/BrtcErrorSource.md create mode 100644 docs/BrtcLink.md create mode 100644 docs/CreateEndpointRequestBase.md create mode 100644 docs/CreateEndpointResponse.md create mode 100644 docs/CreateEndpointResponseData.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/ListEndpointsResponse.md create mode 100644 docs/Page.md create mode 100644 docs/SipConnectionMetadata.md create mode 100644 docs/SipCredentials.md create mode 100644 docs/WebhookSubscriptionError.md create mode 100644 lib/bandwidth-sdk/api/endpoints_api.rb create mode 100644 lib/bandwidth-sdk/models/brtc_error.rb create mode 100644 lib/bandwidth-sdk/models/brtc_error_response.rb create mode 100644 lib/bandwidth-sdk/models/brtc_error_source.rb create mode 100644 lib/bandwidth-sdk/models/brtc_link.rb create mode 100644 lib/bandwidth-sdk/models/create_endpoint_request_base.rb create mode 100644 lib/bandwidth-sdk/models/create_endpoint_response.rb create mode 100644 lib/bandwidth-sdk/models/create_endpoint_response_data.rb create mode 100644 lib/bandwidth-sdk/models/create_web_rtc_connection_request.rb create mode 100644 lib/bandwidth-sdk/models/device.rb create mode 100644 lib/bandwidth-sdk/models/device_status_enum.rb create mode 100644 lib/bandwidth-sdk/models/endpoint.rb create mode 100644 lib/bandwidth-sdk/models/endpoint_direction_enum.rb create mode 100644 lib/bandwidth-sdk/models/endpoint_event.rb create mode 100644 lib/bandwidth-sdk/models/endpoint_event_type_enum.rb create mode 100644 lib/bandwidth-sdk/models/endpoint_response.rb create mode 100644 lib/bandwidth-sdk/models/endpoint_status_enum.rb create mode 100644 lib/bandwidth-sdk/models/endpoint_type_enum.rb create mode 100644 lib/bandwidth-sdk/models/endpoints.rb create mode 100644 lib/bandwidth-sdk/models/list_endpoints_response.rb create mode 100644 lib/bandwidth-sdk/models/page.rb create mode 100644 lib/bandwidth-sdk/models/sip_connection_metadata.rb create mode 100644 lib/bandwidth-sdk/models/sip_credentials.rb create mode 100644 lib/bandwidth-sdk/models/webhook_subscription_error.rb diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 53e9a751..425d0417 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -12,6 +12,10 @@ docs/AsyncLookupRequest.md docs/BlockedWebhook.md docs/BridgeCompleteCallback.md docs/BridgeTargetCompleteCallback.md +docs/BrtcError.md +docs/BrtcErrorResponse.md +docs/BrtcErrorSource.md +docs/BrtcLink.md docs/BusinessEntityTypeEnum.md docs/BusinessRegistrationTypeEnum.md docs/CallDirectionEnum.md @@ -45,15 +49,29 @@ docs/CreateAsyncBulkLookupResponse.md docs/CreateAsyncBulkLookupResponseData.md docs/CreateCall.md docs/CreateCallResponse.md +docs/CreateEndpointRequestBase.md +docs/CreateEndpointResponse.md +docs/CreateEndpointResponseData.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/Error.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/ErrorObject.md docs/ErrorSource.md docs/FailureWebhook.md @@ -72,6 +90,7 @@ docs/LineTypeEnum.md docs/Link.md docs/LinkSchema.md docs/LinksObject.md +docs/ListEndpointsResponse.md docs/ListMessageDirectionEnum.md docs/ListMessageItem.md docs/LookupErrorResponse.md @@ -119,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 @@ -149,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 @@ -188,6 +210,7 @@ docs/VoiceApiError.md docs/VoiceCodeResponse.md docs/WebhookSubscription.md docs/WebhookSubscriptionBasicAuthentication.md +docs/WebhookSubscriptionError.md docs/WebhookSubscriptionRequestSchema.md docs/WebhookSubscriptionTypeEnum.md docs/WebhookSubscriptionsListBody.md @@ -195,6 +218,7 @@ git_push.sh lib/bandwidth-sdk.rb lib/bandwidth-sdk/api/calls_api.rb lib/bandwidth-sdk/api/conferences_api.rb +lib/bandwidth-sdk/api/endpoints_api.rb lib/bandwidth-sdk/api/media_api.rb lib/bandwidth-sdk/api/messages_api.rb lib/bandwidth-sdk/api/mfa_api.rb @@ -216,6 +240,10 @@ lib/bandwidth-sdk/models/async_lookup_request.rb lib/bandwidth-sdk/models/blocked_webhook.rb lib/bandwidth-sdk/models/bridge_complete_callback.rb lib/bandwidth-sdk/models/bridge_target_complete_callback.rb +lib/bandwidth-sdk/models/brtc_error.rb +lib/bandwidth-sdk/models/brtc_error_response.rb +lib/bandwidth-sdk/models/brtc_error_source.rb +lib/bandwidth-sdk/models/brtc_link.rb lib/bandwidth-sdk/models/business_entity_type_enum.rb lib/bandwidth-sdk/models/business_registration_type_enum.rb lib/bandwidth-sdk/models/call_direction_enum.rb @@ -247,15 +275,28 @@ lib/bandwidth-sdk/models/create_async_bulk_lookup_response.rb lib/bandwidth-sdk/models/create_async_bulk_lookup_response_data.rb lib/bandwidth-sdk/models/create_call.rb lib/bandwidth-sdk/models/create_call_response.rb +lib/bandwidth-sdk/models/create_endpoint_request_base.rb +lib/bandwidth-sdk/models/create_endpoint_response.rb +lib/bandwidth-sdk/models/create_endpoint_response_data.rb lib/bandwidth-sdk/models/create_message_request_error.rb lib/bandwidth-sdk/models/create_multi_channel_message_response.rb lib/bandwidth-sdk/models/create_sync_lookup_response.rb lib/bandwidth-sdk/models/create_sync_lookup_response_data.rb +lib/bandwidth-sdk/models/create_web_rtc_connection_request.rb lib/bandwidth-sdk/models/deactivation_event_enum.rb +lib/bandwidth-sdk/models/device.rb +lib/bandwidth-sdk/models/device_status_enum.rb lib/bandwidth-sdk/models/disconnect_callback.rb lib/bandwidth-sdk/models/diversion.rb lib/bandwidth-sdk/models/dtmf_callback.rb -lib/bandwidth-sdk/models/error.rb +lib/bandwidth-sdk/models/endpoint.rb +lib/bandwidth-sdk/models/endpoint_direction_enum.rb +lib/bandwidth-sdk/models/endpoint_event.rb +lib/bandwidth-sdk/models/endpoint_event_type_enum.rb +lib/bandwidth-sdk/models/endpoint_response.rb +lib/bandwidth-sdk/models/endpoint_status_enum.rb +lib/bandwidth-sdk/models/endpoint_type_enum.rb +lib/bandwidth-sdk/models/endpoints.rb lib/bandwidth-sdk/models/error_object.rb lib/bandwidth-sdk/models/error_source.rb lib/bandwidth-sdk/models/failure_webhook.rb @@ -274,6 +315,7 @@ lib/bandwidth-sdk/models/line_type_enum.rb lib/bandwidth-sdk/models/link.rb lib/bandwidth-sdk/models/link_schema.rb lib/bandwidth-sdk/models/links_object.rb +lib/bandwidth-sdk/models/list_endpoints_response.rb lib/bandwidth-sdk/models/list_message_direction_enum.rb lib/bandwidth-sdk/models/list_message_item.rb lib/bandwidth-sdk/models/lookup_error_response.rb @@ -317,6 +359,7 @@ lib/bandwidth-sdk/models/multi_channel_message_content.rb lib/bandwidth-sdk/models/multi_channel_message_request.rb lib/bandwidth-sdk/models/multi_channel_message_response_data.rb lib/bandwidth-sdk/models/opt_in_workflow.rb +lib/bandwidth-sdk/models/page.rb lib/bandwidth-sdk/models/page_info.rb lib/bandwidth-sdk/models/priority_enum.rb lib/bandwidth-sdk/models/product_type_enum.rb @@ -345,6 +388,8 @@ lib/bandwidth-sdk/models/recording_transcription_metadata.rb lib/bandwidth-sdk/models/recording_transcriptions.rb lib/bandwidth-sdk/models/redirect_callback.rb lib/bandwidth-sdk/models/redirect_method_enum.rb +lib/bandwidth-sdk/models/sip_connection_metadata.rb +lib/bandwidth-sdk/models/sip_credentials.rb lib/bandwidth-sdk/models/sms_message_content.rb lib/bandwidth-sdk/models/standalone_card_orientation_enum.rb lib/bandwidth-sdk/models/status_callback.rb @@ -381,6 +426,7 @@ lib/bandwidth-sdk/models/voice_api_error.rb lib/bandwidth-sdk/models/voice_code_response.rb lib/bandwidth-sdk/models/webhook_subscription.rb lib/bandwidth-sdk/models/webhook_subscription_basic_authentication.rb +lib/bandwidth-sdk/models/webhook_subscription_error.rb lib/bandwidth-sdk/models/webhook_subscription_request_schema.rb lib/bandwidth-sdk/models/webhook_subscription_type_enum.rb lib/bandwidth-sdk/models/webhook_subscriptions_list_body.rb diff --git a/README.md b/README.md index e981ea0b..ad7e1e44 100644 --- a/README.md +++ b/README.md @@ -131,6 +131,11 @@ Class | Method | HTTP request | Description *Bandwidth::ConferencesApi* | [**update_conference**](docs/ConferencesApi.md#update_conference) | **POST** /accounts/{accountId}/conferences/{conferenceId} | Update Conference *Bandwidth::ConferencesApi* | [**update_conference_bxml**](docs/ConferencesApi.md#update_conference_bxml) | **PUT** /accounts/{accountId}/conferences/{conferenceId}/bxml | Update Conference BXML *Bandwidth::ConferencesApi* | [**update_conference_member**](docs/ConferencesApi.md#update_conference_member) | **PUT** /accounts/{accountId}/conferences/{conferenceId}/members/{memberId} | Update Conference Member +*Bandwidth::EndpointsApi* | [**create_endpoint**](docs/EndpointsApi.md#create_endpoint) | **POST** /accounts/{accountId}/endpoints | Create Endpoint +*Bandwidth::EndpointsApi* | [**delete_endpoint**](docs/EndpointsApi.md#delete_endpoint) | **DELETE** /accounts/{accountId}/endpoints/{endpointId} | Delete Endpoint +*Bandwidth::EndpointsApi* | [**get_endpoint**](docs/EndpointsApi.md#get_endpoint) | **GET** /accounts/{accountId}/endpoints/{endpointId} | Get Endpoint +*Bandwidth::EndpointsApi* | [**list_endpoints**](docs/EndpointsApi.md#list_endpoints) | **GET** /accounts/{accountId}/endpoints | List Endpoints +*Bandwidth::EndpointsApi* | [**update_endpoint_bxml**](docs/EndpointsApi.md#update_endpoint_bxml) | **PUT** /accounts/{accountId}/endpoints/{endpointId}/bxml | Update Endpoint BXML *Bandwidth::MFAApi* | [**generate_messaging_code**](docs/MFAApi.md#generate_messaging_code) | **POST** /accounts/{accountId}/code/messaging | Messaging Authentication Code *Bandwidth::MFAApi* | [**generate_voice_code**](docs/MFAApi.md#generate_voice_code) | **POST** /accounts/{accountId}/code/voice | Voice Authentication Code *Bandwidth::MFAApi* | [**verify_code**](docs/MFAApi.md#verify_code) | **POST** /accounts/{accountId}/code/verify | Verify Authentication Code @@ -179,6 +184,10 @@ Class | Method | HTTP request | Description - [Bandwidth::BlockedWebhook](docs/BlockedWebhook.md) - [Bandwidth::BridgeCompleteCallback](docs/BridgeCompleteCallback.md) - [Bandwidth::BridgeTargetCompleteCallback](docs/BridgeTargetCompleteCallback.md) + - [Bandwidth::BrtcError](docs/BrtcError.md) + - [Bandwidth::BrtcErrorResponse](docs/BrtcErrorResponse.md) + - [Bandwidth::BrtcErrorSource](docs/BrtcErrorSource.md) + - [Bandwidth::BrtcLink](docs/BrtcLink.md) - [Bandwidth::BusinessEntityTypeEnum](docs/BusinessEntityTypeEnum.md) - [Bandwidth::BusinessRegistrationTypeEnum](docs/BusinessRegistrationTypeEnum.md) - [Bandwidth::CallDirectionEnum](docs/CallDirectionEnum.md) @@ -210,15 +219,28 @@ Class | Method | HTTP request | Description - [Bandwidth::CreateAsyncBulkLookupResponseData](docs/CreateAsyncBulkLookupResponseData.md) - [Bandwidth::CreateCall](docs/CreateCall.md) - [Bandwidth::CreateCallResponse](docs/CreateCallResponse.md) + - [Bandwidth::CreateEndpointRequestBase](docs/CreateEndpointRequestBase.md) + - [Bandwidth::CreateEndpointResponse](docs/CreateEndpointResponse.md) + - [Bandwidth::CreateEndpointResponseData](docs/CreateEndpointResponseData.md) - [Bandwidth::CreateMessageRequestError](docs/CreateMessageRequestError.md) - [Bandwidth::CreateMultiChannelMessageResponse](docs/CreateMultiChannelMessageResponse.md) - [Bandwidth::CreateSyncLookupResponse](docs/CreateSyncLookupResponse.md) - [Bandwidth::CreateSyncLookupResponseData](docs/CreateSyncLookupResponseData.md) + - [Bandwidth::CreateWebRtcConnectionRequest](docs/CreateWebRtcConnectionRequest.md) - [Bandwidth::DeactivationEventEnum](docs/DeactivationEventEnum.md) + - [Bandwidth::Device](docs/Device.md) + - [Bandwidth::DeviceStatusEnum](docs/DeviceStatusEnum.md) - [Bandwidth::DisconnectCallback](docs/DisconnectCallback.md) - [Bandwidth::Diversion](docs/Diversion.md) - [Bandwidth::DtmfCallback](docs/DtmfCallback.md) - - [Bandwidth::Error](docs/Error.md) + - [Bandwidth::Endpoint](docs/Endpoint.md) + - [Bandwidth::EndpointDirectionEnum](docs/EndpointDirectionEnum.md) + - [Bandwidth::EndpointEvent](docs/EndpointEvent.md) + - [Bandwidth::EndpointEventTypeEnum](docs/EndpointEventTypeEnum.md) + - [Bandwidth::EndpointResponse](docs/EndpointResponse.md) + - [Bandwidth::EndpointStatusEnum](docs/EndpointStatusEnum.md) + - [Bandwidth::EndpointTypeEnum](docs/EndpointTypeEnum.md) + - [Bandwidth::Endpoints](docs/Endpoints.md) - [Bandwidth::ErrorObject](docs/ErrorObject.md) - [Bandwidth::ErrorSource](docs/ErrorSource.md) - [Bandwidth::FailureWebhook](docs/FailureWebhook.md) @@ -237,6 +259,7 @@ Class | Method | HTTP request | Description - [Bandwidth::Link](docs/Link.md) - [Bandwidth::LinkSchema](docs/LinkSchema.md) - [Bandwidth::LinksObject](docs/LinksObject.md) + - [Bandwidth::ListEndpointsResponse](docs/ListEndpointsResponse.md) - [Bandwidth::ListMessageDirectionEnum](docs/ListMessageDirectionEnum.md) - [Bandwidth::ListMessageItem](docs/ListMessageItem.md) - [Bandwidth::LookupErrorResponse](docs/LookupErrorResponse.md) @@ -280,6 +303,7 @@ Class | Method | HTTP request | Description - [Bandwidth::MultiChannelMessageRequest](docs/MultiChannelMessageRequest.md) - [Bandwidth::MultiChannelMessageResponseData](docs/MultiChannelMessageResponseData.md) - [Bandwidth::OptInWorkflow](docs/OptInWorkflow.md) + - [Bandwidth::Page](docs/Page.md) - [Bandwidth::PageInfo](docs/PageInfo.md) - [Bandwidth::PriorityEnum](docs/PriorityEnum.md) - [Bandwidth::ProductTypeEnum](docs/ProductTypeEnum.md) @@ -308,6 +332,8 @@ Class | Method | HTTP request | Description - [Bandwidth::RecordingTranscriptions](docs/RecordingTranscriptions.md) - [Bandwidth::RedirectCallback](docs/RedirectCallback.md) - [Bandwidth::RedirectMethodEnum](docs/RedirectMethodEnum.md) + - [Bandwidth::SipConnectionMetadata](docs/SipConnectionMetadata.md) + - [Bandwidth::SipCredentials](docs/SipCredentials.md) - [Bandwidth::SmsMessageContent](docs/SmsMessageContent.md) - [Bandwidth::StandaloneCardOrientationEnum](docs/StandaloneCardOrientationEnum.md) - [Bandwidth::StatusCallback](docs/StatusCallback.md) @@ -344,6 +370,7 @@ Class | Method | HTTP request | Description - [Bandwidth::VoiceCodeResponse](docs/VoiceCodeResponse.md) - [Bandwidth::WebhookSubscription](docs/WebhookSubscription.md) - [Bandwidth::WebhookSubscriptionBasicAuthentication](docs/WebhookSubscriptionBasicAuthentication.md) + - [Bandwidth::WebhookSubscriptionError](docs/WebhookSubscriptionError.md) - [Bandwidth::WebhookSubscriptionRequestSchema](docs/WebhookSubscriptionRequestSchema.md) - [Bandwidth::WebhookSubscriptionTypeEnum](docs/WebhookSubscriptionTypeEnum.md) - [Bandwidth::WebhookSubscriptionsListBody](docs/WebhookSubscriptionsListBody.md) diff --git a/bandwidth.yml b/bandwidth.yml index 835ec5a9..6ad54bc1 100644 --- a/bandwidth.yml +++ b/bandwidth.yml @@ -22,6 +22,7 @@ tags: - name: MFA - name: Phone Number Lookup - name: Toll-Free Verification + - name: Endpoints paths: /users/{accountId}/media: get: @@ -1690,6 +1691,180 @@ paths: '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/accountId' + - $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' + x-badges: + - name: Beta + color: '#076EA8' + post: + tags: + - Endpoints + summary: Create Endpoint + description: Creates a new Endpoint for the specified account. + operationId: createEndpoint + parameters: + - $ref: '#/components/parameters/accountId' + 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' + x-badges: + - name: Beta + color: '#076EA8' + 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/accountId' + - $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' + x-badges: + - name: Beta + color: '#076EA8' + 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/accountId' + - $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' + x-badges: + - name: Beta + color: '#076EA8' + 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/accountId' + - $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' + x-badges: + - name: Beta + color: '#076EA8' + servers: *ref_5 components: schemas: applicationId: @@ -1986,7 +2161,7 @@ components: type: string description: >- The name of the Authorized Message Provider (AMP) that handled this - message. + message. In the US, this is the carrier that the message was sent to. @@ -2073,7 +2248,7 @@ components: 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. + 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 -, @@ -2396,8 +2571,8 @@ components: 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. + 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: @@ -2410,7 +2585,7 @@ components: 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. + - `FULL` WebView takes the full screen. - `HALF` WebView takes half of the screen. @@ -2812,7 +2987,7 @@ components: to: type: string description: > - The destination phone number the message was sent 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. @@ -2863,7 +3038,7 @@ components: 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. + 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. @@ -3102,7 +3277,7 @@ components: nullable: true type: string description: >- - The caller display name to use when the call is created. + The caller display name to use when the call is created. May not exceed 256 characters nor contain control characters such as new lines. @@ -3280,8 +3455,8 @@ components: May be cleared by setting `tag=""` - Max length 256 characters. - maxLength: 256 + Max length 4096 characters. + maxLength: 4096 example: arbitrary text here createCallResponse: type: object @@ -3658,11 +3833,11 @@ components: May be cleared by setting `tag=""`. - Max length 256 characters. + Max length 4096 characters. Not allowed if `state` is `completed`. - maxLength: 256 + maxLength: 4096 example: My Custom Tag updateCallRecording: type: object @@ -4039,7 +4214,7 @@ components: format: double description: >- When an answering machine is detected, the amount of silence (in - seconds) before assuming the message has finished playing. + seconds) before assuming the message has finished playing. If not provided it will default to the speechEndThreshold value. example: 5 @@ -5783,7 +5958,7 @@ components: format: date description: >- [DNI-Only](#section/DNI-Only). The date the phone number entered the - status described in `latestMessageDeliveryStatus`. + status described in `latestMessageDeliveryStatus`. Think of this as the "start time" for that status. @@ -6460,7 +6635,7 @@ components: errors: type: array items: - $ref: '#/components/schemas/error' + $ref: '#/components/schemas/webhookSubscriptionError' data: items: $ref: '#/components/schemas/webhookSubscription' @@ -6486,7 +6661,7 @@ components: If more results exist than specified by 'size', this link return the last page of result. type: string - error: + webhookSubscriptionError: type: object properties: code: @@ -6687,6 +6862,365 @@ components: nullable: true example: >- cv.user123|sess456|mno|tfree|read_write|X7yZ9aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVw + 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' + createEndpointResponseData: + 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 + brtcLink: + 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 + 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 + brtcError: + 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: + $ref: '#/components/schemas/brtcErrorSource' + required: + - type + - description + brtcErrorSource: + 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 + listEndpointsResponse: + type: object + properties: + links: + type: array + items: + $ref: '#/components/schemas/brtcLink' + page: + $ref: '#/components/schemas/page' + data: + type: array + items: + $ref: '#/components/schemas/endpoints' + errors: + type: array + items: + $ref: '#/components/schemas/brtcError' + required: + - links + - data + - errors + endpointResponse: + type: object + properties: + links: + type: array + items: + $ref: '#/components/schemas/brtcLink' + data: + $ref: '#/components/schemas/endpoint' + errors: + type: array + items: + $ref: '#/components/schemas/brtcError' + required: + - links + - data + - errors + createEndpointResponse: + type: object + properties: + links: + type: array + items: + $ref: '#/components/schemas/brtcLink' + data: + $ref: '#/components/schemas/createEndpointResponseData' + errors: + type: array + items: + $ref: '#/components/schemas/brtcError' + required: + - links + - data + - errors + brtcErrorResponse: + type: object + properties: + links: + type: array + items: + $ref: '#/components/schemas/brtcLink' + data: + type: object + nullable: true + additionalProperties: false + errors: + type: array + items: + $ref: '#/components/schemas/brtcError' + required: + - links + - data + - errors responses: createMessageResponse: description: Accepted @@ -7361,6 +7895,114 @@ components: type: Service Unavailable verifyPutResponse: description: Accepted + 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/brtcErrorResponse' + examples: + badRequestErrorExample: + $ref: '#/components/examples/badRequestErrorExample' + unauthorizedErrorResponse: + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/brtcErrorResponse' + examples: + unauthorizedErrorExample: + $ref: '#/components/examples/unauthorizedErrorExample' + forbiddenErrorResponse: + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/brtcErrorResponse' + examples: + forbiddenErrorExample: + $ref: '#/components/examples/forbiddenErrorExample' + notFoundErrorResponse: + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/brtcErrorResponse' + examples: + notFoundErrorExample: + $ref: '#/components/examples/notFoundErrorExample' + methodNotAllowedErrorResponse: + description: Method Not Allowed + content: + application/json: + schema: + $ref: '#/components/schemas/brtcErrorResponse' + examples: + methodNotAllowedErrorExample: + $ref: '#/components/examples/methodNotAllowedErrorExample' + unsupportedMediaTypeErrorResponse: + description: Unsupported Media Type + content: + application/json: + schema: + $ref: '#/components/schemas/brtcErrorResponse' + examples: + unsuppotedMediaTypeErrorExample: + $ref: '#/components/examples/unsupportedMediaTypeErrorExample' + tooManyRequestsErrorResponse: + description: Too Many Requests + headers: + Retry-After: + description: >- + The number of seconds the client should wait before making another + request. + required: true + schema: + type: integer + example: 900 + content: + application/json: + schema: + $ref: '#/components/schemas/brtcErrorResponse' + examples: + tooManyRequestsErrorExample: + $ref: '#/components/examples/tooManyRequestsErrorExample' + serviceUnavailableErrorResponse: + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/brtcErrorResponse' + examples: + serviceUnavailableErrorExample: + $ref: '#/components/examples/serviceUnavailableErrorExample' parameters: accountId: in: path @@ -7860,6 +8502,45 @@ components: type: string description: Webhook subscription ID example: 7bt57JcsVYJrN9K1OcV1Nu + 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. @@ -8342,6 +9023,205 @@ components: 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: + - type: too_many_endpoints + description: >- + Too many endpoints. Please delete an existing endpoint or wait 24 + hours for an endpoint to be removed. + 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: @@ -8697,6 +9577,30 @@ components: 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 @@ -8723,12 +9627,12 @@ components: required: true description: >-

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

The payload type will be one of message-received, suggestion-response, or @@ -8830,3 +9734,17 @@ components: $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. diff --git a/docs/BrtcError.md b/docs/BrtcError.md new file mode 100644 index 00000000..5aed6e88 --- /dev/null +++ b/docs/BrtcError.md @@ -0,0 +1,26 @@ +# Bandwidth::BrtcError + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | A unique identifier for the error. | [optional] | +| **type** | **String** | The type of error. | | +| **description** | **String** | A description of the error. | | +| **code** | **String** | A code that uniquely identifies the error. | [optional] | +| **source** | [**BrtcErrorSource**](BrtcErrorSource.md) | | [optional] | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::BrtcError.new( + id: 59512d87-7a92-4040-8e4a-78fb772019b9, + type: resource.not_found, + description: The requested resource was not found., + code: 404, + source: null +) +``` + diff --git a/docs/BrtcErrorResponse.md b/docs/BrtcErrorResponse.md new file mode 100644 index 00000000..4a30cf4b --- /dev/null +++ b/docs/BrtcErrorResponse.md @@ -0,0 +1,22 @@ +# Bandwidth::BrtcErrorResponse + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **links** | [**Array<BrtcLink>**](BrtcLink.md) | | | +| **data** | **Object** | | | +| **errors** | [**Array<BrtcError>**](BrtcError.md) | | | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::BrtcErrorResponse.new( + links: null, + data: null, + errors: null +) +``` + diff --git a/docs/BrtcErrorSource.md b/docs/BrtcErrorSource.md new file mode 100644 index 00000000..ff292df9 --- /dev/null +++ b/docs/BrtcErrorSource.md @@ -0,0 +1,24 @@ +# Bandwidth::BrtcErrorSource + +## 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] | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::BrtcErrorSource.new( + parameter: accountId, + field: accountId, + header: Authorization, + reference: e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 +) +``` + diff --git a/docs/BrtcLink.md b/docs/BrtcLink.md new file mode 100644 index 00000000..6508f6b4 --- /dev/null +++ b/docs/BrtcLink.md @@ -0,0 +1,22 @@ +# Bandwidth::BrtcLink + +## 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** | **String** | The HTTP method to use when making the request. | [optional] | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::BrtcLink.new( + href: https://api.bandwidth.com/v2/accounts/5500123/endpoints/e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85, + rel: self, + method: GET +) +``` + diff --git a/docs/CreateCall.md b/docs/CreateCall.md index 20340a83..29020367 100644 --- a/docs/CreateCall.md +++ b/docs/CreateCall.md @@ -7,7 +7,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] | -| **display_name** | **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] | +| **display_name** | **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] | | **application_id** | **String** | The id of the application associated with the `from` number. | | | **answer_url** | **String** | 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`. | | @@ -24,7 +24,7 @@ | **callback_timeout** | **Float** | 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. | [optional][default to 15] | | **machine_detection** | [**MachineDetectionConfiguration**](MachineDetectionConfiguration.md) | | [optional] | | **priority** | **Integer** | 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. | [optional][default to 5] | -| **tag** | **String** | A custom string that will be sent with all webhooks for this call unless overwritten by a future <a href='/docs/voice/bxml/tag'>`<Tag>`</a> verb or `tag` attribute on another verb, or cleared. May be cleared by setting `tag=\"\"` Max length 256 characters. | [optional] | +| **tag** | **String** | A custom string that will be sent with all webhooks for this call unless overwritten by a future <a href='/docs/voice/bxml/tag'>`<Tag>`</a> verb or `tag` attribute on another verb, or cleared. May be cleared by setting `tag=\"\"` Max length 4096 characters. | [optional] | ## Example diff --git a/docs/CreateEndpointRequestBase.md b/docs/CreateEndpointRequestBase.md new file mode 100644 index 00000000..c721cfb0 --- /dev/null +++ b/docs/CreateEndpointRequestBase.md @@ -0,0 +1,26 @@ +# Bandwidth::CreateEndpointRequestBase + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **type** | [**EndpointTypeEnum**](EndpointTypeEnum.md) | | | +| **direction** | [**EndpointDirectionEnum**](EndpointDirectionEnum.md) | | | +| **event_callback_url** | **String** | The URL to send event callbacks to. | [optional] | +| **event_fallback_url** | **String** | The URL to send event fallbacks to. | [optional] | +| **tag** | **String** | A tag for the endpoint. | [optional] | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::CreateEndpointRequestBase.new( + type: null, + direction: null, + event_callback_url: https://myapp.com/callback, + event_fallback_url: https://fallback.myapp.com/callback, + tag: my-tag +) +``` + diff --git a/docs/CreateEndpointResponse.md b/docs/CreateEndpointResponse.md new file mode 100644 index 00000000..3cbf6f86 --- /dev/null +++ b/docs/CreateEndpointResponse.md @@ -0,0 +1,22 @@ +# Bandwidth::CreateEndpointResponse + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **links** | [**Array<BrtcLink>**](BrtcLink.md) | | | +| **data** | [**CreateEndpointResponseData**](CreateEndpointResponseData.md) | | | +| **errors** | [**Array<BrtcError>**](BrtcError.md) | | | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::CreateEndpointResponse.new( + links: null, + data: null, + errors: null +) +``` + diff --git a/docs/CreateEndpointResponseData.md b/docs/CreateEndpointResponseData.md new file mode 100644 index 00000000..81f43334 --- /dev/null +++ b/docs/CreateEndpointResponseData.md @@ -0,0 +1,32 @@ +# Bandwidth::CreateEndpointResponseData + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **endpoint_id** | **String** | The unique ID of the endpoint. | | +| **type** | [**EndpointTypeEnum**](EndpointTypeEnum.md) | | | +| **status** | [**EndpointStatusEnum**](EndpointStatusEnum.md) | | | +| **creation_timestamp** | **Time** | The time the endpoint was created. In ISO-8601 format. | | +| **expiration_timestamp** | **Time** | The time the endpoint token will expire. In ISO-8601 format. Tokens last 24 hours. | | +| **tag** | **String** | A tag for the endpoint. | [optional] | +| **devices** | [**Array<Device>**](Device.md) | | [optional] | +| **token** | **String** | The json web token specific to the endpoint. Used to authenticate the client with the media gateway. | | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::CreateEndpointResponseData.new( + endpoint_id: e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85, + type: null, + status: null, + creation_timestamp: 2021-01-01T00:00Z, + expiration_timestamp: 2021-01-02T00:00Z, + tag: my-tag, + devices: null, + token: xxxxx.yyyyy.zzzzz +) +``` + diff --git a/docs/CreateWebRtcConnectionRequest.md b/docs/CreateWebRtcConnectionRequest.md new file mode 100644 index 00000000..30bfec76 --- /dev/null +++ b/docs/CreateWebRtcConnectionRequest.md @@ -0,0 +1,28 @@ +# Bandwidth::CreateWebRtcConnectionRequest + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **type** | [**EndpointTypeEnum**](EndpointTypeEnum.md) | | | +| **direction** | [**EndpointDirectionEnum**](EndpointDirectionEnum.md) | | | +| **event_callback_url** | **String** | The URL to send event callbacks to. | [optional] | +| **event_fallback_url** | **String** | The URL to send event fallbacks to. | [optional] | +| **tag** | **String** | A tag for the endpoint. | [optional] | +| **connection_metadata** | **Object** | | [optional] | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::CreateWebRtcConnectionRequest.new( + type: null, + direction: null, + event_callback_url: https://myapp.com/callback, + event_fallback_url: https://fallback.myapp.com/callback, + tag: my-tag, + connection_metadata: null +) +``` + diff --git a/docs/Device.md b/docs/Device.md new file mode 100644 index 00000000..a78fe939 --- /dev/null +++ b/docs/Device.md @@ -0,0 +1,24 @@ +# Bandwidth::Device + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **device_id** | **String** | The unique ID of the device. | | +| **device_name** | **String** | The name of the device. | [optional] | +| **status** | [**DeviceStatusEnum**](DeviceStatusEnum.md) | | | +| **creation_timestamp** | **Time** | The time the device was created. In ISO-8601 format. | | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::Device.new( + device_id: d-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85, + device_name: David's iPhone, + status: null, + creation_timestamp: 2021-01-01T00:00Z +) +``` + diff --git a/docs/DeviceStatusEnum.md b/docs/DeviceStatusEnum.md new file mode 100644 index 00000000..cc34730e --- /dev/null +++ b/docs/DeviceStatusEnum.md @@ -0,0 +1,15 @@ +# Bandwidth::DeviceStatusEnum + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::DeviceStatusEnum.new() +``` + diff --git a/docs/Endpoint.md b/docs/Endpoint.md new file mode 100644 index 00000000..738bb946 --- /dev/null +++ b/docs/Endpoint.md @@ -0,0 +1,30 @@ +# Bandwidth::Endpoint + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **endpoint_id** | **String** | The unique ID of the endpoint. | | +| **type** | [**EndpointTypeEnum**](EndpointTypeEnum.md) | | | +| **status** | [**EndpointStatusEnum**](EndpointStatusEnum.md) | | | +| **creation_timestamp** | **Time** | The time the endpoint was created. In ISO-8601 format. | | +| **expiration_timestamp** | **Time** | The time the endpoint token will expire. In ISO-8601 format. Tokens last 24 hours. | | +| **tag** | **String** | A tag for the endpoint. | [optional] | +| **devices** | [**Array<Device>**](Device.md) | | [optional] | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::Endpoint.new( + endpoint_id: e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85, + type: null, + status: null, + creation_timestamp: 2021-01-01T00:00Z, + expiration_timestamp: 2021-01-02T00:00Z, + tag: my-tag, + devices: null +) +``` + diff --git a/docs/EndpointDirectionEnum.md b/docs/EndpointDirectionEnum.md new file mode 100644 index 00000000..d10de036 --- /dev/null +++ b/docs/EndpointDirectionEnum.md @@ -0,0 +1,15 @@ +# Bandwidth::EndpointDirectionEnum + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::EndpointDirectionEnum.new() +``` + diff --git a/docs/EndpointEvent.md b/docs/EndpointEvent.md new file mode 100644 index 00000000..3126ac14 --- /dev/null +++ b/docs/EndpointEvent.md @@ -0,0 +1,34 @@ +# Bandwidth::EndpointEvent + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **endpoint_id** | **String** | The unique ID of the endpoint. | | +| **type** | [**EndpointTypeEnum**](EndpointTypeEnum.md) | | | +| **status** | [**EndpointStatusEnum**](EndpointStatusEnum.md) | | | +| **creation_timestamp** | **Time** | The time the endpoint was created. In ISO-8601 format. | | +| **expiration_timestamp** | **Time** | The time the endpoint token will expire. In ISO-8601 format. Tokens last 24 hours. | | +| **tag** | **String** | A tag for the endpoint. | [optional] | +| **event_time** | **Time** | The time the event occurred. In ISO-8601 format. | | +| **event_type** | [**EndpointEventTypeEnum**](EndpointEventTypeEnum.md) | | | +| **device** | [**Device**](Device.md) | | [optional] | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::EndpointEvent.new( + endpoint_id: e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85, + type: null, + status: null, + creation_timestamp: 2021-01-01T00:00Z, + expiration_timestamp: 2021-01-02T00:00Z, + tag: my-tag, + event_time: 2021-01-01T00:00Z, + event_type: null, + device: null +) +``` + diff --git a/docs/EndpointEventTypeEnum.md b/docs/EndpointEventTypeEnum.md new file mode 100644 index 00000000..2d786c87 --- /dev/null +++ b/docs/EndpointEventTypeEnum.md @@ -0,0 +1,15 @@ +# Bandwidth::EndpointEventTypeEnum + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::EndpointEventTypeEnum.new() +``` + diff --git a/docs/EndpointResponse.md b/docs/EndpointResponse.md new file mode 100644 index 00000000..d29c8b00 --- /dev/null +++ b/docs/EndpointResponse.md @@ -0,0 +1,22 @@ +# Bandwidth::EndpointResponse + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **links** | [**Array<BrtcLink>**](BrtcLink.md) | | | +| **data** | [**Endpoint**](Endpoint.md) | | | +| **errors** | [**Array<BrtcError>**](BrtcError.md) | | | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::EndpointResponse.new( + links: null, + data: null, + errors: null +) +``` + diff --git a/docs/EndpointStatusEnum.md b/docs/EndpointStatusEnum.md new file mode 100644 index 00000000..5c9f11f6 --- /dev/null +++ b/docs/EndpointStatusEnum.md @@ -0,0 +1,15 @@ +# Bandwidth::EndpointStatusEnum + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::EndpointStatusEnum.new() +``` + diff --git a/docs/EndpointTypeEnum.md b/docs/EndpointTypeEnum.md new file mode 100644 index 00000000..ab977490 --- /dev/null +++ b/docs/EndpointTypeEnum.md @@ -0,0 +1,15 @@ +# Bandwidth::EndpointTypeEnum + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::EndpointTypeEnum.new() +``` + diff --git a/docs/Endpoints.md b/docs/Endpoints.md new file mode 100644 index 00000000..33a5bff1 --- /dev/null +++ b/docs/Endpoints.md @@ -0,0 +1,28 @@ +# Bandwidth::Endpoints + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **endpoint_id** | **String** | The unique ID of the endpoint. | | +| **type** | [**EndpointTypeEnum**](EndpointTypeEnum.md) | | | +| **status** | [**EndpointStatusEnum**](EndpointStatusEnum.md) | | | +| **creation_timestamp** | **Time** | The time the endpoint was created. In ISO-8601 format. | | +| **expiration_timestamp** | **Time** | The time the endpoint token will expire. In ISO-8601 format. Tokens last 24 hours. | | +| **tag** | **String** | A tag for the endpoint. | [optional] | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::Endpoints.new( + endpoint_id: e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85, + type: null, + status: null, + creation_timestamp: 2021-01-01T00:00Z, + expiration_timestamp: 2021-01-02T00:00Z, + tag: my-tag +) +``` + diff --git a/docs/EndpointsApi.md b/docs/EndpointsApi.md new file mode 100644 index 00000000..bae5ab8b --- /dev/null +++ b/docs/EndpointsApi.md @@ -0,0 +1,395 @@ +# Bandwidth::EndpointsApi + +All URIs are relative to *http://localhost* + +| Method | HTTP request | Description | +| ------ | ------------ | ----------- | +| [**create_endpoint**](EndpointsApi.md#create_endpoint) | **POST** /accounts/{accountId}/endpoints | Create Endpoint | +| [**delete_endpoint**](EndpointsApi.md#delete_endpoint) | **DELETE** /accounts/{accountId}/endpoints/{endpointId} | Delete Endpoint | +| [**get_endpoint**](EndpointsApi.md#get_endpoint) | **GET** /accounts/{accountId}/endpoints/{endpointId} | Get Endpoint | +| [**list_endpoints**](EndpointsApi.md#list_endpoints) | **GET** /accounts/{accountId}/endpoints | List Endpoints | +| [**update_endpoint_bxml**](EndpointsApi.md#update_endpoint_bxml) | **PUT** /accounts/{accountId}/endpoints/{endpointId}/bxml | Update Endpoint BXML | + + +## create_endpoint + +> create_endpoint(account_id, body) + +Create Endpoint + +Creates a new Endpoint for the specified account. + +### Examples + +```ruby +require 'time' +require 'bandwidth-sdk' +# setup authorization +Bandwidth.configure do |config| + # Configure HTTP basic authorization: Basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' + + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = Bandwidth::EndpointsApi.new +account_id = '9900000' # String | Your Bandwidth Account ID. +body = 3.56 # CreateWebRtcConnectionRequest | + +begin + # Create Endpoint + result = api_instance.create_endpoint(account_id, body) + p result +rescue Bandwidth::ApiError => e + puts "Error when calling EndpointsApi->create_endpoint: #{e}" +end +``` + +#### Using the create_endpoint_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> create_endpoint_with_http_info(account_id, body) + +```ruby +begin + # Create Endpoint + data, status_code, headers = api_instance.create_endpoint_with_http_info(account_id, body) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue Bandwidth::ApiError => e + puts "Error when calling EndpointsApi->create_endpoint_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **account_id** | **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 + + +## delete_endpoint + +> delete_endpoint(account_id, endpoint_id) + +Delete Endpoint + +Deletes the specified endpoint. If the endpoint is actively streaming media, the media stream will be terminated. + +### Examples + +```ruby +require 'time' +require 'bandwidth-sdk' +# setup authorization +Bandwidth.configure do |config| + # Configure HTTP basic authorization: Basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' + + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = Bandwidth::EndpointsApi.new +account_id = '9900000' # String | Your Bandwidth Account ID. +endpoint_id = 'e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | BRTC Endpoint ID. + +begin + # Delete Endpoint + api_instance.delete_endpoint(account_id, endpoint_id) +rescue Bandwidth::ApiError => e + puts "Error when calling EndpointsApi->delete_endpoint: #{e}" +end +``` + +#### Using the delete_endpoint_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> delete_endpoint_with_http_info(account_id, endpoint_id) + +```ruby +begin + # Delete Endpoint + data, status_code, headers = api_instance.delete_endpoint_with_http_info(account_id, endpoint_id) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue Bandwidth::ApiError => e + puts "Error when calling EndpointsApi->delete_endpoint_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **account_id** | **String** | Your Bandwidth Account ID. | | +| **endpoint_id** | **String** | BRTC Endpoint ID. | | + +### Return type + +nil (empty response body) + +### Authorization + +[Basic](../README.md#Basic), [OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_endpoint + +> get_endpoint(account_id, endpoint_id) + +Get Endpoint + +Returns information about the specified endpoint. + +### Examples + +```ruby +require 'time' +require 'bandwidth-sdk' +# setup authorization +Bandwidth.configure do |config| + # Configure HTTP basic authorization: Basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' + + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = Bandwidth::EndpointsApi.new +account_id = '9900000' # String | Your Bandwidth Account ID. +endpoint_id = 'e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | BRTC Endpoint ID. + +begin + # Get Endpoint + result = api_instance.get_endpoint(account_id, endpoint_id) + p result +rescue Bandwidth::ApiError => e + puts "Error when calling EndpointsApi->get_endpoint: #{e}" +end +``` + +#### Using the get_endpoint_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_endpoint_with_http_info(account_id, endpoint_id) + +```ruby +begin + # Get Endpoint + data, status_code, headers = api_instance.get_endpoint_with_http_info(account_id, endpoint_id) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue Bandwidth::ApiError => e + puts "Error when calling EndpointsApi->get_endpoint_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **account_id** | **String** | Your Bandwidth Account ID. | | +| **endpoint_id** | **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 + + +## list_endpoints + +> list_endpoints(account_id, opts) + +List Endpoints + +Returns a list of endpoints associated with the specified account. + +### Examples + +```ruby +require 'time' +require 'bandwidth-sdk' +# setup authorization +Bandwidth.configure do |config| + # Configure HTTP basic authorization: Basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' + + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = Bandwidth::EndpointsApi.new +account_id = '9900000' # String | Your Bandwidth Account ID. +opts = { + type: Bandwidth::EndpointTypeEnum::WEBRTC, # EndpointTypeEnum | The type of endpoint. + status: Bandwidth::EndpointStatusEnum::CONNECTED, # EndpointStatusEnum | The status of the endpoint. + after_cursor: 'TWF5IHRoZSBmb3JjZSBiZSB3aXRoIHlvdQ==', # String | The cursor to use for pagination. This is the value of the `next` link in the previous response. + limit: 2 # Integer | The maximum number of endpoints to return in the response. +} + +begin + # List Endpoints + result = api_instance.list_endpoints(account_id, opts) + p result +rescue Bandwidth::ApiError => e + puts "Error when calling EndpointsApi->list_endpoints: #{e}" +end +``` + +#### Using the list_endpoints_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> list_endpoints_with_http_info(account_id, opts) + +```ruby +begin + # List Endpoints + data, status_code, headers = api_instance.list_endpoints_with_http_info(account_id, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue Bandwidth::ApiError => e + puts "Error when calling EndpointsApi->list_endpoints_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **account_id** | **String** | Your Bandwidth Account ID. | | +| **type** | [**EndpointTypeEnum**](.md) | The type of endpoint. | [optional] | +| **status** | [**EndpointStatusEnum**](.md) | The status of the endpoint. | [optional] | +| **after_cursor** | **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 + + +## update_endpoint_bxml + +> update_endpoint_bxml(account_id, endpoint_id, body) + +Update Endpoint BXML + +Updates the BXML for the specified endpoint. + +### Examples + +```ruby +require 'time' +require 'bandwidth-sdk' +# setup authorization +Bandwidth.configure do |config| + # Configure HTTP basic authorization: Basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' + + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = Bandwidth::EndpointsApi.new +account_id = '9900000' # String | Your Bandwidth Account ID. +endpoint_id = 'e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | BRTC Endpoint ID. +body = 'body_example' # String | + +begin + # Update Endpoint BXML + api_instance.update_endpoint_bxml(account_id, endpoint_id, body) +rescue Bandwidth::ApiError => e + puts "Error when calling EndpointsApi->update_endpoint_bxml: #{e}" +end +``` + +#### Using the update_endpoint_bxml_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> update_endpoint_bxml_with_http_info(account_id, endpoint_id, body) + +```ruby +begin + # Update Endpoint BXML + data, status_code, headers = api_instance.update_endpoint_bxml_with_http_info(account_id, endpoint_id, body) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue Bandwidth::ApiError => e + puts "Error when calling EndpointsApi->update_endpoint_bxml_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **account_id** | **String** | Your Bandwidth Account ID. | | +| **endpoint_id** | **String** | BRTC Endpoint ID. | | +| **body** | **String** | | | + +### Return type + +nil (empty response body) + +### Authorization + +[Basic](../README.md#Basic), [OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/xml +- **Accept**: application/json + diff --git a/docs/InboundCallback.md b/docs/InboundCallback.md index a2016c4c..fa978ac0 100644 --- a/docs/InboundCallback.md +++ b/docs/InboundCallback.md @@ -6,10 +6,10 @@ | ---- | ---- | ----------- | ----- | | **time** | **Time** | | | | **type** | [**InboundCallbackTypeEnum**](InboundCallbackTypeEnum.md) | | | -| **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) | | | -| **carrier_name** | **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] | +| **carrier_name** | **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] | ## Example diff --git a/docs/ListEndpointsResponse.md b/docs/ListEndpointsResponse.md new file mode 100644 index 00000000..d9388cdb --- /dev/null +++ b/docs/ListEndpointsResponse.md @@ -0,0 +1,24 @@ +# Bandwidth::ListEndpointsResponse + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **links** | [**Array<BrtcLink>**](BrtcLink.md) | | | +| **page** | [**Page**](Page.md) | | [optional] | +| **data** | [**Array<Endpoints>**](Endpoints.md) | | | +| **errors** | [**Array<BrtcError>**](BrtcError.md) | | | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::ListEndpointsResponse.new( + links: null, + page: null, + data: null, + errors: null +) +``` + diff --git a/docs/LookupResult.md b/docs/LookupResult.md index d6c0079c..a0c2aef2 100644 --- a/docs/LookupResult.md +++ b/docs/LookupResult.md @@ -13,7 +13,7 @@ | **deactivation_date** | **String** | [DNI-Only](#section/DNI-Only). The datetime the carrier reported a deactivation event. | [optional] | | **deactivation_event** | [**DeactivationEventEnum**](DeactivationEventEnum.md) | | [optional] | | **latest_message_delivery_status** | [**LatestMessageDeliveryStatusEnum**](LatestMessageDeliveryStatusEnum.md) | | [optional] | -| **initial_message_delivery_status_date** | **Date** | [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] | +| **initial_message_delivery_status_date** | **Date** | [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] | | **latest_message_delivery_status_date** | **Date** | [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] | | **rcs_enabled** | **Boolean** | [RCS-Only](#section/RCS-Only). Indicates whether the phone number is capable of receiving RCS messages. Value will be null if account has RCS, but no value was returned. Absent when account does not have RCS. | [optional] | diff --git a/docs/MachineDetectionConfiguration.md b/docs/MachineDetectionConfiguration.md index 737b3da4..17891c07 100644 --- a/docs/MachineDetectionConfiguration.md +++ b/docs/MachineDetectionConfiguration.md @@ -9,7 +9,7 @@ | **silence_timeout** | **Float** | If no speech is detected in this period, a callback with a 'silence' result is sent. | [optional][default to 10] | | **speech_threshold** | **Float** | 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'. | [optional][default to 10] | | **speech_end_threshold** | **Float** | Amount of silence (in seconds) before assuming the callee has finished speaking. | [optional][default to 5] | -| **machine_speech_end_threshold** | **Float** | 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. | [optional] | +| **machine_speech_end_threshold** | **Float** | 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. | [optional] | | **delay_result** | **Boolean** | 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. | [optional][default to false] | | **callback_url** | **String** | The URL to send the 'machineDetectionComplete' webhook when the detection is completed. Only for 'async' mode. | [optional] | | **callback_method** | [**CallbackMethodEnum**](CallbackMethodEnum.md) | | [optional][default to 'POST'] | diff --git a/docs/MessageRequest.md b/docs/MessageRequest.md index 5c5bc15a..683d9681 100644 --- a/docs/MessageRequest.md +++ b/docs/MessageRequest.md @@ -6,7 +6,7 @@ | ---- | ---- | ----------- | ----- | | **application_id** | **String** | The ID of the Application your from number or senderId is associated with in the Bandwidth App. | | | **to** | **Array<String>** | The phone number(s) the message should be sent to in E164 format. | | -| **from** | **String** | 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. | | +| **from** | **String** | 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. | | | **text** | **String** | The contents of the text message. Must be 2048 characters or less. | [optional] | | **media** | **Array<String>** | A list of URLs to include as media attachments as part of the message. Each URL can be at most 4096 characters. | [optional] | | **tag** | **String** | A custom string that will be included in callback events of the message. Max 1024 characters. | [optional] | diff --git a/docs/Page.md b/docs/Page.md new file mode 100644 index 00000000..76cdf675 --- /dev/null +++ b/docs/Page.md @@ -0,0 +1,24 @@ +# Bandwidth::Page + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **page_size** | **Integer** | The number of items per page. | | +| **total_elements** | **Integer** | The total number of items. | [optional] | +| **total_pages** | **Integer** | The total number of pages. | [optional] | +| **page_number** | **Integer** | The current page number. | [optional] | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::Page.new( + page_size: 10, + total_elements: 100, + total_pages: 10, + page_number: 0 +) +``` + diff --git a/docs/RbmActionBase.md b/docs/RbmActionBase.md index b67a76b6..546ff597 100644 --- a/docs/RbmActionBase.md +++ b/docs/RbmActionBase.md @@ -16,7 +16,7 @@ require 'bandwidth-sdk' instance = Bandwidth::RbmActionBase.new( type: null, text: Hello world, - postback_data: [B@662d3e85 + postback_data: [B@ec70725 ) ``` diff --git a/docs/RbmSuggestionResponse.md b/docs/RbmSuggestionResponse.md index 2aa64e13..be7d438d 100644 --- a/docs/RbmSuggestionResponse.md +++ b/docs/RbmSuggestionResponse.md @@ -14,7 +14,7 @@ require 'bandwidth-sdk' instance = Bandwidth::RbmSuggestionResponse.new( text: Yes, I would like to proceed, - postback_data: [B@662d3e85 + postback_data: [B@ec70725 ) ``` diff --git a/docs/SipConnectionMetadata.md b/docs/SipConnectionMetadata.md new file mode 100644 index 00000000..afdf8158 --- /dev/null +++ b/docs/SipConnectionMetadata.md @@ -0,0 +1,24 @@ +# Bandwidth::SipConnectionMetadata + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **ip_address** | **String** | The IP address of the SIP connection. | [optional] | +| **port** | **Integer** | The port of the SIP connection. | [optional] | +| **credentials** | [**SipCredentials**](SipCredentials.md) | | [optional] | +| **uui_header** | **String** | The User-to-User Information header for the SIP connection. | [optional] | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::SipConnectionMetadata.new( + ip_address: 192.168.0.0, + port: 5060, + credentials: null, + uui_header: my-uui-header +) +``` + diff --git a/docs/SipCredentials.md b/docs/SipCredentials.md new file mode 100644 index 00000000..c448769e --- /dev/null +++ b/docs/SipCredentials.md @@ -0,0 +1,20 @@ +# Bandwidth::SipCredentials + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **username** | **String** | The username for the SIP connection. | [optional] | +| **password** | **String** | The password for the SIP connection. | [optional] | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::SipCredentials.new( + username: username, + password: password +) +``` + diff --git a/docs/StatusCallback.md b/docs/StatusCallback.md index 9de1c748..35de1bfa 100644 --- a/docs/StatusCallback.md +++ b/docs/StatusCallback.md @@ -11,7 +11,7 @@ | **description** | **String** | A detailed description of the event described by the callback. | | | **message** | [**StatusCallbackMessage**](StatusCallbackMessage.md) | | | | **error_code** | **Integer** | Optional error code, applicable only when type is `message-failed`. | [optional] | -| **carrier_name** | **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] | +| **carrier_name** | **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] | ## Example diff --git a/docs/UpdateCall.md b/docs/UpdateCall.md index f8f4a16f..31c5c67a 100644 --- a/docs/UpdateCall.md +++ b/docs/UpdateCall.md @@ -13,7 +13,7 @@ | **redirect_fallback_method** | [**RedirectMethodEnum**](RedirectMethodEnum.md) | | [optional][default to 'POST'] | | **fallback_username** | **String** | Basic auth username. | [optional] | | **fallback_password** | **String** | Basic auth password. | [optional] | -| **tag** | **String** | A custom string that will be sent with this and all future callbacks unless overwritten by a future `tag` attribute or [`<Tag>`](/docs/voice/bxml/tag) verb, or cleared. May be cleared by setting `tag=\"\"`. Max length 256 characters. Not allowed if `state` is `completed`. | [optional] | +| **tag** | **String** | A custom string that will be sent with this and all future callbacks unless overwritten by a future `tag` attribute or [`<Tag>`](/docs/voice/bxml/tag) verb, or cleared. May be cleared by setting `tag=\"\"`. Max length 4096 characters. Not allowed if `state` is `completed`. | [optional] | ## Example diff --git a/docs/WebhookSubscriptionError.md b/docs/WebhookSubscriptionError.md new file mode 100644 index 00000000..618eecc1 --- /dev/null +++ b/docs/WebhookSubscriptionError.md @@ -0,0 +1,22 @@ +# Bandwidth::WebhookSubscriptionError + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **code** | **Integer** | | [optional] | +| **description** | **String** | | [optional] | +| **telephone_numbers** | [**Array<TelephoneNumber>**](TelephoneNumber.md) | | [optional] | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::WebhookSubscriptionError.new( + code: null, + description: null, + telephone_numbers: null +) +``` + diff --git a/docs/WebhookSubscriptionsListBody.md b/docs/WebhookSubscriptionsListBody.md index 5b85e830..6d459c63 100644 --- a/docs/WebhookSubscriptionsListBody.md +++ b/docs/WebhookSubscriptionsListBody.md @@ -5,7 +5,7 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | **links** | [**LinksObject**](LinksObject.md) | | [optional] | -| **errors** | [**Array<Error>**](Error.md) | | [optional] | +| **errors** | [**Array<WebhookSubscriptionError>**](WebhookSubscriptionError.md) | | [optional] | | **data** | [**Array<WebhookSubscription>**](WebhookSubscription.md) | | | ## Example diff --git a/lib/bandwidth-sdk.rb b/lib/bandwidth-sdk.rb index 718f3ece..a15c309c 100644 --- a/lib/bandwidth-sdk.rb +++ b/lib/bandwidth-sdk.rb @@ -26,6 +26,10 @@ require 'bandwidth-sdk/models/blocked_webhook' require 'bandwidth-sdk/models/bridge_complete_callback' require 'bandwidth-sdk/models/bridge_target_complete_callback' +require 'bandwidth-sdk/models/brtc_error' +require 'bandwidth-sdk/models/brtc_error_response' +require 'bandwidth-sdk/models/brtc_error_source' +require 'bandwidth-sdk/models/brtc_link' require 'bandwidth-sdk/models/business_entity_type_enum' require 'bandwidth-sdk/models/business_registration_type_enum' require 'bandwidth-sdk/models/call_direction_enum' @@ -57,15 +61,28 @@ require 'bandwidth-sdk/models/create_async_bulk_lookup_response_data' require 'bandwidth-sdk/models/create_call' require 'bandwidth-sdk/models/create_call_response' +require 'bandwidth-sdk/models/create_endpoint_request_base' +require 'bandwidth-sdk/models/create_endpoint_response' +require 'bandwidth-sdk/models/create_endpoint_response_data' require 'bandwidth-sdk/models/create_message_request_error' require 'bandwidth-sdk/models/create_multi_channel_message_response' require 'bandwidth-sdk/models/create_sync_lookup_response' require 'bandwidth-sdk/models/create_sync_lookup_response_data' +require 'bandwidth-sdk/models/create_web_rtc_connection_request' require 'bandwidth-sdk/models/deactivation_event_enum' +require 'bandwidth-sdk/models/device' +require 'bandwidth-sdk/models/device_status_enum' require 'bandwidth-sdk/models/disconnect_callback' require 'bandwidth-sdk/models/diversion' require 'bandwidth-sdk/models/dtmf_callback' -require 'bandwidth-sdk/models/error' +require 'bandwidth-sdk/models/endpoint' +require 'bandwidth-sdk/models/endpoint_direction_enum' +require 'bandwidth-sdk/models/endpoint_event' +require 'bandwidth-sdk/models/endpoint_event_type_enum' +require 'bandwidth-sdk/models/endpoint_response' +require 'bandwidth-sdk/models/endpoint_status_enum' +require 'bandwidth-sdk/models/endpoint_type_enum' +require 'bandwidth-sdk/models/endpoints' require 'bandwidth-sdk/models/error_object' require 'bandwidth-sdk/models/error_source' require 'bandwidth-sdk/models/failure_webhook' @@ -84,6 +101,7 @@ require 'bandwidth-sdk/models/link' require 'bandwidth-sdk/models/link_schema' require 'bandwidth-sdk/models/links_object' +require 'bandwidth-sdk/models/list_endpoints_response' require 'bandwidth-sdk/models/list_message_direction_enum' require 'bandwidth-sdk/models/list_message_item' require 'bandwidth-sdk/models/lookup_error_response' @@ -127,6 +145,7 @@ require 'bandwidth-sdk/models/multi_channel_message_request' require 'bandwidth-sdk/models/multi_channel_message_response_data' require 'bandwidth-sdk/models/opt_in_workflow' +require 'bandwidth-sdk/models/page' require 'bandwidth-sdk/models/page_info' require 'bandwidth-sdk/models/priority_enum' require 'bandwidth-sdk/models/product_type_enum' @@ -155,6 +174,8 @@ require 'bandwidth-sdk/models/recording_transcriptions' require 'bandwidth-sdk/models/redirect_callback' require 'bandwidth-sdk/models/redirect_method_enum' +require 'bandwidth-sdk/models/sip_connection_metadata' +require 'bandwidth-sdk/models/sip_credentials' require 'bandwidth-sdk/models/sms_message_content' require 'bandwidth-sdk/models/standalone_card_orientation_enum' require 'bandwidth-sdk/models/status_callback' @@ -191,6 +212,7 @@ require 'bandwidth-sdk/models/voice_code_response' require 'bandwidth-sdk/models/webhook_subscription' require 'bandwidth-sdk/models/webhook_subscription_basic_authentication' +require 'bandwidth-sdk/models/webhook_subscription_error' require 'bandwidth-sdk/models/webhook_subscription_request_schema' require 'bandwidth-sdk/models/webhook_subscription_type_enum' require 'bandwidth-sdk/models/webhook_subscriptions_list_body' @@ -233,6 +255,7 @@ # APIs require 'bandwidth-sdk/api/calls_api' require 'bandwidth-sdk/api/conferences_api' +require 'bandwidth-sdk/api/endpoints_api' require 'bandwidth-sdk/api/mfa_api' require 'bandwidth-sdk/api/media_api' require 'bandwidth-sdk/api/messages_api' diff --git a/lib/bandwidth-sdk/api/endpoints_api.rb b/lib/bandwidth-sdk/api/endpoints_api.rb new file mode 100644 index 00000000..e669fe2d --- /dev/null +++ b/lib/bandwidth-sdk/api/endpoints_api.rb @@ -0,0 +1,397 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +Generator version: 7.17.0 + +=end + +require 'cgi' + +module Bandwidth + class EndpointsApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + # Create Endpoint + # Creates a new Endpoint for the specified account. + # @param account_id [String] Your Bandwidth Account ID. + # @param body [CreateWebRtcConnectionRequest] + # @param [Hash] opts the optional parameters + # @return [CreateEndpointResponse] + def create_endpoint(account_id, body, opts = {}) + data, _status_code, _headers = create_endpoint_with_http_info(account_id, body, opts) + data + end + + # Create Endpoint + # Creates a new Endpoint for the specified account. + # @param account_id [String] Your Bandwidth Account ID. + # @param body [CreateWebRtcConnectionRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(CreateEndpointResponse, Integer, Hash)>] CreateEndpointResponse data, response status code and response headers + def create_endpoint_with_http_info(account_id, body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: EndpointsApi.create_endpoint ...' + end + # verify the required parameter 'account_id' is set + if @api_client.config.client_side_validation && account_id.nil? + fail ArgumentError, "Missing the required parameter 'account_id' when calling EndpointsApi.create_endpoint" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling EndpointsApi.create_endpoint" + end + # resource path + local_var_path = '/accounts/{accountId}/endpoints'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'CreateEndpointResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['Basic', 'OAuth2'] + + new_options = opts.merge( + :operation => :"EndpointsApi.create_endpoint", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: EndpointsApi#create_endpoint\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Delete Endpoint + # Deletes the specified endpoint. If the endpoint is actively streaming media, the media stream will be terminated. + # @param account_id [String] Your Bandwidth Account ID. + # @param endpoint_id [String] BRTC Endpoint ID. + # @param [Hash] opts the optional parameters + # @return [nil] + def delete_endpoint(account_id, endpoint_id, opts = {}) + delete_endpoint_with_http_info(account_id, endpoint_id, opts) + nil + end + + # Delete Endpoint + # Deletes the specified endpoint. If the endpoint is actively streaming media, the media stream will be terminated. + # @param account_id [String] Your Bandwidth Account ID. + # @param endpoint_id [String] BRTC Endpoint ID. + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_endpoint_with_http_info(account_id, endpoint_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: EndpointsApi.delete_endpoint ...' + end + # verify the required parameter 'account_id' is set + if @api_client.config.client_side_validation && account_id.nil? + fail ArgumentError, "Missing the required parameter 'account_id' when calling EndpointsApi.delete_endpoint" + end + # verify the required parameter 'endpoint_id' is set + if @api_client.config.client_side_validation && endpoint_id.nil? + fail ArgumentError, "Missing the required parameter 'endpoint_id' when calling EndpointsApi.delete_endpoint" + end + # resource path + local_var_path = '/accounts/{accountId}/endpoints/{endpointId}'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'endpointId' + '}', CGI.escape(endpoint_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || ['Basic', 'OAuth2'] + + new_options = opts.merge( + :operation => :"EndpointsApi.delete_endpoint", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: EndpointsApi#delete_endpoint\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get Endpoint + # Returns information about the specified endpoint. + # @param account_id [String] Your Bandwidth Account ID. + # @param endpoint_id [String] BRTC Endpoint ID. + # @param [Hash] opts the optional parameters + # @return [EndpointResponse] + def get_endpoint(account_id, endpoint_id, opts = {}) + data, _status_code, _headers = get_endpoint_with_http_info(account_id, endpoint_id, opts) + data + end + + # Get Endpoint + # Returns information about the specified endpoint. + # @param account_id [String] Your Bandwidth Account ID. + # @param endpoint_id [String] BRTC Endpoint ID. + # @param [Hash] opts the optional parameters + # @return [Array<(EndpointResponse, Integer, Hash)>] EndpointResponse data, response status code and response headers + def get_endpoint_with_http_info(account_id, endpoint_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: EndpointsApi.get_endpoint ...' + end + # verify the required parameter 'account_id' is set + if @api_client.config.client_side_validation && account_id.nil? + fail ArgumentError, "Missing the required parameter 'account_id' when calling EndpointsApi.get_endpoint" + end + # verify the required parameter 'endpoint_id' is set + if @api_client.config.client_side_validation && endpoint_id.nil? + fail ArgumentError, "Missing the required parameter 'endpoint_id' when calling EndpointsApi.get_endpoint" + end + # resource path + local_var_path = '/accounts/{accountId}/endpoints/{endpointId}'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'endpointId' + '}', CGI.escape(endpoint_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'EndpointResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['Basic', 'OAuth2'] + + new_options = opts.merge( + :operation => :"EndpointsApi.get_endpoint", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: EndpointsApi#get_endpoint\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List Endpoints + # Returns a list of endpoints associated with the specified account. + # @param account_id [String] Your Bandwidth Account ID. + # @param [Hash] opts the optional parameters + # @option opts [EndpointTypeEnum] :type The type of endpoint. + # @option opts [EndpointStatusEnum] :status The status of the endpoint. + # @option opts [String] :after_cursor The cursor to use for pagination. This is the value of the `next` link in the previous response. + # @option opts [Integer] :limit The maximum number of endpoints to return in the response. (default to 100) + # @return [ListEndpointsResponse] + def list_endpoints(account_id, opts = {}) + data, _status_code, _headers = list_endpoints_with_http_info(account_id, opts) + data + end + + # List Endpoints + # Returns a list of endpoints associated with the specified account. + # @param account_id [String] Your Bandwidth Account ID. + # @param [Hash] opts the optional parameters + # @option opts [EndpointTypeEnum] :type The type of endpoint. + # @option opts [EndpointStatusEnum] :status The status of the endpoint. + # @option opts [String] :after_cursor The cursor to use for pagination. This is the value of the `next` link in the previous response. + # @option opts [Integer] :limit The maximum number of endpoints to return in the response. (default to 100) + # @return [Array<(ListEndpointsResponse, Integer, Hash)>] ListEndpointsResponse data, response status code and response headers + def list_endpoints_with_http_info(account_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: EndpointsApi.list_endpoints ...' + end + # verify the required parameter 'account_id' is set + if @api_client.config.client_side_validation && account_id.nil? + fail ArgumentError, "Missing the required parameter 'account_id' when calling EndpointsApi.list_endpoints" + end + if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 1000 + fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling EndpointsApi.list_endpoints, must be smaller than or equal to 1000.' + end + + if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1 + fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling EndpointsApi.list_endpoints, must be greater than or equal to 1.' + end + + # resource path + local_var_path = '/accounts/{accountId}/endpoints'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil? + query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil? + query_params[:'afterCursor'] = opts[:'after_cursor'] if !opts[:'after_cursor'].nil? + query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'ListEndpointsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['Basic', 'OAuth2'] + + new_options = opts.merge( + :operation => :"EndpointsApi.list_endpoints", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: EndpointsApi#list_endpoints\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Update Endpoint BXML + # Updates the BXML for the specified endpoint. + # @param account_id [String] Your Bandwidth Account ID. + # @param endpoint_id [String] BRTC Endpoint ID. + # @param body [String] + # @param [Hash] opts the optional parameters + # @return [nil] + def update_endpoint_bxml(account_id, endpoint_id, body, opts = {}) + update_endpoint_bxml_with_http_info(account_id, endpoint_id, body, opts) + nil + end + + # Update Endpoint BXML + # Updates the BXML for the specified endpoint. + # @param account_id [String] Your Bandwidth Account ID. + # @param endpoint_id [String] BRTC Endpoint ID. + # @param body [String] + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def update_endpoint_bxml_with_http_info(account_id, endpoint_id, body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: EndpointsApi.update_endpoint_bxml ...' + end + # verify the required parameter 'account_id' is set + if @api_client.config.client_side_validation && account_id.nil? + fail ArgumentError, "Missing the required parameter 'account_id' when calling EndpointsApi.update_endpoint_bxml" + end + # verify the required parameter 'endpoint_id' is set + if @api_client.config.client_side_validation && endpoint_id.nil? + fail ArgumentError, "Missing the required parameter 'endpoint_id' when calling EndpointsApi.update_endpoint_bxml" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling EndpointsApi.update_endpoint_bxml" + end + # resource path + local_var_path = '/accounts/{accountId}/endpoints/{endpointId}/bxml'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'endpointId' + '}', CGI.escape(endpoint_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/xml']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || ['Basic', 'OAuth2'] + + new_options = opts.merge( + :operation => :"EndpointsApi.update_endpoint_bxml", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: EndpointsApi#update_endpoint_bxml\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/lib/bandwidth-sdk/configuration.rb b/lib/bandwidth-sdk/configuration.rb index 3ec4c23b..010085e1 100644 --- a/lib/bandwidth-sdk/configuration.rb +++ b/lib/bandwidth-sdk/configuration.rb @@ -403,6 +403,36 @@ def operation_server_settings description: "Production", } ], + "EndpointsApi.create_endpoint": [ + { + url: "https://api.bandwidth.com/v2", + description: "Production", + } + ], + "EndpointsApi.delete_endpoint": [ + { + url: "https://api.bandwidth.com/v2", + description: "Production", + } + ], + "EndpointsApi.get_endpoint": [ + { + url: "https://api.bandwidth.com/v2", + description: "Production", + } + ], + "EndpointsApi.list_endpoints": [ + { + url: "https://api.bandwidth.com/v2", + description: "Production", + } + ], + "EndpointsApi.update_endpoint_bxml": [ + { + url: "https://api.bandwidth.com/v2", + description: "Production", + } + ], "MFAApi.generate_messaging_code": [ { url: "https://mfa.bandwidth.com/api/v1", diff --git a/lib/bandwidth-sdk/models/brtc_error.rb b/lib/bandwidth-sdk/models/brtc_error.rb new file mode 100644 index 00000000..3160799e --- /dev/null +++ b/lib/bandwidth-sdk/models/brtc_error.rb @@ -0,0 +1,219 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +Generator version: 7.17.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + class BrtcError < ApiModelBase + # A unique identifier for the error. + attr_accessor :id + + # The type of error. + attr_accessor :type + + # A description of the error. + attr_accessor :description + + # A code that uniquely identifies the error. + attr_accessor :code + + attr_accessor :source + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id', + :'type' => :'type', + :'description' => :'description', + :'code' => :'code', + :'source' => :'source' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'id' => :'String', + :'type' => :'String', + :'description' => :'String', + :'code' => :'String', + :'source' => :'BrtcErrorSource' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::BrtcError` initialize method' + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::BrtcError`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + else + self.type = nil + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + else + self.description = nil + end + + if attributes.key?(:'code') + self.code = attributes[:'code'] + end + + if attributes.key?(:'source') + self.source = attributes[:'source'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @type.nil? + invalid_properties.push('invalid value for "type", type cannot be nil.') + end + + if @description.nil? + invalid_properties.push('invalid value for "description", description cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @type.nil? + return false if @description.nil? + true + end + + # Custom attribute writer method with validation + # @param [Object] type Value to be assigned + def type=(type) + if type.nil? + fail ArgumentError, 'type cannot be nil' + end + + @type = type + end + + # Custom attribute writer method with validation + # @param [Object] description Value to be assigned + def description=(description) + if description.nil? + fail ArgumentError, 'description cannot be nil' + end + + @description = description + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + type == o.type && + description == o.description && + code == o.code && + source == o.source + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [id, type, description, code, source].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + end +end diff --git a/lib/bandwidth-sdk/models/brtc_error_response.rb b/lib/bandwidth-sdk/models/brtc_error_response.rb new file mode 100644 index 00000000..62d1ba35 --- /dev/null +++ b/lib/bandwidth-sdk/models/brtc_error_response.rb @@ -0,0 +1,204 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +Generator version: 7.17.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + class BrtcErrorResponse < ApiModelBase + attr_accessor :links + + attr_accessor :data + + attr_accessor :errors + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'links' => :'links', + :'data' => :'data', + :'errors' => :'errors' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'links' => :'Array', + :'data' => :'Object', + :'errors' => :'Array' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'data', + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::BrtcErrorResponse` initialize method' + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::BrtcErrorResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'links') + if (value = attributes[:'links']).is_a?(Array) + self.links = value + end + else + self.links = nil + end + + if attributes.key?(:'data') + self.data = attributes[:'data'] + else + self.data = nil + end + + if attributes.key?(:'errors') + if (value = attributes[:'errors']).is_a?(Array) + self.errors = value + end + else + self.errors = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @links.nil? + invalid_properties.push('invalid value for "links", links cannot be nil.') + end + + if @errors.nil? + invalid_properties.push('invalid value for "errors", errors cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @links.nil? + return false if @errors.nil? + true + end + + # Custom attribute writer method with validation + # @param [Object] links Value to be assigned + def links=(links) + if links.nil? + fail ArgumentError, 'links cannot be nil' + end + + @links = links + end + + # Custom attribute writer method with validation + # @param [Object] errors Value to be assigned + def errors=(errors) + if errors.nil? + fail ArgumentError, 'errors cannot be nil' + end + + @errors = errors + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + links == o.links && + data == o.data && + errors == o.errors + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [links, data, errors].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + end +end diff --git a/lib/bandwidth-sdk/models/brtc_error_source.rb b/lib/bandwidth-sdk/models/brtc_error_source.rb new file mode 100644 index 00000000..1b3d3a18 --- /dev/null +++ b/lib/bandwidth-sdk/models/brtc_error_source.rb @@ -0,0 +1,176 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +Generator version: 7.17.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + class BrtcErrorSource < ApiModelBase + # The URI parameter that caused the error. + attr_accessor :parameter + + # The request body field that caused the error. + attr_accessor :field + + # The header that caused the error. + attr_accessor :header + + # The resource ID or path to the resource (or non-existent resource) causing the error. + attr_accessor :reference + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'parameter' => :'parameter', + :'field' => :'field', + :'header' => :'header', + :'reference' => :'reference' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'parameter' => :'String', + :'field' => :'String', + :'header' => :'String', + :'reference' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::BrtcErrorSource` initialize method' + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::BrtcErrorSource`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'parameter') + self.parameter = attributes[:'parameter'] + end + + if attributes.key?(:'field') + self.field = attributes[:'field'] + end + + if attributes.key?(:'header') + self.header = attributes[:'header'] + end + + if attributes.key?(:'reference') + self.reference = attributes[:'reference'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + parameter == o.parameter && + field == o.field && + header == o.header && + reference == o.reference + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [parameter, field, header, reference].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + end +end diff --git a/lib/bandwidth-sdk/models/brtc_link.rb b/lib/bandwidth-sdk/models/brtc_link.rb new file mode 100644 index 00000000..95e957b9 --- /dev/null +++ b/lib/bandwidth-sdk/models/brtc_link.rb @@ -0,0 +1,166 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +Generator version: 7.17.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + class BrtcLink < ApiModelBase + # The full URL of the link. + attr_accessor :href + + # The relationship of the link to the current resource. + attr_accessor :rel + + # The HTTP method to use when making the request. + attr_accessor :method + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'href' => :'href', + :'rel' => :'rel', + :'method' => :'method' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'href' => :'String', + :'rel' => :'String', + :'method' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::BrtcLink` initialize method' + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::BrtcLink`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'href') + self.href = attributes[:'href'] + end + + if attributes.key?(:'rel') + self.rel = attributes[:'rel'] + end + + if attributes.key?(:'method') + self.method = attributes[:'method'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + href == o.href && + rel == o.rel && + method == o.method + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [href, rel, method].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + end +end diff --git a/lib/bandwidth-sdk/models/create_call.rb b/lib/bandwidth-sdk/models/create_call.rb index 8cb833a9..7ca92027 100644 --- a/lib/bandwidth-sdk/models/create_call.rb +++ b/lib/bandwidth-sdk/models/create_call.rb @@ -24,7 +24,7 @@ class CreateCall < ApiModelBase # Hide the calling number. The `displayName` field can be used to customize the displayed name. attr_accessor :privacy - # 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`. + # 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`. attr_accessor :display_name # 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. @@ -71,7 +71,7 @@ class CreateCall < ApiModelBase # 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. attr_accessor :priority - # 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. + # 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 4096 characters. attr_accessor :tag class EnumAttributeValidator @@ -380,8 +380,8 @@ def list_invalid_properties invalid_properties.push('invalid value for "priority", must be greater than or equal to 1.') end - if !@tag.nil? && @tag.to_s.length > 256 - invalid_properties.push('invalid value for "tag", the character length must be smaller than or equal to 256.') + if !@tag.nil? && @tag.to_s.length > 4096 + invalid_properties.push('invalid value for "tag", the character length must be smaller than or equal to 4096.') end invalid_properties @@ -409,7 +409,7 @@ def valid? return false if !@callback_timeout.nil? && @callback_timeout < 1 return false if !@priority.nil? && @priority > 5 return false if !@priority.nil? && @priority < 1 - return false if !@tag.nil? && @tag.to_s.length > 256 + return false if !@tag.nil? && @tag.to_s.length > 4096 true end @@ -572,8 +572,8 @@ def priority=(priority) # Custom attribute writer method with validation # @param [Object] tag Value to be assigned def tag=(tag) - if !tag.nil? && tag.to_s.length > 256 - fail ArgumentError, 'invalid value for "tag", the character length must be smaller than or equal to 256.' + if !tag.nil? && tag.to_s.length > 4096 + fail ArgumentError, 'invalid value for "tag", the character length must be smaller than or equal to 4096.' end @tag = tag diff --git a/lib/bandwidth-sdk/models/create_endpoint_request_base.rb b/lib/bandwidth-sdk/models/create_endpoint_request_base.rb new file mode 100644 index 00000000..55ba4815 --- /dev/null +++ b/lib/bandwidth-sdk/models/create_endpoint_request_base.rb @@ -0,0 +1,250 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +Generator version: 7.17.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + class CreateEndpointRequestBase < ApiModelBase + attr_accessor :type + + attr_accessor :direction + + # The URL to send event callbacks to. + attr_accessor :event_callback_url + + # The URL to send event fallbacks to. + attr_accessor :event_fallback_url + + # A tag for the endpoint. + attr_accessor :tag + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'type' => :'type', + :'direction' => :'direction', + :'event_callback_url' => :'eventCallbackUrl', + :'event_fallback_url' => :'eventFallbackUrl', + :'tag' => :'tag' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'type' => :'EndpointTypeEnum', + :'direction' => :'EndpointDirectionEnum', + :'event_callback_url' => :'String', + :'event_fallback_url' => :'String', + :'tag' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::CreateEndpointRequestBase` initialize method' + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::CreateEndpointRequestBase`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'type') + self.type = attributes[:'type'] + else + self.type = nil + end + + if attributes.key?(:'direction') + self.direction = attributes[:'direction'] + else + self.direction = nil + end + + if attributes.key?(:'event_callback_url') + self.event_callback_url = attributes[:'event_callback_url'] + end + + if attributes.key?(:'event_fallback_url') + self.event_fallback_url = attributes[:'event_fallback_url'] + end + + if attributes.key?(:'tag') + self.tag = attributes[:'tag'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @type.nil? + invalid_properties.push('invalid value for "type", type cannot be nil.') + end + + if @direction.nil? + invalid_properties.push('invalid value for "direction", direction cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @type.nil? + return false if @direction.nil? + true + end + + # Custom attribute writer method with validation + # @param [Object] type Value to be assigned + def type=(type) + if type.nil? + fail ArgumentError, 'type cannot be nil' + end + + @type = type + end + + # Custom attribute writer method with validation + # @param [Object] direction Value to be assigned + def direction=(direction) + if direction.nil? + fail ArgumentError, 'direction cannot be nil' + end + + @direction = direction + end + + # Custom attribute writer method with validation + # @param [Object] tag Value to be assigned + def tag=(tag) + if tag.nil? + fail ArgumentError, 'tag cannot be nil' + end + + @tag = tag + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + type == o.type && + direction == o.direction && + event_callback_url == o.event_callback_url && + event_fallback_url == o.event_fallback_url && + tag == o.tag + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [type, direction, event_callback_url, event_fallback_url, tag].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + end +end diff --git a/lib/bandwidth-sdk/models/create_endpoint_response.rb b/lib/bandwidth-sdk/models/create_endpoint_response.rb new file mode 100644 index 00000000..2eed1b00 --- /dev/null +++ b/lib/bandwidth-sdk/models/create_endpoint_response.rb @@ -0,0 +1,218 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +Generator version: 7.17.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + class CreateEndpointResponse < ApiModelBase + attr_accessor :links + + attr_accessor :data + + attr_accessor :errors + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'links' => :'links', + :'data' => :'data', + :'errors' => :'errors' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'links' => :'Array', + :'data' => :'CreateEndpointResponseData', + :'errors' => :'Array' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::CreateEndpointResponse` initialize method' + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::CreateEndpointResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'links') + if (value = attributes[:'links']).is_a?(Array) + self.links = value + end + else + self.links = nil + end + + if attributes.key?(:'data') + self.data = attributes[:'data'] + else + self.data = nil + end + + if attributes.key?(:'errors') + if (value = attributes[:'errors']).is_a?(Array) + self.errors = value + end + else + self.errors = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @links.nil? + invalid_properties.push('invalid value for "links", links cannot be nil.') + end + + if @data.nil? + invalid_properties.push('invalid value for "data", data cannot be nil.') + end + + if @errors.nil? + invalid_properties.push('invalid value for "errors", errors cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @links.nil? + return false if @data.nil? + return false if @errors.nil? + true + end + + # Custom attribute writer method with validation + # @param [Object] links Value to be assigned + def links=(links) + if links.nil? + fail ArgumentError, 'links cannot be nil' + end + + @links = links + end + + # Custom attribute writer method with validation + # @param [Object] data Value to be assigned + def data=(data) + if data.nil? + fail ArgumentError, 'data cannot be nil' + end + + @data = data + end + + # Custom attribute writer method with validation + # @param [Object] errors Value to be assigned + def errors=(errors) + if errors.nil? + fail ArgumentError, 'errors cannot be nil' + end + + @errors = errors + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + links == o.links && + data == o.data && + errors == o.errors + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [links, data, errors].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + end +end diff --git a/lib/bandwidth-sdk/models/create_endpoint_response_data.rb b/lib/bandwidth-sdk/models/create_endpoint_response_data.rb new file mode 100644 index 00000000..a095f465 --- /dev/null +++ b/lib/bandwidth-sdk/models/create_endpoint_response_data.rb @@ -0,0 +1,356 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +Generator version: 7.17.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + class CreateEndpointResponseData < ApiModelBase + # The unique ID of the endpoint. + attr_accessor :endpoint_id + + attr_accessor :type + + attr_accessor :status + + # The time the endpoint was created. In ISO-8601 format. + attr_accessor :creation_timestamp + + # The time the endpoint token will expire. In ISO-8601 format. Tokens last 24 hours. + attr_accessor :expiration_timestamp + + # A tag for the endpoint. + attr_accessor :tag + + attr_accessor :devices + + # The json web token specific to the endpoint. Used to authenticate the client with the media gateway. + attr_accessor :token + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'endpoint_id' => :'endpointId', + :'type' => :'type', + :'status' => :'status', + :'creation_timestamp' => :'creationTimestamp', + :'expiration_timestamp' => :'expirationTimestamp', + :'tag' => :'tag', + :'devices' => :'devices', + :'token' => :'token' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'endpoint_id' => :'String', + :'type' => :'EndpointTypeEnum', + :'status' => :'EndpointStatusEnum', + :'creation_timestamp' => :'Time', + :'expiration_timestamp' => :'Time', + :'tag' => :'String', + :'devices' => :'Array', + :'token' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # List of class defined in allOf (OpenAPI v3) + def self.openapi_all_of + [ + :'Endpoint' + ] + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::CreateEndpointResponseData` initialize method' + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::CreateEndpointResponseData`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'endpoint_id') + self.endpoint_id = attributes[:'endpoint_id'] + else + self.endpoint_id = nil + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + else + self.type = nil + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + else + self.status = nil + end + + if attributes.key?(:'creation_timestamp') + self.creation_timestamp = attributes[:'creation_timestamp'] + else + self.creation_timestamp = nil + end + + if attributes.key?(:'expiration_timestamp') + self.expiration_timestamp = attributes[:'expiration_timestamp'] + else + self.expiration_timestamp = nil + end + + if attributes.key?(:'tag') + self.tag = attributes[:'tag'] + end + + if attributes.key?(:'devices') + if (value = attributes[:'devices']).is_a?(Array) + self.devices = value + end + end + + if attributes.key?(:'token') + self.token = attributes[:'token'] + else + self.token = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @endpoint_id.nil? + invalid_properties.push('invalid value for "endpoint_id", endpoint_id cannot be nil.') + end + + if @type.nil? + invalid_properties.push('invalid value for "type", type cannot be nil.') + end + + if @status.nil? + invalid_properties.push('invalid value for "status", status cannot be nil.') + end + + if @creation_timestamp.nil? + invalid_properties.push('invalid value for "creation_timestamp", creation_timestamp cannot be nil.') + end + + if @expiration_timestamp.nil? + invalid_properties.push('invalid value for "expiration_timestamp", expiration_timestamp cannot be nil.') + end + + if @token.nil? + invalid_properties.push('invalid value for "token", token cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @endpoint_id.nil? + return false if @type.nil? + return false if @status.nil? + return false if @creation_timestamp.nil? + return false if @expiration_timestamp.nil? + return false if @token.nil? + true + end + + # Custom attribute writer method with validation + # @param [Object] endpoint_id Value to be assigned + def endpoint_id=(endpoint_id) + if endpoint_id.nil? + fail ArgumentError, 'endpoint_id cannot be nil' + end + + @endpoint_id = endpoint_id + end + + # Custom attribute writer method with validation + # @param [Object] type Value to be assigned + def type=(type) + if type.nil? + fail ArgumentError, 'type cannot be nil' + end + + @type = type + end + + # Custom attribute writer method with validation + # @param [Object] status Value to be assigned + def status=(status) + if status.nil? + fail ArgumentError, 'status cannot be nil' + end + + @status = status + end + + # Custom attribute writer method with validation + # @param [Object] creation_timestamp Value to be assigned + def creation_timestamp=(creation_timestamp) + if creation_timestamp.nil? + fail ArgumentError, 'creation_timestamp cannot be nil' + end + + @creation_timestamp = creation_timestamp + end + + # Custom attribute writer method with validation + # @param [Object] expiration_timestamp Value to be assigned + def expiration_timestamp=(expiration_timestamp) + if expiration_timestamp.nil? + fail ArgumentError, 'expiration_timestamp cannot be nil' + end + + @expiration_timestamp = expiration_timestamp + end + + # Custom attribute writer method with validation + # @param [Object] tag Value to be assigned + def tag=(tag) + if tag.nil? + fail ArgumentError, 'tag cannot be nil' + end + + @tag = tag + end + + # Custom attribute writer method with validation + # @param [Object] token Value to be assigned + def token=(token) + if token.nil? + fail ArgumentError, 'token cannot be nil' + end + + @token = token + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + endpoint_id == o.endpoint_id && + type == o.type && + status == o.status && + creation_timestamp == o.creation_timestamp && + expiration_timestamp == o.expiration_timestamp && + tag == o.tag && + devices == o.devices && + token == o.token + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [endpoint_id, type, status, creation_timestamp, expiration_timestamp, tag, devices, token].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + end +end diff --git a/lib/bandwidth-sdk/models/create_web_rtc_connection_request.rb b/lib/bandwidth-sdk/models/create_web_rtc_connection_request.rb new file mode 100644 index 00000000..d405b090 --- /dev/null +++ b/lib/bandwidth-sdk/models/create_web_rtc_connection_request.rb @@ -0,0 +1,266 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +Generator version: 7.17.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + class CreateWebRtcConnectionRequest < ApiModelBase + attr_accessor :type + + attr_accessor :direction + + # The URL to send event callbacks to. + attr_accessor :event_callback_url + + # The URL to send event fallbacks to. + attr_accessor :event_fallback_url + + # A tag for the endpoint. + attr_accessor :tag + + attr_accessor :connection_metadata + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'type' => :'type', + :'direction' => :'direction', + :'event_callback_url' => :'eventCallbackUrl', + :'event_fallback_url' => :'eventFallbackUrl', + :'tag' => :'tag', + :'connection_metadata' => :'connectionMetadata' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'type' => :'EndpointTypeEnum', + :'direction' => :'EndpointDirectionEnum', + :'event_callback_url' => :'String', + :'event_fallback_url' => :'String', + :'tag' => :'String', + :'connection_metadata' => :'Object' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # List of class defined in allOf (OpenAPI v3) + def self.openapi_all_of + [ + :'CreateEndpointRequestBase' + ] + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::CreateWebRtcConnectionRequest` initialize method' + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::CreateWebRtcConnectionRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'type') + self.type = attributes[:'type'] + else + self.type = nil + end + + if attributes.key?(:'direction') + self.direction = attributes[:'direction'] + else + self.direction = nil + end + + if attributes.key?(:'event_callback_url') + self.event_callback_url = attributes[:'event_callback_url'] + end + + if attributes.key?(:'event_fallback_url') + self.event_fallback_url = attributes[:'event_fallback_url'] + end + + if attributes.key?(:'tag') + self.tag = attributes[:'tag'] + end + + if attributes.key?(:'connection_metadata') + self.connection_metadata = attributes[:'connection_metadata'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @type.nil? + invalid_properties.push('invalid value for "type", type cannot be nil.') + end + + if @direction.nil? + invalid_properties.push('invalid value for "direction", direction cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @type.nil? + return false if @direction.nil? + true + end + + # Custom attribute writer method with validation + # @param [Object] type Value to be assigned + def type=(type) + if type.nil? + fail ArgumentError, 'type cannot be nil' + end + + @type = type + end + + # Custom attribute writer method with validation + # @param [Object] direction Value to be assigned + def direction=(direction) + if direction.nil? + fail ArgumentError, 'direction cannot be nil' + end + + @direction = direction + end + + # Custom attribute writer method with validation + # @param [Object] tag Value to be assigned + def tag=(tag) + if tag.nil? + fail ArgumentError, 'tag cannot be nil' + end + + @tag = tag + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + type == o.type && + direction == o.direction && + event_callback_url == o.event_callback_url && + event_fallback_url == o.event_fallback_url && + tag == o.tag && + connection_metadata == o.connection_metadata + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [type, direction, event_callback_url, event_fallback_url, tag, connection_metadata].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + end +end diff --git a/lib/bandwidth-sdk/models/device.rb b/lib/bandwidth-sdk/models/device.rb new file mode 100644 index 00000000..6d90e2e1 --- /dev/null +++ b/lib/bandwidth-sdk/models/device.rb @@ -0,0 +1,258 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +Generator version: 7.17.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + class Device < ApiModelBase + # The unique ID of the device. + attr_accessor :device_id + + # The name of the device. + attr_accessor :device_name + + attr_accessor :status + + # The time the device was created. In ISO-8601 format. + attr_accessor :creation_timestamp + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'device_id' => :'deviceId', + :'device_name' => :'deviceName', + :'status' => :'status', + :'creation_timestamp' => :'creationTimestamp' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'device_id' => :'String', + :'device_name' => :'String', + :'status' => :'DeviceStatusEnum', + :'creation_timestamp' => :'Time' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::Device` initialize method' + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::Device`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'device_id') + self.device_id = attributes[:'device_id'] + else + self.device_id = nil + end + + if attributes.key?(:'device_name') + self.device_name = attributes[:'device_name'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + else + self.status = nil + end + + if attributes.key?(:'creation_timestamp') + self.creation_timestamp = attributes[:'creation_timestamp'] + else + self.creation_timestamp = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @device_id.nil? + invalid_properties.push('invalid value for "device_id", device_id cannot be nil.') + end + + if @status.nil? + invalid_properties.push('invalid value for "status", status cannot be nil.') + end + + if @creation_timestamp.nil? + invalid_properties.push('invalid value for "creation_timestamp", creation_timestamp cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @device_id.nil? + return false if @status.nil? + return false if @creation_timestamp.nil? + true + end + + # Custom attribute writer method with validation + # @param [Object] device_id Value to be assigned + def device_id=(device_id) + if device_id.nil? + fail ArgumentError, 'device_id cannot be nil' + end + + @device_id = device_id + end + + # Custom attribute writer method with validation + # @param [Object] device_name Value to be assigned + def device_name=(device_name) + if device_name.nil? + fail ArgumentError, 'device_name cannot be nil' + end + + @device_name = device_name + end + + # Custom attribute writer method with validation + # @param [Object] status Value to be assigned + def status=(status) + if status.nil? + fail ArgumentError, 'status cannot be nil' + end + + @status = status + end + + # Custom attribute writer method with validation + # @param [Object] creation_timestamp Value to be assigned + def creation_timestamp=(creation_timestamp) + if creation_timestamp.nil? + fail ArgumentError, 'creation_timestamp cannot be nil' + end + + @creation_timestamp = creation_timestamp + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + device_id == o.device_id && + device_name == o.device_name && + status == o.status && + creation_timestamp == o.creation_timestamp + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [device_id, device_name, status, creation_timestamp].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + end +end diff --git a/lib/bandwidth-sdk/models/device_status_enum.rb b/lib/bandwidth-sdk/models/device_status_enum.rb new file mode 100644 index 00000000..6ed7b323 --- /dev/null +++ b/lib/bandwidth-sdk/models/device_status_enum.rb @@ -0,0 +1,40 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +Generator version: 7.17.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + class DeviceStatusEnum + CONNECTED = 'CONNECTED'.freeze + DISCONNECTED = 'DISCONNECTED'.freeze + + def self.all_vars + @all_vars ||= [CONNECTED, DISCONNECTED].freeze + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + return value if DeviceStatusEnum.all_vars.include?(value) + raise "Invalid ENUM value #{value} for class #DeviceStatusEnum" + end + end +end diff --git a/lib/bandwidth-sdk/models/endpoint.rb b/lib/bandwidth-sdk/models/endpoint.rb new file mode 100644 index 00000000..f1e09036 --- /dev/null +++ b/lib/bandwidth-sdk/models/endpoint.rb @@ -0,0 +1,329 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +Generator version: 7.17.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + class Endpoint < ApiModelBase + # The unique ID of the endpoint. + attr_accessor :endpoint_id + + attr_accessor :type + + attr_accessor :status + + # The time the endpoint was created. In ISO-8601 format. + attr_accessor :creation_timestamp + + # The time the endpoint token will expire. In ISO-8601 format. Tokens last 24 hours. + attr_accessor :expiration_timestamp + + # A tag for the endpoint. + attr_accessor :tag + + attr_accessor :devices + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'endpoint_id' => :'endpointId', + :'type' => :'type', + :'status' => :'status', + :'creation_timestamp' => :'creationTimestamp', + :'expiration_timestamp' => :'expirationTimestamp', + :'tag' => :'tag', + :'devices' => :'devices' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'endpoint_id' => :'String', + :'type' => :'EndpointTypeEnum', + :'status' => :'EndpointStatusEnum', + :'creation_timestamp' => :'Time', + :'expiration_timestamp' => :'Time', + :'tag' => :'String', + :'devices' => :'Array' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # List of class defined in allOf (OpenAPI v3) + def self.openapi_all_of + [ + :'Endpoints' + ] + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::Endpoint` initialize method' + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::Endpoint`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'endpoint_id') + self.endpoint_id = attributes[:'endpoint_id'] + else + self.endpoint_id = nil + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + else + self.type = nil + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + else + self.status = nil + end + + if attributes.key?(:'creation_timestamp') + self.creation_timestamp = attributes[:'creation_timestamp'] + else + self.creation_timestamp = nil + end + + if attributes.key?(:'expiration_timestamp') + self.expiration_timestamp = attributes[:'expiration_timestamp'] + else + self.expiration_timestamp = nil + end + + if attributes.key?(:'tag') + self.tag = attributes[:'tag'] + end + + if attributes.key?(:'devices') + if (value = attributes[:'devices']).is_a?(Array) + self.devices = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @endpoint_id.nil? + invalid_properties.push('invalid value for "endpoint_id", endpoint_id cannot be nil.') + end + + if @type.nil? + invalid_properties.push('invalid value for "type", type cannot be nil.') + end + + if @status.nil? + invalid_properties.push('invalid value for "status", status cannot be nil.') + end + + if @creation_timestamp.nil? + invalid_properties.push('invalid value for "creation_timestamp", creation_timestamp cannot be nil.') + end + + if @expiration_timestamp.nil? + invalid_properties.push('invalid value for "expiration_timestamp", expiration_timestamp cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @endpoint_id.nil? + return false if @type.nil? + return false if @status.nil? + return false if @creation_timestamp.nil? + return false if @expiration_timestamp.nil? + true + end + + # Custom attribute writer method with validation + # @param [Object] endpoint_id Value to be assigned + def endpoint_id=(endpoint_id) + if endpoint_id.nil? + fail ArgumentError, 'endpoint_id cannot be nil' + end + + @endpoint_id = endpoint_id + end + + # Custom attribute writer method with validation + # @param [Object] type Value to be assigned + def type=(type) + if type.nil? + fail ArgumentError, 'type cannot be nil' + end + + @type = type + end + + # Custom attribute writer method with validation + # @param [Object] status Value to be assigned + def status=(status) + if status.nil? + fail ArgumentError, 'status cannot be nil' + end + + @status = status + end + + # Custom attribute writer method with validation + # @param [Object] creation_timestamp Value to be assigned + def creation_timestamp=(creation_timestamp) + if creation_timestamp.nil? + fail ArgumentError, 'creation_timestamp cannot be nil' + end + + @creation_timestamp = creation_timestamp + end + + # Custom attribute writer method with validation + # @param [Object] expiration_timestamp Value to be assigned + def expiration_timestamp=(expiration_timestamp) + if expiration_timestamp.nil? + fail ArgumentError, 'expiration_timestamp cannot be nil' + end + + @expiration_timestamp = expiration_timestamp + end + + # Custom attribute writer method with validation + # @param [Object] tag Value to be assigned + def tag=(tag) + if tag.nil? + fail ArgumentError, 'tag cannot be nil' + end + + @tag = tag + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + endpoint_id == o.endpoint_id && + type == o.type && + status == o.status && + creation_timestamp == o.creation_timestamp && + expiration_timestamp == o.expiration_timestamp && + tag == o.tag && + devices == o.devices + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [endpoint_id, type, status, creation_timestamp, expiration_timestamp, tag, devices].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + end +end diff --git a/lib/bandwidth-sdk/models/endpoint_direction_enum.rb b/lib/bandwidth-sdk/models/endpoint_direction_enum.rb new file mode 100644 index 00000000..a47c7226 --- /dev/null +++ b/lib/bandwidth-sdk/models/endpoint_direction_enum.rb @@ -0,0 +1,41 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +Generator version: 7.17.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + class EndpointDirectionEnum + INBOUND = 'INBOUND'.freeze + OUTBOUND = 'OUTBOUND'.freeze + BIDIRECTIONAL = 'BIDIRECTIONAL'.freeze + + def self.all_vars + @all_vars ||= [INBOUND, OUTBOUND, BIDIRECTIONAL].freeze + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + return value if EndpointDirectionEnum.all_vars.include?(value) + raise "Invalid ENUM value #{value} for class #EndpointDirectionEnum" + end + end +end diff --git a/lib/bandwidth-sdk/models/endpoint_event.rb b/lib/bandwidth-sdk/models/endpoint_event.rb new file mode 100644 index 00000000..b5dca8f1 --- /dev/null +++ b/lib/bandwidth-sdk/models/endpoint_event.rb @@ -0,0 +1,381 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +Generator version: 7.17.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + # An event that occurred on an endpoint. + class EndpointEvent < ApiModelBase + # The unique ID of the endpoint. + attr_accessor :endpoint_id + + attr_accessor :type + + attr_accessor :status + + # The time the endpoint was created. In ISO-8601 format. + attr_accessor :creation_timestamp + + # The time the endpoint token will expire. In ISO-8601 format. Tokens last 24 hours. + attr_accessor :expiration_timestamp + + # A tag for the endpoint. + attr_accessor :tag + + # The time the event occurred. In ISO-8601 format. + attr_accessor :event_time + + attr_accessor :event_type + + attr_accessor :device + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'endpoint_id' => :'endpointId', + :'type' => :'type', + :'status' => :'status', + :'creation_timestamp' => :'creationTimestamp', + :'expiration_timestamp' => :'expirationTimestamp', + :'tag' => :'tag', + :'event_time' => :'eventTime', + :'event_type' => :'eventType', + :'device' => :'device' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'endpoint_id' => :'String', + :'type' => :'EndpointTypeEnum', + :'status' => :'EndpointStatusEnum', + :'creation_timestamp' => :'Time', + :'expiration_timestamp' => :'Time', + :'tag' => :'String', + :'event_time' => :'Time', + :'event_type' => :'EndpointEventTypeEnum', + :'device' => :'Device' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # List of class defined in allOf (OpenAPI v3) + def self.openapi_all_of + [ + :'Endpoints' + ] + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::EndpointEvent` initialize method' + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::EndpointEvent`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'endpoint_id') + self.endpoint_id = attributes[:'endpoint_id'] + else + self.endpoint_id = nil + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + else + self.type = nil + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + else + self.status = nil + end + + if attributes.key?(:'creation_timestamp') + self.creation_timestamp = attributes[:'creation_timestamp'] + else + self.creation_timestamp = nil + end + + if attributes.key?(:'expiration_timestamp') + self.expiration_timestamp = attributes[:'expiration_timestamp'] + else + self.expiration_timestamp = nil + end + + if attributes.key?(:'tag') + self.tag = attributes[:'tag'] + end + + if attributes.key?(:'event_time') + self.event_time = attributes[:'event_time'] + else + self.event_time = nil + end + + if attributes.key?(:'event_type') + self.event_type = attributes[:'event_type'] + else + self.event_type = nil + end + + if attributes.key?(:'device') + self.device = attributes[:'device'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @endpoint_id.nil? + invalid_properties.push('invalid value for "endpoint_id", endpoint_id cannot be nil.') + end + + if @type.nil? + invalid_properties.push('invalid value for "type", type cannot be nil.') + end + + if @status.nil? + invalid_properties.push('invalid value for "status", status cannot be nil.') + end + + if @creation_timestamp.nil? + invalid_properties.push('invalid value for "creation_timestamp", creation_timestamp cannot be nil.') + end + + if @expiration_timestamp.nil? + invalid_properties.push('invalid value for "expiration_timestamp", expiration_timestamp cannot be nil.') + end + + if @event_time.nil? + invalid_properties.push('invalid value for "event_time", event_time cannot be nil.') + end + + if @event_type.nil? + invalid_properties.push('invalid value for "event_type", event_type cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @endpoint_id.nil? + return false if @type.nil? + return false if @status.nil? + return false if @creation_timestamp.nil? + return false if @expiration_timestamp.nil? + return false if @event_time.nil? + return false if @event_type.nil? + true + end + + # Custom attribute writer method with validation + # @param [Object] endpoint_id Value to be assigned + def endpoint_id=(endpoint_id) + if endpoint_id.nil? + fail ArgumentError, 'endpoint_id cannot be nil' + end + + @endpoint_id = endpoint_id + end + + # Custom attribute writer method with validation + # @param [Object] type Value to be assigned + def type=(type) + if type.nil? + fail ArgumentError, 'type cannot be nil' + end + + @type = type + end + + # Custom attribute writer method with validation + # @param [Object] status Value to be assigned + def status=(status) + if status.nil? + fail ArgumentError, 'status cannot be nil' + end + + @status = status + end + + # Custom attribute writer method with validation + # @param [Object] creation_timestamp Value to be assigned + def creation_timestamp=(creation_timestamp) + if creation_timestamp.nil? + fail ArgumentError, 'creation_timestamp cannot be nil' + end + + @creation_timestamp = creation_timestamp + end + + # Custom attribute writer method with validation + # @param [Object] expiration_timestamp Value to be assigned + def expiration_timestamp=(expiration_timestamp) + if expiration_timestamp.nil? + fail ArgumentError, 'expiration_timestamp cannot be nil' + end + + @expiration_timestamp = expiration_timestamp + end + + # Custom attribute writer method with validation + # @param [Object] tag Value to be assigned + def tag=(tag) + if tag.nil? + fail ArgumentError, 'tag cannot be nil' + end + + @tag = tag + end + + # Custom attribute writer method with validation + # @param [Object] event_time Value to be assigned + def event_time=(event_time) + if event_time.nil? + fail ArgumentError, 'event_time cannot be nil' + end + + @event_time = event_time + end + + # Custom attribute writer method with validation + # @param [Object] event_type Value to be assigned + def event_type=(event_type) + if event_type.nil? + fail ArgumentError, 'event_type cannot be nil' + end + + @event_type = event_type + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + endpoint_id == o.endpoint_id && + type == o.type && + status == o.status && + creation_timestamp == o.creation_timestamp && + expiration_timestamp == o.expiration_timestamp && + tag == o.tag && + event_time == o.event_time && + event_type == o.event_type && + device == o.device + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [endpoint_id, type, status, creation_timestamp, expiration_timestamp, tag, event_time, event_type, device].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + end +end diff --git a/lib/bandwidth-sdk/models/endpoint_event_type_enum.rb b/lib/bandwidth-sdk/models/endpoint_event_type_enum.rb new file mode 100644 index 00000000..ccb0036c --- /dev/null +++ b/lib/bandwidth-sdk/models/endpoint_event_type_enum.rb @@ -0,0 +1,40 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +Generator version: 7.17.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + class EndpointEventTypeEnum + DEVICE_CONNECTED = 'DEVICE_CONNECTED'.freeze + DEVICE_DISCONNECTED = 'DEVICE_DISCONNECTED'.freeze + + def self.all_vars + @all_vars ||= [DEVICE_CONNECTED, DEVICE_DISCONNECTED].freeze + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + return value if EndpointEventTypeEnum.all_vars.include?(value) + raise "Invalid ENUM value #{value} for class #EndpointEventTypeEnum" + end + end +end diff --git a/lib/bandwidth-sdk/models/endpoint_response.rb b/lib/bandwidth-sdk/models/endpoint_response.rb new file mode 100644 index 00000000..5497783a --- /dev/null +++ b/lib/bandwidth-sdk/models/endpoint_response.rb @@ -0,0 +1,218 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +Generator version: 7.17.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + class EndpointResponse < ApiModelBase + attr_accessor :links + + attr_accessor :data + + attr_accessor :errors + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'links' => :'links', + :'data' => :'data', + :'errors' => :'errors' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'links' => :'Array', + :'data' => :'Endpoint', + :'errors' => :'Array' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::EndpointResponse` initialize method' + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::EndpointResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'links') + if (value = attributes[:'links']).is_a?(Array) + self.links = value + end + else + self.links = nil + end + + if attributes.key?(:'data') + self.data = attributes[:'data'] + else + self.data = nil + end + + if attributes.key?(:'errors') + if (value = attributes[:'errors']).is_a?(Array) + self.errors = value + end + else + self.errors = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @links.nil? + invalid_properties.push('invalid value for "links", links cannot be nil.') + end + + if @data.nil? + invalid_properties.push('invalid value for "data", data cannot be nil.') + end + + if @errors.nil? + invalid_properties.push('invalid value for "errors", errors cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @links.nil? + return false if @data.nil? + return false if @errors.nil? + true + end + + # Custom attribute writer method with validation + # @param [Object] links Value to be assigned + def links=(links) + if links.nil? + fail ArgumentError, 'links cannot be nil' + end + + @links = links + end + + # Custom attribute writer method with validation + # @param [Object] data Value to be assigned + def data=(data) + if data.nil? + fail ArgumentError, 'data cannot be nil' + end + + @data = data + end + + # Custom attribute writer method with validation + # @param [Object] errors Value to be assigned + def errors=(errors) + if errors.nil? + fail ArgumentError, 'errors cannot be nil' + end + + @errors = errors + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + links == o.links && + data == o.data && + errors == o.errors + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [links, data, errors].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + end +end diff --git a/lib/bandwidth-sdk/models/endpoint_status_enum.rb b/lib/bandwidth-sdk/models/endpoint_status_enum.rb new file mode 100644 index 00000000..0f935de0 --- /dev/null +++ b/lib/bandwidth-sdk/models/endpoint_status_enum.rb @@ -0,0 +1,40 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +Generator version: 7.17.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + class EndpointStatusEnum + CONNECTED = 'CONNECTED'.freeze + DISCONNECTED = 'DISCONNECTED'.freeze + + def self.all_vars + @all_vars ||= [CONNECTED, DISCONNECTED].freeze + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + return value if EndpointStatusEnum.all_vars.include?(value) + raise "Invalid ENUM value #{value} for class #EndpointStatusEnum" + end + end +end diff --git a/lib/bandwidth-sdk/models/endpoint_type_enum.rb b/lib/bandwidth-sdk/models/endpoint_type_enum.rb new file mode 100644 index 00000000..e88f0ee1 --- /dev/null +++ b/lib/bandwidth-sdk/models/endpoint_type_enum.rb @@ -0,0 +1,39 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +Generator version: 7.17.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + class EndpointTypeEnum + WEBRTC = 'WEBRTC'.freeze + + def self.all_vars + @all_vars ||= [WEBRTC].freeze + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + return value if EndpointTypeEnum.all_vars.include?(value) + raise "Invalid ENUM value #{value} for class #EndpointTypeEnum" + end + end +end diff --git a/lib/bandwidth-sdk/models/endpoints.rb b/lib/bandwidth-sdk/models/endpoints.rb new file mode 100644 index 00000000..02ef5be5 --- /dev/null +++ b/lib/bandwidth-sdk/models/endpoints.rb @@ -0,0 +1,311 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +Generator version: 7.17.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + class Endpoints < ApiModelBase + # The unique ID of the endpoint. + attr_accessor :endpoint_id + + attr_accessor :type + + attr_accessor :status + + # The time the endpoint was created. In ISO-8601 format. + attr_accessor :creation_timestamp + + # The time the endpoint token will expire. In ISO-8601 format. Tokens last 24 hours. + attr_accessor :expiration_timestamp + + # A tag for the endpoint. + attr_accessor :tag + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'endpoint_id' => :'endpointId', + :'type' => :'type', + :'status' => :'status', + :'creation_timestamp' => :'creationTimestamp', + :'expiration_timestamp' => :'expirationTimestamp', + :'tag' => :'tag' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'endpoint_id' => :'String', + :'type' => :'EndpointTypeEnum', + :'status' => :'EndpointStatusEnum', + :'creation_timestamp' => :'Time', + :'expiration_timestamp' => :'Time', + :'tag' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::Endpoints` initialize method' + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::Endpoints`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'endpoint_id') + self.endpoint_id = attributes[:'endpoint_id'] + else + self.endpoint_id = nil + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + else + self.type = nil + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + else + self.status = nil + end + + if attributes.key?(:'creation_timestamp') + self.creation_timestamp = attributes[:'creation_timestamp'] + else + self.creation_timestamp = nil + end + + if attributes.key?(:'expiration_timestamp') + self.expiration_timestamp = attributes[:'expiration_timestamp'] + else + self.expiration_timestamp = nil + end + + if attributes.key?(:'tag') + self.tag = attributes[:'tag'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @endpoint_id.nil? + invalid_properties.push('invalid value for "endpoint_id", endpoint_id cannot be nil.') + end + + if @type.nil? + invalid_properties.push('invalid value for "type", type cannot be nil.') + end + + if @status.nil? + invalid_properties.push('invalid value for "status", status cannot be nil.') + end + + if @creation_timestamp.nil? + invalid_properties.push('invalid value for "creation_timestamp", creation_timestamp cannot be nil.') + end + + if @expiration_timestamp.nil? + invalid_properties.push('invalid value for "expiration_timestamp", expiration_timestamp cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @endpoint_id.nil? + return false if @type.nil? + return false if @status.nil? + return false if @creation_timestamp.nil? + return false if @expiration_timestamp.nil? + true + end + + # Custom attribute writer method with validation + # @param [Object] endpoint_id Value to be assigned + def endpoint_id=(endpoint_id) + if endpoint_id.nil? + fail ArgumentError, 'endpoint_id cannot be nil' + end + + @endpoint_id = endpoint_id + end + + # Custom attribute writer method with validation + # @param [Object] type Value to be assigned + def type=(type) + if type.nil? + fail ArgumentError, 'type cannot be nil' + end + + @type = type + end + + # Custom attribute writer method with validation + # @param [Object] status Value to be assigned + def status=(status) + if status.nil? + fail ArgumentError, 'status cannot be nil' + end + + @status = status + end + + # Custom attribute writer method with validation + # @param [Object] creation_timestamp Value to be assigned + def creation_timestamp=(creation_timestamp) + if creation_timestamp.nil? + fail ArgumentError, 'creation_timestamp cannot be nil' + end + + @creation_timestamp = creation_timestamp + end + + # Custom attribute writer method with validation + # @param [Object] expiration_timestamp Value to be assigned + def expiration_timestamp=(expiration_timestamp) + if expiration_timestamp.nil? + fail ArgumentError, 'expiration_timestamp cannot be nil' + end + + @expiration_timestamp = expiration_timestamp + end + + # Custom attribute writer method with validation + # @param [Object] tag Value to be assigned + def tag=(tag) + if tag.nil? + fail ArgumentError, 'tag cannot be nil' + end + + @tag = tag + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + endpoint_id == o.endpoint_id && + type == o.type && + status == o.status && + creation_timestamp == o.creation_timestamp && + expiration_timestamp == o.expiration_timestamp && + tag == o.tag + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [endpoint_id, type, status, creation_timestamp, expiration_timestamp, tag].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + end +end diff --git a/lib/bandwidth-sdk/models/inbound_callback.rb b/lib/bandwidth-sdk/models/inbound_callback.rb index 9f4bedb2..3134bf18 100644 --- a/lib/bandwidth-sdk/models/inbound_callback.rb +++ b/lib/bandwidth-sdk/models/inbound_callback.rb @@ -20,7 +20,7 @@ class InboundCallback < ApiModelBase attr_accessor :type - # 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. attr_accessor :to # A detailed description of the event described by the callback. @@ -28,7 +28,7 @@ class InboundCallback < ApiModelBase attr_accessor :message - # 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. attr_accessor :carrier_name class EnumAttributeValidator diff --git a/lib/bandwidth-sdk/models/list_endpoints_response.rb b/lib/bandwidth-sdk/models/list_endpoints_response.rb new file mode 100644 index 00000000..17759b5c --- /dev/null +++ b/lib/bandwidth-sdk/models/list_endpoints_response.rb @@ -0,0 +1,229 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +Generator version: 7.17.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + class ListEndpointsResponse < ApiModelBase + attr_accessor :links + + attr_accessor :page + + attr_accessor :data + + attr_accessor :errors + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'links' => :'links', + :'page' => :'page', + :'data' => :'data', + :'errors' => :'errors' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'links' => :'Array', + :'page' => :'Page', + :'data' => :'Array', + :'errors' => :'Array' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::ListEndpointsResponse` initialize method' + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::ListEndpointsResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'links') + if (value = attributes[:'links']).is_a?(Array) + self.links = value + end + else + self.links = nil + end + + if attributes.key?(:'page') + self.page = attributes[:'page'] + end + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + else + self.data = nil + end + + if attributes.key?(:'errors') + if (value = attributes[:'errors']).is_a?(Array) + self.errors = value + end + else + self.errors = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @links.nil? + invalid_properties.push('invalid value for "links", links cannot be nil.') + end + + if @data.nil? + invalid_properties.push('invalid value for "data", data cannot be nil.') + end + + if @errors.nil? + invalid_properties.push('invalid value for "errors", errors cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @links.nil? + return false if @data.nil? + return false if @errors.nil? + true + end + + # Custom attribute writer method with validation + # @param [Object] links Value to be assigned + def links=(links) + if links.nil? + fail ArgumentError, 'links cannot be nil' + end + + @links = links + end + + # Custom attribute writer method with validation + # @param [Object] data Value to be assigned + def data=(data) + if data.nil? + fail ArgumentError, 'data cannot be nil' + end + + @data = data + end + + # Custom attribute writer method with validation + # @param [Object] errors Value to be assigned + def errors=(errors) + if errors.nil? + fail ArgumentError, 'errors cannot be nil' + end + + @errors = errors + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + links == o.links && + page == o.page && + data == o.data && + errors == o.errors + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [links, page, data, errors].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + end +end diff --git a/lib/bandwidth-sdk/models/lookup_result.rb b/lib/bandwidth-sdk/models/lookup_result.rb index 40e48872..3d2e01fd 100644 --- a/lib/bandwidth-sdk/models/lookup_result.rb +++ b/lib/bandwidth-sdk/models/lookup_result.rb @@ -40,7 +40,7 @@ class LookupResult < ApiModelBase attr_accessor :latest_message_delivery_status - # [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. attr_accessor :initial_message_delivery_status_date # [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. diff --git a/lib/bandwidth-sdk/models/machine_detection_configuration.rb b/lib/bandwidth-sdk/models/machine_detection_configuration.rb index 52f44aef..93eeae8a 100644 --- a/lib/bandwidth-sdk/models/machine_detection_configuration.rb +++ b/lib/bandwidth-sdk/models/machine_detection_configuration.rb @@ -30,7 +30,7 @@ class MachineDetectionConfiguration < ApiModelBase # Amount of silence (in seconds) before assuming the callee has finished speaking. attr_accessor :speech_end_threshold - # 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. attr_accessor :machine_speech_end_threshold # 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. diff --git a/lib/bandwidth-sdk/models/message_request.rb b/lib/bandwidth-sdk/models/message_request.rb index 5e64a097..68b6173c 100644 --- a/lib/bandwidth-sdk/models/message_request.rb +++ b/lib/bandwidth-sdk/models/message_request.rb @@ -21,7 +21,7 @@ class MessageRequest < ApiModelBase # The phone number(s) the message should be sent to in E164 format. attr_accessor :to - # 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. attr_accessor :from # The contents of the text message. Must be 2048 characters or less. diff --git a/lib/bandwidth-sdk/models/page.rb b/lib/bandwidth-sdk/models/page.rb new file mode 100644 index 00000000..eb89ea1c --- /dev/null +++ b/lib/bandwidth-sdk/models/page.rb @@ -0,0 +1,259 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +Generator version: 7.17.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + class Page < ApiModelBase + # The number of items per page. + attr_accessor :page_size + + # The total number of items. + attr_accessor :total_elements + + # The total number of pages. + attr_accessor :total_pages + + # The current page number. + attr_accessor :page_number + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'page_size' => :'pageSize', + :'total_elements' => :'totalElements', + :'total_pages' => :'totalPages', + :'page_number' => :'pageNumber' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'page_size' => :'Integer', + :'total_elements' => :'Integer', + :'total_pages' => :'Integer', + :'page_number' => :'Integer' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::Page` initialize method' + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::Page`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'page_size') + self.page_size = attributes[:'page_size'] + else + self.page_size = nil + end + + if attributes.key?(:'total_elements') + self.total_elements = attributes[:'total_elements'] + end + + if attributes.key?(:'total_pages') + self.total_pages = attributes[:'total_pages'] + end + + if attributes.key?(:'page_number') + self.page_number = attributes[:'page_number'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @page_size.nil? + invalid_properties.push('invalid value for "page_size", page_size cannot be nil.') + end + + if @page_size < 0 + invalid_properties.push('invalid value for "page_size", must be greater than or equal to 0.') + end + + if !@total_elements.nil? && @total_elements < 0 + invalid_properties.push('invalid value for "total_elements", must be greater than or equal to 0.') + end + + if !@total_pages.nil? && @total_pages < 0 + invalid_properties.push('invalid value for "total_pages", must be greater than or equal to 0.') + end + + if !@page_number.nil? && @page_number < 0 + invalid_properties.push('invalid value for "page_number", must be greater than or equal to 0.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @page_size.nil? + return false if @page_size < 0 + return false if !@total_elements.nil? && @total_elements < 0 + return false if !@total_pages.nil? && @total_pages < 0 + return false if !@page_number.nil? && @page_number < 0 + true + end + + # Custom attribute writer method with validation + # @param [Object] page_size Value to be assigned + def page_size=(page_size) + if page_size.nil? + fail ArgumentError, 'page_size cannot be nil' + end + + if page_size < 0 + fail ArgumentError, 'invalid value for "page_size", must be greater than or equal to 0.' + end + + @page_size = page_size + end + + # Custom attribute writer method with validation + # @param [Object] total_elements Value to be assigned + def total_elements=(total_elements) + if total_elements.nil? + fail ArgumentError, 'total_elements cannot be nil' + end + + if total_elements < 0 + fail ArgumentError, 'invalid value for "total_elements", must be greater than or equal to 0.' + end + + @total_elements = total_elements + end + + # Custom attribute writer method with validation + # @param [Object] total_pages Value to be assigned + def total_pages=(total_pages) + if total_pages.nil? + fail ArgumentError, 'total_pages cannot be nil' + end + + if total_pages < 0 + fail ArgumentError, 'invalid value for "total_pages", must be greater than or equal to 0.' + end + + @total_pages = total_pages + end + + # Custom attribute writer method with validation + # @param [Object] page_number Value to be assigned + def page_number=(page_number) + if page_number.nil? + fail ArgumentError, 'page_number cannot be nil' + end + + if page_number < 0 + fail ArgumentError, 'invalid value for "page_number", must be greater than or equal to 0.' + end + + @page_number = page_number + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + page_size == o.page_size && + total_elements == o.total_elements && + total_pages == o.total_pages && + page_number == o.page_number + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [page_size, total_elements, total_pages, page_number].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + end +end diff --git a/lib/bandwidth-sdk/models/sip_connection_metadata.rb b/lib/bandwidth-sdk/models/sip_connection_metadata.rb new file mode 100644 index 00000000..6371c51d --- /dev/null +++ b/lib/bandwidth-sdk/models/sip_connection_metadata.rb @@ -0,0 +1,175 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +Generator version: 7.17.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + class SipConnectionMetadata < ApiModelBase + # The IP address of the SIP connection. + attr_accessor :ip_address + + # The port of the SIP connection. + attr_accessor :port + + attr_accessor :credentials + + # The User-to-User Information header for the SIP connection. + attr_accessor :uui_header + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'ip_address' => :'ipAddress', + :'port' => :'port', + :'credentials' => :'credentials', + :'uui_header' => :'uuiHeader' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'ip_address' => :'String', + :'port' => :'Integer', + :'credentials' => :'SipCredentials', + :'uui_header' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::SipConnectionMetadata` initialize method' + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::SipConnectionMetadata`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'ip_address') + self.ip_address = attributes[:'ip_address'] + end + + if attributes.key?(:'port') + self.port = attributes[:'port'] + end + + if attributes.key?(:'credentials') + self.credentials = attributes[:'credentials'] + end + + if attributes.key?(:'uui_header') + self.uui_header = attributes[:'uui_header'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + ip_address == o.ip_address && + port == o.port && + credentials == o.credentials && + uui_header == o.uui_header + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [ip_address, port, credentials, uui_header].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + end +end diff --git a/lib/bandwidth-sdk/models/sip_credentials.rb b/lib/bandwidth-sdk/models/sip_credentials.rb new file mode 100644 index 00000000..460b5fb6 --- /dev/null +++ b/lib/bandwidth-sdk/models/sip_credentials.rb @@ -0,0 +1,156 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +Generator version: 7.17.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + class SipCredentials < ApiModelBase + # The username for the SIP connection. + attr_accessor :username + + # The password for the SIP connection. + attr_accessor :password + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'username' => :'username', + :'password' => :'password' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'username' => :'String', + :'password' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::SipCredentials` initialize method' + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::SipCredentials`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'username') + self.username = attributes[:'username'] + end + + if attributes.key?(:'password') + self.password = attributes[:'password'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + username == o.username && + password == o.password + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [username, password].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + end +end diff --git a/lib/bandwidth-sdk/models/status_callback.rb b/lib/bandwidth-sdk/models/status_callback.rb index f81d372e..2d1a85a0 100644 --- a/lib/bandwidth-sdk/models/status_callback.rb +++ b/lib/bandwidth-sdk/models/status_callback.rb @@ -34,7 +34,7 @@ class StatusCallback < ApiModelBase # Optional error code, applicable only when type is `message-failed`. attr_accessor :error_code - # 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. attr_accessor :carrier_name class EnumAttributeValidator diff --git a/lib/bandwidth-sdk/models/update_call.rb b/lib/bandwidth-sdk/models/update_call.rb index acb96d2b..360dd01c 100644 --- a/lib/bandwidth-sdk/models/update_call.rb +++ b/lib/bandwidth-sdk/models/update_call.rb @@ -39,7 +39,7 @@ class UpdateCall < ApiModelBase # Basic auth password. attr_accessor :fallback_password - # 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`. + # 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 4096 characters. Not allowed if `state` is `completed`. attr_accessor :tag class EnumAttributeValidator @@ -206,8 +206,8 @@ def list_invalid_properties invalid_properties.push('invalid value for "fallback_password", the character length must be smaller than or equal to 1024.') end - if !@tag.nil? && @tag.to_s.length > 256 - invalid_properties.push('invalid value for "tag", the character length must be smaller than or equal to 256.') + if !@tag.nil? && @tag.to_s.length > 4096 + invalid_properties.push('invalid value for "tag", the character length must be smaller than or equal to 4096.') end invalid_properties @@ -221,7 +221,7 @@ def valid? return false if !@password.nil? && @password.to_s.length > 1024 return false if !@fallback_username.nil? && @fallback_username.to_s.length > 1024 return false if !@fallback_password.nil? && @fallback_password.to_s.length > 1024 - return false if !@tag.nil? && @tag.to_s.length > 256 + return false if !@tag.nil? && @tag.to_s.length > 4096 true end @@ -268,8 +268,8 @@ def fallback_password=(fallback_password) # Custom attribute writer method with validation # @param [Object] tag Value to be assigned def tag=(tag) - if !tag.nil? && tag.to_s.length > 256 - fail ArgumentError, 'invalid value for "tag", the character length must be smaller than or equal to 256.' + if !tag.nil? && tag.to_s.length > 4096 + fail ArgumentError, 'invalid value for "tag", the character length must be smaller than or equal to 4096.' end @tag = tag diff --git a/lib/bandwidth-sdk/models/webhook_subscription_error.rb b/lib/bandwidth-sdk/models/webhook_subscription_error.rb new file mode 100644 index 00000000..2ad52bd4 --- /dev/null +++ b/lib/bandwidth-sdk/models/webhook_subscription_error.rb @@ -0,0 +1,165 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +Generator version: 7.17.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + class WebhookSubscriptionError < ApiModelBase + attr_accessor :code + + attr_accessor :description + + attr_accessor :telephone_numbers + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'code' => :'code', + :'description' => :'description', + :'telephone_numbers' => :'telephoneNumbers' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'code' => :'Integer', + :'description' => :'String', + :'telephone_numbers' => :'Array' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::WebhookSubscriptionError` initialize method' + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::WebhookSubscriptionError`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'code') + self.code = attributes[:'code'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'telephone_numbers') + if (value = attributes[:'telephone_numbers']).is_a?(Array) + self.telephone_numbers = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + code == o.code && + description == o.description && + telephone_numbers == o.telephone_numbers + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [code, description, telephone_numbers].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + end +end diff --git a/lib/bandwidth-sdk/models/webhook_subscriptions_list_body.rb b/lib/bandwidth-sdk/models/webhook_subscriptions_list_body.rb index 61ed7c4f..c6a36155 100644 --- a/lib/bandwidth-sdk/models/webhook_subscriptions_list_body.rb +++ b/lib/bandwidth-sdk/models/webhook_subscriptions_list_body.rb @@ -45,7 +45,7 @@ def self.acceptable_attributes def self.openapi_types { :'links' => :'LinksObject', - :'errors' => :'Array', + :'errors' => :'Array', :'data' => :'Array' } end