diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml
index cde61302..40394f54 100644
--- a/.github/workflows/deploy.yml
+++ b/.github/workflows/deploy.yml
@@ -48,7 +48,7 @@ jobs:
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
- ruby-version: "3.0"
+ ruby-version: 3.3
- name: Update Gem Version
run: sed -i "s/VERSION = '.*'/VERSION = '$GEM_VERSION'/g" lib/bandwidth-sdk/version.rb
diff --git a/.github/workflows/test-pr.yml b/.github/workflows/test-pr.yml
index b5f06142..f553ea2d 100644
--- a/.github/workflows/test-pr.yml
+++ b/.github/workflows/test-pr.yml
@@ -32,7 +32,7 @@ jobs:
strategy:
matrix:
os: [windows-2022, windows-2019, ubuntu-20.04, ubuntu-22.04]
- ruby-version: [2.7, 3.0, 3.1, 3.2, 3.3]
+ ruby-version: ['3.0', 3.1, 3.2, 3.3]
fail-fast: false
steps:
- name: Checkout
diff --git a/.github/workflows/test-smoke.yml b/.github/workflows/test-smoke.yml
index c0d26ed2..1a6c4370 100644
--- a/.github/workflows/test-smoke.yml
+++ b/.github/workflows/test-smoke.yml
@@ -40,14 +40,14 @@ jobs:
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
- ruby-version: 3.2
+ ruby-version: 3.3
- name: Install Packages and Test
run: |
bundle install
rake smoke
env:
- RUBY_VERSION: 3.2
+ RUBY_VERSION: 3.3
OPERATING_SYSTEM: ubuntu
shell: bash
diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES
index 90caf799..65f8a96f 100644
--- a/.openapi-generator/FILES
+++ b/.openapi-generator/FILES
@@ -18,6 +18,7 @@ docs/CallTranscriptionMetadata.md
docs/CallTranscriptionResponse.md
docs/CallTranscriptionTrackEnum.md
docs/CallbackMethodEnum.md
+docs/CallbackTypeEnum.md
docs/CallsApi.md
docs/CodeRequest.md
docs/Conference.md
@@ -42,8 +43,6 @@ docs/DtmfCallback.md
docs/FieldError.md
docs/FileFormatEnum.md
docs/GatherCallback.md
-docs/InboundMessageCallback.md
-docs/InboundMessageCallbackMessage.md
docs/InitiateCallback.md
docs/ListMessageDirectionEnum.md
docs/ListMessageItem.md
@@ -59,14 +58,10 @@ docs/MachineDetectionResult.md
docs/Media.md
docs/MediaApi.md
docs/Message.md
-docs/MessageDeliveredCallback.md
-docs/MessageDeliveredCallbackMessage.md
+docs/MessageCallback.md
+docs/MessageCallbackMessage.md
docs/MessageDirectionEnum.md
-docs/MessageFailedCallback.md
-docs/MessageFailedCallbackMessage.md
docs/MessageRequest.md
-docs/MessageSendingCallback.md
-docs/MessageSendingCallbackMessage.md
docs/MessageStatusEnum.md
docs/MessageTypeEnum.md
docs/MessagesApi.md
@@ -134,6 +129,7 @@ lib/bandwidth-sdk/models/call_transcription_metadata.rb
lib/bandwidth-sdk/models/call_transcription_response.rb
lib/bandwidth-sdk/models/call_transcription_track_enum.rb
lib/bandwidth-sdk/models/callback_method_enum.rb
+lib/bandwidth-sdk/models/callback_type_enum.rb
lib/bandwidth-sdk/models/code_request.rb
lib/bandwidth-sdk/models/conference.rb
lib/bandwidth-sdk/models/conference_completed_callback.rb
@@ -156,8 +152,6 @@ lib/bandwidth-sdk/models/dtmf_callback.rb
lib/bandwidth-sdk/models/field_error.rb
lib/bandwidth-sdk/models/file_format_enum.rb
lib/bandwidth-sdk/models/gather_callback.rb
-lib/bandwidth-sdk/models/inbound_message_callback.rb
-lib/bandwidth-sdk/models/inbound_message_callback_message.rb
lib/bandwidth-sdk/models/initiate_callback.rb
lib/bandwidth-sdk/models/list_message_direction_enum.rb
lib/bandwidth-sdk/models/list_message_item.rb
@@ -171,14 +165,10 @@ lib/bandwidth-sdk/models/machine_detection_mode_enum.rb
lib/bandwidth-sdk/models/machine_detection_result.rb
lib/bandwidth-sdk/models/media.rb
lib/bandwidth-sdk/models/message.rb
-lib/bandwidth-sdk/models/message_delivered_callback.rb
-lib/bandwidth-sdk/models/message_delivered_callback_message.rb
+lib/bandwidth-sdk/models/message_callback.rb
+lib/bandwidth-sdk/models/message_callback_message.rb
lib/bandwidth-sdk/models/message_direction_enum.rb
-lib/bandwidth-sdk/models/message_failed_callback.rb
-lib/bandwidth-sdk/models/message_failed_callback_message.rb
lib/bandwidth-sdk/models/message_request.rb
-lib/bandwidth-sdk/models/message_sending_callback.rb
-lib/bandwidth-sdk/models/message_sending_callback_message.rb
lib/bandwidth-sdk/models/message_status_enum.rb
lib/bandwidth-sdk/models/message_type_enum.rb
lib/bandwidth-sdk/models/messages_list.rb
diff --git a/README.md b/README.md
index e60a0aa5..c482e1f7 100644
--- a/README.md
+++ b/README.md
@@ -164,6 +164,7 @@ Class | Method | HTTP request | Description
- [Bandwidth::CallTranscriptionResponse](docs/CallTranscriptionResponse.md)
- [Bandwidth::CallTranscriptionTrackEnum](docs/CallTranscriptionTrackEnum.md)
- [Bandwidth::CallbackMethodEnum](docs/CallbackMethodEnum.md)
+ - [Bandwidth::CallbackTypeEnum](docs/CallbackTypeEnum.md)
- [Bandwidth::CodeRequest](docs/CodeRequest.md)
- [Bandwidth::Conference](docs/Conference.md)
- [Bandwidth::ConferenceCompletedCallback](docs/ConferenceCompletedCallback.md)
@@ -186,8 +187,6 @@ Class | Method | HTTP request | Description
- [Bandwidth::FieldError](docs/FieldError.md)
- [Bandwidth::FileFormatEnum](docs/FileFormatEnum.md)
- [Bandwidth::GatherCallback](docs/GatherCallback.md)
- - [Bandwidth::InboundMessageCallback](docs/InboundMessageCallback.md)
- - [Bandwidth::InboundMessageCallbackMessage](docs/InboundMessageCallbackMessage.md)
- [Bandwidth::InitiateCallback](docs/InitiateCallback.md)
- [Bandwidth::ListMessageDirectionEnum](docs/ListMessageDirectionEnum.md)
- [Bandwidth::ListMessageItem](docs/ListMessageItem.md)
@@ -201,14 +200,10 @@ Class | Method | HTTP request | Description
- [Bandwidth::MachineDetectionResult](docs/MachineDetectionResult.md)
- [Bandwidth::Media](docs/Media.md)
- [Bandwidth::Message](docs/Message.md)
- - [Bandwidth::MessageDeliveredCallback](docs/MessageDeliveredCallback.md)
- - [Bandwidth::MessageDeliveredCallbackMessage](docs/MessageDeliveredCallbackMessage.md)
+ - [Bandwidth::MessageCallback](docs/MessageCallback.md)
+ - [Bandwidth::MessageCallbackMessage](docs/MessageCallbackMessage.md)
- [Bandwidth::MessageDirectionEnum](docs/MessageDirectionEnum.md)
- - [Bandwidth::MessageFailedCallback](docs/MessageFailedCallback.md)
- - [Bandwidth::MessageFailedCallbackMessage](docs/MessageFailedCallbackMessage.md)
- [Bandwidth::MessageRequest](docs/MessageRequest.md)
- - [Bandwidth::MessageSendingCallback](docs/MessageSendingCallback.md)
- - [Bandwidth::MessageSendingCallbackMessage](docs/MessageSendingCallbackMessage.md)
- [Bandwidth::MessageStatusEnum](docs/MessageStatusEnum.md)
- [Bandwidth::MessageTypeEnum](docs/MessageTypeEnum.md)
- [Bandwidth::MessagesList](docs/MessagesList.md)
diff --git a/bandwidth-sdk.gemspec b/bandwidth-sdk.gemspec
index aa7391d3..f8c0e888 100644
--- a/bandwidth-sdk.gemspec
+++ b/bandwidth-sdk.gemspec
@@ -30,7 +30,7 @@ Gem::Specification.new do |s|
s.add_runtime_dependency 'faraday', '>= 1.0.1', '< 3.0'
s.add_runtime_dependency 'faraday-multipart'
- s.add_runtime_dependency 'ox', '~> 2.4'
+ s.add_runtime_dependency 'ox', '~> 2.14'
s.add_runtime_dependency 'marcel'
s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0'
diff --git a/bandwidth.yml b/bandwidth.yml
index 11c79d23..87921dfa 100644
--- a/bandwidth.yml
+++ b/bandwidth.yml
@@ -230,8 +230,6 @@ paths:
'500':
$ref: '#/components/responses/messagingInternalServerError'
callbacks:
- inboundCallback:
- $ref: '#/components/callbacks/inboundCallback'
statusCallback:
$ref: '#/components/callbacks/statusCallback'
servers: *ref_0
@@ -1332,6 +1330,21 @@ paths:
servers: *ref_3
components:
schemas:
+ callbackTypeEnum:
+ type: string
+ enum:
+ - message-received
+ - message-sending
+ - message-delivered
+ - message-failed
+ description: >
+ Indicates the type of the callback:
+
+ - `message-received` for inbound callbacks.
+
+ - One of `message-sending`, `message-delivered`, `message-failed` for
+ status callbacks.
+ example: message-delivered
priorityEnum:
type: string
description: |-
@@ -1574,7 +1587,7 @@ components:
type: string
format: date-time
description: The datetime stamp of the message in ISO 8601
- example: 2022-09-14T18:20:16.000Z
+ example: 2024-12-02T20:15:57.278Z
segmentCount:
type: integer
description: >-
@@ -1695,288 +1708,38 @@ components:
Not supported on MMS.
example: '2021-02-01T11:29:18-05:00'
- inboundMessageCallback:
- description: Inbound Message Callback
- type: object
- properties:
- time:
- type: string
- format: date-time
- example: 2016-09-14T18:20:16.000Z
- type:
- type: string
- example: message-received
- to:
- type: string
- example: '+15552223333'
- description:
- type: string
- example: Incoming message received
- message:
- $ref: '#/components/schemas/inboundMessageCallbackMessage'
- required:
- - time
- - type
- - to
- - description
- - message
- inboundMessageCallbackMessage:
- description: Inbound Message Callback Message Schema
- type: object
- properties:
- id:
- type: string
- example: 1661365814859loidf7mcwd4qacn7
- owner:
- type: string
- example: '+15553332222'
- applicationId:
- type: string
- example: 93de2206-9669-4e07-948d-329f4b722ee2
- time:
- type: string
- format: date-time
- example: 2016-09-14T18:20:16.000Z
- segmentCount:
- type: integer
- example: 1
- direction:
- $ref: '#/components/schemas/messageDirectionEnum'
- to:
- uniqueItems: true
- type: array
- items:
- type: string
- example:
- - '+15552223333'
- from:
- type: string
- example: '+15553332222'
- text:
- type: string
- example: Hello world
- tag:
- type: string
- example: custom string
- media:
- type: array
- items:
- type: string
- format: uri
- example:
- - https://dev.bandwidth.com/images/bandwidth-logo.png
- - https://dev.bandwidth.com/images/github_logo.png
- priority:
- $ref: '#/components/schemas/priorityEnum'
- required:
- - id
- - owner
- - applicationId
- - time
- - segmentCount
- - direction
- - to
- - from
- - text
- messageSendingCallback:
- type: object
- description: Message Sending Callback
- properties:
- time:
- type: string
- format: date-time
- example: 2016-09-14T18:20:16.000Z
- type:
- type: string
- example: message-sending
- to:
- type: string
- example: '+15552223333'
- description:
- type: string
- example: Message is sending to carrier
- message:
- $ref: '#/components/schemas/messageSendingCallbackMessage'
- required:
- - time
- - type
- - to
- - description
- - message
- messageSendingCallbackMessage:
- description: Message Sending Callback Message Schema
- type: object
- properties:
- id:
- type: string
- example: 1661365814859loidf7mcwd4qacn7
- owner:
- type: string
- example: '+15553332222'
- applicationId:
- type: string
- example: 93de2206-9669-4e07-948d-329f4b722ee2
- time:
- type: string
- format: date-time
- example: 2016-09-14T18:20:16.000Z
- segmentCount:
- type: integer
- example: 1
- direction:
- $ref: '#/components/schemas/messageDirectionEnum'
- to:
- uniqueItems: true
- type: array
- items:
- type: string
- example:
- - '+15552223333'
- from:
- type: string
- example: '+15553332222'
- text:
- type: string
- example: Hello world
- tag:
- type: string
- example: custom string
- media:
- type: array
- items:
- type: string
- format: uri
- example:
- - https://dev.bandwidth.com/images/bandwidth-logo.png
- - https://dev.bandwidth.com/images/github_logo.png
- priority:
- $ref: '#/components/schemas/priorityEnum'
- required:
- - id
- - owner
- - applicationId
- - time
- - segmentCount
- - direction
- - to
- - from
- - text
- - media
- messageDeliveredCallback:
- description: Message Delivered Callback
- type: object
- properties:
- time:
- type: string
- format: date-time
- example: 2016-09-14T18:20:16.000Z
- type:
- type: string
- example: message-delivered
- to:
- type: string
- example: '+15552223333'
- description:
- type: string
- example: Message delivered to carrier.
- message:
- $ref: '#/components/schemas/messageDeliveredCallbackMessage'
- required:
- - time
- - type
- - to
- - description
- - message
- messageDeliveredCallbackMessage:
- description: Message Delivered Callback Message Schema
- type: object
- properties:
- id:
- type: string
- example: 1661365814859loidf7mcwd4qacn7
- owner:
- type: string
- example: '+15553332222'
- applicationId:
- type: string
- example: 93de2206-9669-4e07-948d-329f4b722ee2
- time:
- type: string
- format: date-time
- example: 2016-09-14T18:20:16.000Z
- segmentCount:
- type: integer
- example: 1
- direction:
- $ref: '#/components/schemas/messageDirectionEnum'
- to:
- uniqueItems: true
- type: array
- items:
- type: string
- example:
- - '+15552223333'
- from:
- type: string
- example: '+15553332222'
- text:
- type: string
- example: Hello world
- tag:
- type: string
- example: custom string
- media:
- type: array
- items:
- type: string
- format: uri
- example:
- - https://dev.bandwidth.com/images/bandwidth-logo.png
- - https://dev.bandwidth.com/images/github_logo.png
- priority:
- $ref: '#/components/schemas/priorityEnum'
- required:
- - id
- - owner
- - applicationId
- - time
- - segmentCount
- - direction
- - to
- - from
- - text
- - tag
- messageFailedCallback:
- description: Message Failed Callback
+ messageCallback:
+ description: Message Callback Schema
type: object
properties:
time:
type: string
format: date-time
- example: 2016-09-14T18:20:16.000Z
+ example: 2024-12-02T20:15:57.278Z
type:
- type: string
- example: message-failed
+ $ref: '#/components/schemas/callbackTypeEnum'
to:
type: string
example: '+15552223333'
description:
type: string
+ description: A detailed description of the event described by the callback.
example: rejected-unallocated-from-number
message:
- $ref: '#/components/schemas/messageFailedCallbackMessage'
+ $ref: '#/components/schemas/messageCallbackMessage'
errorCode:
type: integer
- example: 9902
+ description: Optional error code, applicable only when type is `message-failed`.
+ nullable: true
+ example: 4405
required:
- time
- type
- to
- description
- message
- - errorCode
- messageFailedCallbackMessage:
- description: Message Failed Callback Message Schema
+ messageCallbackMessage:
+ description: Message payload schema within a MessageCallback
type: object
properties:
id:
@@ -1991,7 +1754,7 @@ components:
time:
type: string
format: date-time
- example: 2016-09-14T18:20:16.000Z
+ example: 2024-12-02T20:15:57.666Z
segmentCount:
type: integer
example: 1
@@ -2015,6 +1778,8 @@ components:
example: custom string
media:
type: array
+ description: Optional media, applicable only for mms
+ nullable: true
items:
type: string
format: uri
@@ -2033,7 +1798,6 @@ components:
- to
- from
- text
- - tag
callbackMethodEnum:
type: string
nullable: true
@@ -5463,34 +5227,345 @@ components:
type: string
description: The phone number lookup request ID from Bandwidth.
example: 004223a0-8b17-41b1-bf81-20732adf5590
- requestBodies:
- createMessageRequest:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/messageRequest'
- required: true
- uploadMediaRequest:
- content:
- application/json:
- schema:
- type: string
- format: binary
- application/ogg:
- schema:
- type: string
- format: binary
- application/pdf:
- schema:
- type: string
- format: binary
- application/rtf:
- schema:
- type: string
- format: binary
- application/zip:
- schema:
- type: string
+ examples:
+ smsMessageReceivedCallbackExample:
+ summary: An example of a sms message-received callback body.
+ value:
+ time: '2025-01-06T15:43:35.502180Z'
+ type: message-received
+ to: '+12345678902'
+ description: Incoming message received
+ message:
+ id: 14762070468292kw2fuqty55yp2b2
+ owner: '+12345678902'
+ applicationId: 93de2206-9669-4e07-948d-329f4b722ee2
+ time: '2025-01-06T15:43:34.000000Z'
+ segmentCount: 1
+ direction: in
+ to:
+ - '+12345678902'
+ from: '+12345678901'
+ text: Hey, check out this SMS!
+ mmsMessageReceivedCallbackExample:
+ summary: An example of a mms message-received callback body.
+ value:
+ time: '2024-09-14T18:20:45.160744Z'
+ type: message-received
+ to: '+12345678902'
+ description: Incoming message received
+ message:
+ id: 14762070468292kw2fuqty55yp2b2
+ owner: '+12345678902'
+ applicationId: 93de2206-9669-4e07-948d-329f4b722ee2
+ time: '2024-09-14T18:20:45.160744Z'
+ segmentCount: 1
+ direction: in
+ to:
+ - '+12345678902'
+ - '+12345678903'
+ from: '+12345678901'
+ text: Hey, check out the MMS!
+ media:
+ - >-
+ https://messaging.bandwidth.com/api/v2/users/9900902/media/14762070468292kw2fuqty55yp2b2/0/bw.png
+ messageSendingCallbackExample:
+ summary: An example of a message-sending callback body.
+ value:
+ time: '2024-06-25T18:42:36.979456Z'
+ type: message-sending
+ to: '+15554443333'
+ description: Message is sending to carrier.
+ message:
+ id: 1593110555875xo7watq5px6rbe5d
+ owner: '+15552221111'
+ applicationId: cfd4fb83-7531-4acc-b471-42d0bb76a65c
+ time: '2024-06-25T18:42:35.876906Z'
+ segmentCount: 1
+ direction: out
+ to:
+ - '+15554443333'
+ from: '+15552221111'
+ text: ''
+ media:
+ - https://dev.bandwidth.com/images/bandwidth-logo.png
+ tag: your tag here
+ smsMessageDeliveredCallbackExample:
+ summary: An example of a sms message-delivered callback body.
+ value:
+ type: message-delivered
+ time: '2024-09-14T18:20:11.160744Z'
+ description: Message delivered to carrier.
+ to: '+12345678902'
+ message:
+ id: 14762070468292kw2fuqty55yp2b2
+ time: '2024-09-14T18:20:11.160744Z'
+ to:
+ - '+12345678902'
+ from: '+12345678901'
+ text: ''
+ applicationId: 93de2206-9669-4e07-948d-329f4b722ee2
+ owner: '+12345678902'
+ direction: out
+ segmentCount: 1
+ mmsMessageDeliveredCallbackExample:
+ summary: An example of a mms message-delivered callback body.
+ value:
+ type: message-delivered
+ time: '2024-09-14T18:20:24.160544Z'
+ description: Message delivered to carrier.
+ to: '+12345678902'
+ message:
+ id: 14762070468292kw2fuqty55yp2b2
+ time: '2024-09-14T18:20:24.160544Z'
+ to:
+ - '+12345678902'
+ from: '+12345678901'
+ text: ''
+ applicationId: 93de2206-9669-4e07-948d-329f4b722ee2
+ owner: '+12345678902'
+ direction: out
+ segmentCount: 1
+ media:
+ - https://dev.bandwidth.com/images/bandwidth-logo.png
+ groupMmsMessageDeliveredCallbackExample:
+ summary: An example of a group mms message-delivered callback body.
+ value:
+ type: message-delivered
+ time: '2024-09-14T18:20:17.160544Z'
+ description: Message delivered to carrier.
+ to: '+12345678902'
+ message:
+ id: 14762070468292kw2fuqty55yp2b2
+ time: '2024-09-14T18:20:17.160544Z'
+ to:
+ - '+12345678902'
+ - '+12345678903'
+ from: '+12345678901'
+ text: ''
+ applicationId: 93de2206-9669-4e07-948d-329f4b722ee2
+ owner: '+12345678902'
+ direction: out
+ segmentCount: 1
+ messageFailedCallbackExample:
+ summary: An example of a message-failed callback body.
+ value:
+ type: message-failed
+ time: '2024-12-18T16:51:27.704450Z'
+ description: forbidden to country
+ to: '+52345678903'
+ errorCode: 4432
+ message:
+ id: 14762070468292kw2fuqty55yp2b2
+ time: '2024-12-18T16:51:27.704450Z'
+ to:
+ - '+12345678902'
+ - '+52345678903'
+ from: '+12345678901'
+ text: ''
+ applicationId: 93de2206-9669-4e07-948d-329f4b722ee2
+ media:
+ - https://dev.bandwidth.com/images/bandwidth-logo.png
+ owner: '+12345678901'
+ direction: out
+ segmentCount: 1
+ createCallResponseExample:
+ summary: Example of a createCall Response
+ value:
+ applicationId: 04e88489-df02-4e34-a0ee-27a91849555f
+ accountId: '9900000'
+ callId: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85
+ to: '+19195551234'
+ from: '+19195554312'
+ enqueuedTime: '2022-06-16T13:15:07.160Z'
+ callUrl: >-
+ https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85
+ callTimeout: 30
+ callbackTimeout: 15
+ tag: My custom tag value
+ answerMethod: POST
+ answerUrl: https://myServer.example/bandwidth/webhooks/answer
+ answerFallbackMethod: POST
+ answerFallbackUrl: https://myServer.example/bandwidth/webhooks/answerFallback
+ disconnectMethod: POST
+ disconnectUrl: https://myServer.example/bandwidth/webhooks/disconnect
+ username: mySecretUsername
+ password: '*****'
+ fallbackUsername: mySecretUsername
+ fallbackPassword: '*****'
+ priority: 5
+ listConferencesResponseExample:
+ summary: Example of a listConferences Response
+ value:
+ - id: conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9
+ name: my-conference-name
+ createdTime: '2022-06-17T22:19:40.375Z'
+ completedTime: '2022-06-17T22:20:00.000Z'
+ conferenceEventUrl: https://myServer.example/bandwidth/webhooks/conferenceEvent
+ conferenceEventMethod: POST
+ tag: my custom tag
+ voiceBadRequestErrorExample:
+ summary: Example of a Bad Request (400) Error
+ value:
+ type: validation
+ description: 'Invalid answerUrl: only http and https are allowed.'
+ voiceUnauthorizedErrorExample:
+ summary: Example of an Unauthorized (401) Error
+ value:
+ type: validation
+ description: 'Invalid answerUrl: only http and https are allowed.'
+ voiceForbiddenErrorExample:
+ summary: Example of a Forbidden (403) Error
+ value:
+ type: validation
+ description: 'Invalid answerUrl: only http and https are allowed.'
+ voiceNotFoundErrorExample:
+ summary: Example of a Not Found (404) Error
+ value:
+ type: validation
+ description: 'Invalid answerUrl: only http and https are allowed.'
+ voiceNotAllowedErrorExample:
+ summary: Example of a Not Allowed (405) Error
+ value:
+ type: validation
+ description: 'Invalid answerUrl: only http and https are allowed.'
+ voiceConflictErrorExample:
+ summary: Example of a Conflict (409) Error
+ value:
+ type: validation
+ description: 'Invalid answerUrl: only http and https are allowed.'
+ voiceUnsupportedMediaTypeErrorExample:
+ summary: Example of an Unsupported Media Type (415) Error
+ value:
+ type: validation
+ description: 'Invalid answerUrl: only http and https are allowed.'
+ voiceTooManyRequestsErrorExample:
+ summary: Example of a Too Many Requests (429) Error
+ value:
+ type: validation
+ description: 'Invalid answerUrl: only http and https are allowed.'
+ voiceInternalServerErrorExample:
+ summary: Example of an Internal Server (500) Error
+ value:
+ type: validation
+ description: 'Invalid answerUrl: only http and https are allowed.'
+ singleNumberRequestExample:
+ summary: Example Number Lookup Request for One Number
+ value:
+ tns:
+ - '+19195551234'
+ multipleNumberRequestExample:
+ summary: Example Number Lookup Request for Multiple Numbers
+ value:
+ tns:
+ - '+19195551234'
+ - '+19195554321'
+ lookupInProgressExample:
+ summary: Example Lookup In Progress Response
+ value:
+ requestId: 004223a0-8b17-41b1-bf81-20732adf5590
+ status: IN_PROGRESS
+ lookupFailedExample:
+ summary: Example Lookup Failed Response
+ value:
+ requestId: 004223a0-8b17-41b1-bf81-20732adf5590
+ status: FAILED
+ failedTelephoneNumbers:
+ - '+191955512345'
+ lookupSingleNumberCompleteExample:
+ summary: Example Single Number Lookup Complete Response
+ value:
+ requestId: 004223a0-8b17-41b1-bf81-20732adf5590
+ status: COMPLETE
+ result:
+ - Response Code: 0
+ Message: NOERROR
+ E.164 Format: '+19195551234'
+ Formatted: (919) 555-1234
+ Country: US
+ Line Type: Mobile
+ Line Provider: Verizon Wireless
+ Mobile Country Code: '310'
+ Mobile Network Code: '010'
+ lookupMultipleNumbersCompleteExample:
+ summary: Example Multiple Numbers Lookup Complete Response
+ value:
+ requestId: 004223a0-8b17-41b1-bf81-20732adf5590
+ status: COMPLETE
+ result:
+ - Response Code: 0
+ Message: NOERROR
+ E.164 Format: '+19195551234'
+ Formatted: (919) 555-1234
+ Country: US
+ Line Type: Mobile
+ Line Provider: Verizon Wireless
+ Mobile Country Code: '310'
+ Mobile Network Code: '010'
+ - Response Code: 0
+ Message: NOERROR
+ E.164 Format: '+19195554321'
+ Formatted: (919) 555-4321
+ Country: US
+ Line Type: Mobile
+ Line Provider: T-Mobile USA
+ Mobile Country Code: '310'
+ Mobile Network Code: '160'
+ lookupMultipleNumbersPartialCompleteExample:
+ summary: Example Multiple Numbers Lookup Partial Complete Response
+ value:
+ requestId: 004223a0-8b17-41b1-bf81-20732adf5590
+ status: PARTIAL_COMPLETE
+ result:
+ - Response Code: 0
+ Message: NOERROR
+ E.164 Format: '+19195551234'
+ Formatted: (919) 555-1234
+ Country: US
+ Line Type: Mobile
+ Line Provider: Verizon Wireless
+ Mobile Country Code: '310'
+ Mobile Network Code: '010'
+ failedTelephoneNumbers:
+ - '+191955512345'
+ lookupSingleNumberCompleteNoInfoExample:
+ summary: Example Single Number Lookup Complete with No Information Response
+ value:
+ requestId: 004223a0-8b17-41b1-bf81-20732adf5590
+ status: COMPLETE
+ result:
+ - Response Code: 3
+ Message: NXDOMAIN
+ E.164 Format: '+19195550000'
+ Formatted: (919) 555-0000
+ Country: US
+ requestBodies:
+ createMessageRequest:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/messageRequest'
+ required: true
+ uploadMediaRequest:
+ content:
+ application/json:
+ schema:
+ type: string
+ format: binary
+ application/ogg:
+ schema:
+ type: string
+ format: binary
+ application/pdf:
+ schema:
+ type: string
+ format: binary
+ application/rtf:
+ schema:
+ type: string
+ format: binary
+ application/zip:
+ schema:
+ type: string
format: binary
application/x-tar:
schema:
@@ -5560,6 +5635,14 @@ components:
schema:
type: string
format: binary
+ image/heic:
+ schema:
+ type: string
+ format: binary
+ image/heif:
+ schema:
+ type: string
+ format: binary
image/jpeg:
schema:
type: string
@@ -5600,6 +5683,10 @@ components:
schema:
type: string
format: binary
+ text/html:
+ schema:
+ type: string
+ format: binary
text/plain:
schema:
type: string
@@ -5648,6 +5735,10 @@ components:
schema:
type: string
format: binary
+ video/x-flv:
+ schema:
+ type: string
+ format: binary
required: true
createCallRequest:
description: JSON object containing information to create an outbound call
@@ -5770,11 +5861,22 @@ components:
post:
requestBody:
required: true
- description: Inbound Message Callback Payload
+ description: >
+
This Inbound Message Webhook is an envelope containing a
+ received (MO) message to your message-enabled Bandwidth telephone
+ number. The payload type will always indicate "message-received".
+
+
Please visit Webhooks
content:
application/json:
schema:
- $ref: '#/components/schemas/inboundMessageCallback'
+ $ref: '#/components/schemas/messageCallback'
+ examples:
+ smsMessageReceivedCallback:
+ $ref: '#/components/examples/smsMessageReceivedCallbackExample'
+ mmsMessageReceivedCallback:
+ $ref: '#/components/examples/mmsMessageReceivedCallbackExample'
responses:
'200':
description: OK
@@ -5783,186 +5885,31 @@ components:
post:
requestBody:
required: true
- description: Status Callback Payload
+ description: >
+ This Outbound Message Webhook is an envelope containing status
+ information regarding a message sent (MT) from your
+ message-enabled Bandwidth telephone number. The payload type will
+ be one of "message-sending", "message-delivered", or
+ "message-failed".
+
+
Please visit Webhooks
content:
application/json:
schema:
- type: object
- oneOf:
- - $ref: '#/components/schemas/messageSendingCallback'
- - $ref: '#/components/schemas/messageDeliveredCallback'
- - $ref: '#/components/schemas/messageFailedCallback'
+ $ref: '#/components/schemas/messageCallback'
+ examples:
+ messageSendingCallback:
+ $ref: '#/components/examples/messageSendingCallbackExample'
+ smsMessageDeliveredCallback:
+ $ref: '#/components/examples/smsMessageDeliveredCallbackExample'
+ mmsMessageDeliveredCallback:
+ $ref: '#/components/examples/mmsMessageDeliveredCallbackExample'
+ groupMmsMessageDeliveredCallback:
+ $ref: >-
+ #/components/examples/groupMmsMessageDeliveredCallbackExample
+ messageFailedCallback:
+ $ref: '#/components/examples/messageFailedCallbackExample'
responses:
'200':
description: OK
- examples:
- createCallResponseExample:
- summary: Example of a createCall Response
- value:
- applicationId: 04e88489-df02-4e34-a0ee-27a91849555f
- accountId: '9900000'
- callId: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85
- to: '+19195551234'
- from: '+19195554312'
- enqueuedTime: '2022-06-16T13:15:07.160Z'
- callUrl: >-
- https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85
- callTimeout: 30
- callbackTimeout: 15
- tag: My custom tag value
- answerMethod: POST
- answerUrl: https://myServer.example/bandwidth/webhooks/answer
- answerFallbackMethod: POST
- answerFallbackUrl: https://myServer.example/bandwidth/webhooks/answerFallback
- disconnectMethod: POST
- disconnectUrl: https://myServer.example/bandwidth/webhooks/disconnect
- username: mySecretUsername
- password: '*****'
- fallbackUsername: mySecretUsername
- fallbackPassword: '*****'
- priority: 5
- listConferencesResponseExample:
- summary: Example of a listConferences Response
- value:
- - id: conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9
- name: my-conference-name
- createdTime: '2022-06-17T22:19:40.375Z'
- completedTime: '2022-06-17T22:20:00.000Z'
- conferenceEventUrl: https://myServer.example/bandwidth/webhooks/conferenceEvent
- conferenceEventMethod: POST
- tag: my custom tag
- voiceBadRequestErrorExample:
- summary: Example of a Bad Request (400) Error
- value:
- type: validation
- description: 'Invalid answerUrl: only http and https are allowed.'
- voiceUnauthorizedErrorExample:
- summary: Example of an Unauthorized (401) Error
- value:
- type: validation
- description: 'Invalid answerUrl: only http and https are allowed.'
- voiceForbiddenErrorExample:
- summary: Example of a Forbidden (403) Error
- value:
- type: validation
- description: 'Invalid answerUrl: only http and https are allowed.'
- voiceNotFoundErrorExample:
- summary: Example of a Not Found (404) Error
- value:
- type: validation
- description: 'Invalid answerUrl: only http and https are allowed.'
- voiceNotAllowedErrorExample:
- summary: Example of a Not Allowed (405) Error
- value:
- type: validation
- description: 'Invalid answerUrl: only http and https are allowed.'
- voiceConflictErrorExample:
- summary: Example of a Conflict (409) Error
- value:
- type: validation
- description: 'Invalid answerUrl: only http and https are allowed.'
- voiceUnsupportedMediaTypeErrorExample:
- summary: Example of an Unsupported Media Type (415) Error
- value:
- type: validation
- description: 'Invalid answerUrl: only http and https are allowed.'
- voiceTooManyRequestsErrorExample:
- summary: Example of a Too Many Requests (429) Error
- value:
- type: validation
- description: 'Invalid answerUrl: only http and https are allowed.'
- voiceInternalServerErrorExample:
- summary: Example of an Internal Server (500) Error
- value:
- type: validation
- description: 'Invalid answerUrl: only http and https are allowed.'
- singleNumberRequestExample:
- summary: Example Number Lookup Request for One Number
- value:
- tns:
- - '+19195551234'
- multipleNumberRequestExample:
- summary: Example Number Lookup Request for Multiple Numbers
- value:
- tns:
- - '+19195551234'
- - '+19195554321'
- lookupInProgressExample:
- summary: Example Lookup In Progress Response
- value:
- requestId: 004223a0-8b17-41b1-bf81-20732adf5590
- status: IN_PROGRESS
- lookupFailedExample:
- summary: Example Lookup Failed Response
- value:
- requestId: 004223a0-8b17-41b1-bf81-20732adf5590
- status: FAILED
- failedTelephoneNumbers:
- - '+191955512345'
- lookupSingleNumberCompleteExample:
- summary: Example Single Number Lookup Complete Response
- value:
- requestId: 004223a0-8b17-41b1-bf81-20732adf5590
- status: COMPLETE
- result:
- - Response Code: 0
- Message: NOERROR
- E.164 Format: '+19195551234'
- Formatted: (919) 555-1234
- Country: US
- Line Type: Mobile
- Line Provider: Verizon Wireless
- Mobile Country Code: '310'
- Mobile Network Code: '010'
- lookupMultipleNumbersCompleteExample:
- summary: Example Multiple Numbers Lookup Complete Response
- value:
- requestId: 004223a0-8b17-41b1-bf81-20732adf5590
- status: COMPLETE
- result:
- - Response Code: 0
- Message: NOERROR
- E.164 Format: '+19195551234'
- Formatted: (919) 555-1234
- Country: US
- Line Type: Mobile
- Line Provider: Verizon Wireless
- Mobile Country Code: '310'
- Mobile Network Code: '010'
- - Response Code: 0
- Message: NOERROR
- E.164 Format: '+19195554321'
- Formatted: (919) 555-4321
- Country: US
- Line Type: Mobile
- Line Provider: T-Mobile USA
- Mobile Country Code: '310'
- Mobile Network Code: '160'
- lookupMultipleNumbersPartialCompleteExample:
- summary: Example Multiple Numbers Lookup Partial Complete Response
- value:
- requestId: 004223a0-8b17-41b1-bf81-20732adf5590
- status: PARTIAL_COMPLETE
- result:
- - Response Code: 0
- Message: NOERROR
- E.164 Format: '+19195551234'
- Formatted: (919) 555-1234
- Country: US
- Line Type: Mobile
- Line Provider: Verizon Wireless
- Mobile Country Code: '310'
- Mobile Network Code: '010'
- failedTelephoneNumbers:
- - '+191955512345'
- lookupSingleNumberCompleteNoInfoExample:
- summary: Example Single Number Lookup Complete with No Information Response
- value:
- requestId: 004223a0-8b17-41b1-bf81-20732adf5590
- status: COMPLETE
- result:
- - Response Code: 3
- Message: NXDOMAIN
- E.164 Format: '+19195550000'
- Formatted: (919) 555-0000
- Country: US
diff --git a/custom_templates/gemspec.mustache b/custom_templates/gemspec.mustache
index d559f45a..d09c21a1 100644
--- a/custom_templates/gemspec.mustache
+++ b/custom_templates/gemspec.mustache
@@ -27,7 +27,7 @@ Gem::Specification.new do |s|
{{^isFaraday}}
s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1'
{{/isFaraday}}
- s.add_runtime_dependency 'ox', '~> 2.4'
+ s.add_runtime_dependency 'ox', '~> 2.14'
s.add_runtime_dependency 'marcel'
s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0'
diff --git a/docs/CallbackTypeEnum.md b/docs/CallbackTypeEnum.md
new file mode 100644
index 00000000..472c1314
--- /dev/null
+++ b/docs/CallbackTypeEnum.md
@@ -0,0 +1,15 @@
+# Bandwidth::CallbackTypeEnum
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::CallbackTypeEnum.new()
+```
+
diff --git a/docs/MediaApi.md b/docs/MediaApi.md
index ac0c433e..6d1c2e09 100644
--- a/docs/MediaApi.md
+++ b/docs/MediaApi.md
@@ -302,6 +302,6 @@ nil (empty response body)
### HTTP request headers
-- **Content-Type**: application/json, application/ogg, application/pdf, application/rtf, application/zip, application/x-tar, application/xml, application/gzip, application/x-bzip2, application/x-gzip, application/smil, application/javascript, audio/mp4, audio/mpeg, audio/ogg, audio/flac, audio/webm, audio/wav, audio/amr, audio/3gpp, image/bmp, image/gif, image/jpeg, image/pjpeg, image/png, image/svg+xml, image/tiff, image/webp, image/x-icon, text/css, text/csv, text/calendar, text/plain, text/javascript, text/vcard, text/vnd.wap.wml, text/xml, video/avi, video/mp4, video/mpeg, video/ogg, video/quicktime, video/webm, video/x-ms-wmv
+- **Content-Type**: application/json, application/ogg, application/pdf, application/rtf, application/zip, application/x-tar, application/xml, application/gzip, application/x-bzip2, application/x-gzip, application/smil, application/javascript, audio/mp4, audio/mpeg, audio/ogg, audio/flac, audio/webm, audio/wav, audio/amr, audio/3gpp, image/bmp, image/gif, image/heic, image/heif, image/jpeg, image/pjpeg, image/png, image/svg+xml, image/tiff, image/webp, image/x-icon, text/css, text/csv, text/calendar, text/html, text/plain, text/javascript, text/vcard, text/vnd.wap.wml, text/xml, video/avi, video/mp4, video/mpeg, video/ogg, video/quicktime, video/webm, video/x-ms-wmv, video/x-flv
- **Accept**: application/json
diff --git a/docs/Message.md b/docs/Message.md
index 266db3a5..0471c8ed 100644
--- a/docs/Message.md
+++ b/docs/Message.md
@@ -27,7 +27,7 @@ instance = Bandwidth::Message.new(
id: 1589228074636lm4k2je7j7jklbn2,
owner: +15554443333,
application_id: 93de2206-9669-4e07-948d-329f4b722ee2,
- time: 2022-09-14T18:20:16Z,
+ time: 2024-12-02T20:15:57.278Z,
segment_count: 2,
direction: null,
to: ["+15552223333"],
diff --git a/docs/MessageCallback.md b/docs/MessageCallback.md
new file mode 100644
index 00000000..4dabd0ae
--- /dev/null
+++ b/docs/MessageCallback.md
@@ -0,0 +1,28 @@
+# Bandwidth::MessageCallback
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **time** | **Time** | | |
+| **type** | [**CallbackTypeEnum**](CallbackTypeEnum.md) | | |
+| **to** | **String** | | |
+| **description** | **String** | A detailed description of the event described by the callback. | |
+| **message** | [**MessageCallbackMessage**](MessageCallbackMessage.md) | | |
+| **error_code** | **Integer** | Optional error code, applicable only when type is `message-failed`. | [optional] |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::MessageCallback.new(
+ time: 2024-12-02T20:15:57.278Z,
+ type: null,
+ to: +15552223333,
+ description: rejected-unallocated-from-number,
+ message: null,
+ error_code: 4405
+)
+```
+
diff --git a/docs/MessageCallbackMessage.md b/docs/MessageCallbackMessage.md
new file mode 100644
index 00000000..1624f4aa
--- /dev/null
+++ b/docs/MessageCallbackMessage.md
@@ -0,0 +1,40 @@
+# Bandwidth::MessageCallbackMessage
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **id** | **String** | | |
+| **owner** | **String** | | |
+| **application_id** | **String** | | |
+| **time** | **Time** | | |
+| **segment_count** | **Integer** | | |
+| **direction** | [**MessageDirectionEnum**](MessageDirectionEnum.md) | | |
+| **to** | **Array<String>** | | |
+| **from** | **String** | | |
+| **text** | **String** | | |
+| **tag** | **String** | | [optional] |
+| **media** | **Array<String>** | Optional media, applicable only for mms | [optional] |
+| **priority** | [**PriorityEnum**](PriorityEnum.md) | | [optional] |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::MessageCallbackMessage.new(
+ id: 1661365814859loidf7mcwd4qacn7,
+ owner: +15553332222,
+ application_id: 93de2206-9669-4e07-948d-329f4b722ee2,
+ time: 2024-12-02T20:15:57.666Z,
+ segment_count: 1,
+ direction: null,
+ to: ["+15552223333"],
+ from: +15553332222,
+ text: Hello world,
+ tag: custom string,
+ media: ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"],
+ priority: null
+)
+```
+
diff --git a/lib/bandwidth-sdk.rb b/lib/bandwidth-sdk.rb
index 65010a01..bfa258bd 100644
--- a/lib/bandwidth-sdk.rb
+++ b/lib/bandwidth-sdk.rb
@@ -31,6 +31,7 @@
require 'bandwidth-sdk/models/call_transcription_response'
require 'bandwidth-sdk/models/call_transcription_track_enum'
require 'bandwidth-sdk/models/callback_method_enum'
+require 'bandwidth-sdk/models/callback_type_enum'
require 'bandwidth-sdk/models/code_request'
require 'bandwidth-sdk/models/conference'
require 'bandwidth-sdk/models/conference_completed_callback'
@@ -53,8 +54,6 @@
require 'bandwidth-sdk/models/field_error'
require 'bandwidth-sdk/models/file_format_enum'
require 'bandwidth-sdk/models/gather_callback'
-require 'bandwidth-sdk/models/inbound_message_callback'
-require 'bandwidth-sdk/models/inbound_message_callback_message'
require 'bandwidth-sdk/models/initiate_callback'
require 'bandwidth-sdk/models/list_message_direction_enum'
require 'bandwidth-sdk/models/list_message_item'
@@ -68,14 +67,10 @@
require 'bandwidth-sdk/models/machine_detection_result'
require 'bandwidth-sdk/models/media'
require 'bandwidth-sdk/models/message'
-require 'bandwidth-sdk/models/message_delivered_callback'
-require 'bandwidth-sdk/models/message_delivered_callback_message'
+require 'bandwidth-sdk/models/message_callback'
+require 'bandwidth-sdk/models/message_callback_message'
require 'bandwidth-sdk/models/message_direction_enum'
-require 'bandwidth-sdk/models/message_failed_callback'
-require 'bandwidth-sdk/models/message_failed_callback_message'
require 'bandwidth-sdk/models/message_request'
-require 'bandwidth-sdk/models/message_sending_callback'
-require 'bandwidth-sdk/models/message_sending_callback_message'
require 'bandwidth-sdk/models/message_status_enum'
require 'bandwidth-sdk/models/message_type_enum'
require 'bandwidth-sdk/models/messages_list'
diff --git a/lib/bandwidth-sdk/api/media_api.rb b/lib/bandwidth-sdk/api/media_api.rb
index 29cb823f..1b98dec4 100644
--- a/lib/bandwidth-sdk/api/media_api.rb
+++ b/lib/bandwidth-sdk/api/media_api.rb
@@ -273,7 +273,7 @@ def upload_media_with_http_info(account_id, media_id, body, opts = {})
# 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', 'application/ogg', 'application/pdf', 'application/rtf', 'application/zip', 'application/x-tar', 'application/xml', 'application/gzip', 'application/x-bzip2', 'application/x-gzip', 'application/smil', 'application/javascript', 'audio/mp4', 'audio/mpeg', 'audio/ogg', 'audio/flac', 'audio/webm', 'audio/wav', 'audio/amr', 'audio/3gpp', 'image/bmp', 'image/gif', 'image/jpeg', 'image/pjpeg', 'image/png', 'image/svg+xml', 'image/tiff', 'image/webp', 'image/x-icon', 'text/css', 'text/csv', 'text/calendar', 'text/plain', 'text/javascript', 'text/vcard', 'text/vnd.wap.wml', 'text/xml', 'video/avi', 'video/mp4', 'video/mpeg', 'video/ogg', 'video/quicktime', 'video/webm', 'video/x-ms-wmv'])
+ content_type = @api_client.select_header_content_type(['application/json', 'application/ogg', 'application/pdf', 'application/rtf', 'application/zip', 'application/x-tar', 'application/xml', 'application/gzip', 'application/x-bzip2', 'application/x-gzip', 'application/smil', 'application/javascript', 'audio/mp4', 'audio/mpeg', 'audio/ogg', 'audio/flac', 'audio/webm', 'audio/wav', 'audio/amr', 'audio/3gpp', 'image/bmp', 'image/gif', 'image/heic', 'image/heif', 'image/jpeg', 'image/pjpeg', 'image/png', 'image/svg+xml', 'image/tiff', 'image/webp', 'image/x-icon', 'text/css', 'text/csv', 'text/calendar', 'text/html', 'text/plain', 'text/javascript', 'text/vcard', 'text/vnd.wap.wml', 'text/xml', 'video/avi', 'video/mp4', 'video/mpeg', 'video/ogg', 'video/quicktime', 'video/webm', 'video/x-ms-wmv', 'video/x-flv'])
if !content_type.nil?
header_params['Content-Type'] = content_type
end
diff --git a/lib/bandwidth-sdk/models/callback_type_enum.rb b/lib/bandwidth-sdk/models/callback_type_enum.rb
new file mode 100644
index 00000000..fe899996
--- /dev/null
+++ b/lib/bandwidth-sdk/models/callback_type_enum.rb
@@ -0,0 +1,42 @@
+=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.8.0
+
+=end
+
+require 'date'
+require 'time'
+
+module Bandwidth
+ class CallbackTypeEnum
+ RECEIVED = 'message-received'.freeze
+ SENDING = 'message-sending'.freeze
+ DELIVERED = 'message-delivered'.freeze
+ FAILED = 'message-failed'.freeze
+
+ def self.all_vars
+ @all_vars ||= [RECEIVED, SENDING, DELIVERED, FAILED].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 CallbackTypeEnum.all_vars.include?(value)
+ raise "Invalid ENUM value #{value} for class #CallbackTypeEnum"
+ end
+ end
+end
diff --git a/lib/bandwidth-sdk/models/disconenct_callback.rb b/lib/bandwidth-sdk/models/disconenct_callback.rb
deleted file mode 100644
index b6b16e44..00000000
--- a/lib/bandwidth-sdk/models/disconenct_callback.rb
+++ /dev/null
@@ -1,405 +0,0 @@
-=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
-OpenAPI Generator version: 6.3.0
-
-=end
-
-require 'date'
-require 'time'
-
-module Bandwidth
- # The Disconnect event is fired when a call ends, for any reason.
- class DisconenctCallback
- # The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect.
- attr_accessor :event_type
-
- # The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution.
- attr_accessor :event_time
-
- # The user account associated with the call.
- attr_accessor :account_id
-
- # The id of the application associated with the call.
- attr_accessor :application_id
-
- # The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.
- attr_accessor :from
-
- # The phone number that received the call, in E.164 format (e.g. +15555555555).
- attr_accessor :to
-
- # The call id associated with the event.
- attr_accessor :call_id
-
- attr_accessor :direction
-
- # The URL of the call associated with the event.
- attr_accessor :call_url
-
- # (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format.
- attr_accessor :enqueued_time
-
- # Time the call was started, in ISO 8601 format.
- attr_accessor :start_time
-
- # Time the call was answered, in ISO 8601 format.
- attr_accessor :answer_time
-
- # The time that the recording ended in ISO-8601 format
- attr_accessor :end_time
-
- # Reason the call failed - hangup, busy, timeout, cancel, rejected, callback-error, invalid-bxml, application-error, account-limit, node-capacity-exceeded, error, or unknown.
- attr_accessor :cause
-
- # Text explaining the reason that caused the call to fail in case of errors.
- attr_accessor :error_message
-
- # Bandwidth's internal id that references the error event.
- attr_accessor :error_id
-
- # (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.
- 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
- {
- :'event_type' => :'eventType',
- :'event_time' => :'eventTime',
- :'account_id' => :'accountId',
- :'application_id' => :'applicationId',
- :'from' => :'from',
- :'to' => :'to',
- :'call_id' => :'callId',
- :'direction' => :'direction',
- :'call_url' => :'callUrl',
- :'enqueued_time' => :'enqueuedTime',
- :'start_time' => :'startTime',
- :'answer_time' => :'answerTime',
- :'end_time' => :'endTime',
- :'cause' => :'cause',
- :'error_message' => :'errorMessage',
- :'error_id' => :'errorId',
- :'tag' => :'tag'
- }
- end
-
- # Returns all the JSON keys this model knows about
- def self.acceptable_attributes
- attribute_map.values
- end
-
- # Attribute type mapping.
- def self.openapi_types
- {
- :'event_type' => :'String',
- :'event_time' => :'String',
- :'account_id' => :'String',
- :'application_id' => :'String',
- :'from' => :'String',
- :'to' => :'String',
- :'call_id' => :'String',
- :'direction' => :'CallDirectionEnum',
- :'call_url' => :'String',
- :'enqueued_time' => :'Time',
- :'start_time' => :'Time',
- :'answer_time' => :'Time',
- :'end_time' => :'Time',
- :'cause' => :'String',
- :'error_message' => :'String',
- :'error_id' => :'String',
- :'tag' => :'String'
- }
- end
-
- # List of attributes with nullable: true
- def self.openapi_nullable
- Set.new([
- :'enqueued_time',
- :'answer_time',
- :'error_message',
- :'error_id',
- :'tag'
- ])
- 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::DisconenctCallback` initialize method'
- end
-
- # check to see if the attribute exists and convert string to symbol for hash key
- attributes = attributes.each_with_object({}) { |(k, v), h|
- if (!self.class.attribute_map.key?(k.to_sym))
- fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::DisconenctCallback`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
- end
- h[k.to_sym] = v
- }
-
- if attributes.key?(:'event_type')
- self.event_type = attributes[:'event_type']
- end
-
- if attributes.key?(:'event_time')
- self.event_time = attributes[:'event_time']
- end
-
- if attributes.key?(:'account_id')
- self.account_id = attributes[:'account_id']
- end
-
- if attributes.key?(:'application_id')
- self.application_id = attributes[:'application_id']
- end
-
- if attributes.key?(:'from')
- self.from = attributes[:'from']
- end
-
- if attributes.key?(:'to')
- self.to = attributes[:'to']
- end
-
- if attributes.key?(:'call_id')
- self.call_id = attributes[:'call_id']
- end
-
- if attributes.key?(:'direction')
- self.direction = attributes[:'direction']
- end
-
- if attributes.key?(:'call_url')
- self.call_url = attributes[:'call_url']
- end
-
- if attributes.key?(:'enqueued_time')
- self.enqueued_time = attributes[:'enqueued_time']
- end
-
- if attributes.key?(:'start_time')
- self.start_time = attributes[:'start_time']
- end
-
- if attributes.key?(:'answer_time')
- self.answer_time = attributes[:'answer_time']
- end
-
- if attributes.key?(:'end_time')
- self.end_time = attributes[:'end_time']
- end
-
- if attributes.key?(:'cause')
- self.cause = attributes[:'cause']
- end
-
- if attributes.key?(:'error_message')
- self.error_message = attributes[:'error_message']
- end
-
- if attributes.key?(:'error_id')
- self.error_id = attributes[:'error_id']
- 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
- 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?
- 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 &&
- event_type == o.event_type &&
- event_time == o.event_time &&
- account_id == o.account_id &&
- application_id == o.application_id &&
- from == o.from &&
- to == o.to &&
- call_id == o.call_id &&
- direction == o.direction &&
- call_url == o.call_url &&
- enqueued_time == o.enqueued_time &&
- start_time == o.start_time &&
- answer_time == o.answer_time &&
- end_time == o.end_time &&
- cause == o.cause &&
- error_message == o.error_message &&
- error_id == o.error_id &&
- 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
- [event_type, event_time, account_id, application_id, from, to, call_id, direction, call_url, enqueued_time, start_time, answer_time, end_time, cause, error_message, error_id, 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)
- new.build_from_hash(attributes)
- end
-
- # Builds the object from hash
- # @param [Hash] attributes Model attributes in the form of hash
- # @return [Object] Returns the model itself
- def build_from_hash(attributes)
- return nil unless attributes.is_a?(Hash)
- attributes = attributes.transform_keys(&:to_sym)
- self.class.openapi_types.each_pair do |key, type|
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
- self.send("#{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[self.class.attribute_map[key]].is_a?(Array)
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
- end
- elsif !attributes[self.class.attribute_map[key]].nil?
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
- end
- end
-
- self
- end
-
- # Deserializes the data based on type
- # @param string type Data type
- # @param string value Value to be deserialized
- # @return [Object] Deserialized data
- def _deserialize(type, value)
- case type.to_sym
- when :Time
- Time.parse(value)
- when :Date
- Date.parse(value)
- when :String
- value.to_s
- when :Integer
- value.to_i
- when :Float
- value.to_f
- when :Boolean
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
- true
- else
- false
- end
- when :Object
- # generic object (usually a Hash), return directly
- value
- when /\AArray<(?.+)>\z/
- inner_type = Regexp.last_match[:inner_type]
- value.map { |v| _deserialize(inner_type, v) }
- when /\AHash<(?.+?), (?.+)>\z/
- k_type = Regexp.last_match[:k_type]
- v_type = Regexp.last_match[:v_type]
- {}.tap do |hash|
- value.each do |k, v|
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
- end
- end
- else # model
- # models (e.g. Pet) or oneOf
- klass = Bandwidth.const_get(type)
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
- end
- end
-
- # Returns the string representation of the object
- # @return [String] String presentation of the object
- def to_s
- to_hash.to_s
- end
-
- # to_body is an alias to to_hash (backward compatibility)
- # @return [Hash] Returns the object in the form of hash
- def to_body
- to_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
-
- # Outputs non-array value in the form of hash
- # For object, use to_hash. Otherwise, just return the value
- # @param [Object] value Any valid value
- # @return [Hash] Returns the value in the form of hash
- def _to_hash(value)
- if value.is_a?(Array)
- value.compact.map { |v| _to_hash(v) }
- elsif value.is_a?(Hash)
- {}.tap do |hash|
- value.each { |k, v| hash[k] = _to_hash(v) }
- end
- elsif value.respond_to? :to_hash
- value.to_hash
- else
- value
- end
- end
- end
-end
diff --git a/lib/bandwidth-sdk/models/inbound_message_callback.rb b/lib/bandwidth-sdk/models/inbound_message_callback.rb
deleted file mode 100644
index a29968d7..00000000
--- a/lib/bandwidth-sdk/models/inbound_message_callback.rb
+++ /dev/null
@@ -1,284 +0,0 @@
-=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.8.0
-
-=end
-
-require 'date'
-require 'time'
-
-module Bandwidth
- # Inbound Message Callback
- class InboundMessageCallback
- attr_accessor :time
-
- attr_accessor :type
-
- attr_accessor :to
-
- attr_accessor :description
-
- attr_accessor :message
-
- # Attribute mapping from ruby-style variable name to JSON key.
- def self.attribute_map
- {
- :'time' => :'time',
- :'type' => :'type',
- :'to' => :'to',
- :'description' => :'description',
- :'message' => :'message'
- }
- end
-
- # Returns all the JSON keys this model knows about
- def self.acceptable_attributes
- attribute_map.values
- end
-
- # Attribute type mapping.
- def self.openapi_types
- {
- :'time' => :'Time',
- :'type' => :'String',
- :'to' => :'String',
- :'description' => :'String',
- :'message' => :'InboundMessageCallbackMessage'
- }
- 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::InboundMessageCallback` initialize method'
- end
-
- # check to see if the attribute exists and convert string to symbol for hash key
- attributes = attributes.each_with_object({}) { |(k, v), h|
- if (!self.class.attribute_map.key?(k.to_sym))
- fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::InboundMessageCallback`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
- end
- h[k.to_sym] = v
- }
-
- if attributes.key?(:'time')
- self.time = attributes[:'time']
- else
- self.time = nil
- end
-
- if attributes.key?(:'type')
- self.type = attributes[:'type']
- else
- self.type = nil
- end
-
- if attributes.key?(:'to')
- self.to = attributes[:'to']
- else
- self.to = nil
- end
-
- if attributes.key?(:'description')
- self.description = attributes[:'description']
- else
- self.description = nil
- end
-
- if attributes.key?(:'message')
- self.message = attributes[:'message']
- else
- self.message = 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 @time.nil?
- invalid_properties.push('invalid value for "time", time cannot be nil.')
- end
-
- if @type.nil?
- invalid_properties.push('invalid value for "type", type cannot be nil.')
- end
-
- if @to.nil?
- invalid_properties.push('invalid value for "to", to cannot be nil.')
- end
-
- if @description.nil?
- invalid_properties.push('invalid value for "description", description cannot be nil.')
- end
-
- if @message.nil?
- invalid_properties.push('invalid value for "message", message 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 @time.nil?
- return false if @type.nil?
- return false if @to.nil?
- return false if @description.nil?
- return false if @message.nil?
- 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 &&
- time == o.time &&
- type == o.type &&
- to == o.to &&
- description == o.description &&
- message == o.message
- 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
- [time, type, to, description, message].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
-
- # Deserializes the data based on type
- # @param string type Data type
- # @param string value Value to be deserialized
- # @return [Object] Deserialized data
- def self._deserialize(type, value)
- case type.to_sym
- when :Time
- Time.parse(value)
- when :Date
- Date.parse(value)
- when :String
- value.to_s
- when :Integer
- value.to_i
- when :Float
- value.to_f
- when :Boolean
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
- true
- else
- false
- end
- when :Object
- # generic object (usually a Hash), return directly
- value
- when /\AArray<(?.+)>\z/
- inner_type = Regexp.last_match[:inner_type]
- value.map { |v| _deserialize(inner_type, v) }
- when /\AHash<(?.+?), (?.+)>\z/
- k_type = Regexp.last_match[:k_type]
- v_type = Regexp.last_match[:v_type]
- {}.tap do |hash|
- value.each do |k, v|
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
- end
- end
- else # model
- # models (e.g. Pet) or oneOf
- klass = Bandwidth.const_get(type)
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
- end
- end
-
- # Returns the string representation of the object
- # @return [String] String presentation of the object
- def to_s
- to_hash.to_s
- end
-
- # to_body is an alias to to_hash (backward compatibility)
- # @return [Hash] Returns the object in the form of hash
- def to_body
- to_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
-
- # Outputs non-array value in the form of hash
- # For object, use to_hash. Otherwise, just return the value
- # @param [Object] value Any valid value
- # @return [Hash] Returns the value in the form of hash
- def _to_hash(value)
- if value.is_a?(Array)
- value.compact.map { |v| _to_hash(v) }
- elsif value.is_a?(Hash)
- {}.tap do |hash|
- value.each { |k, v| hash[k] = _to_hash(v) }
- end
- elsif value.respond_to? :to_hash
- value.to_hash
- else
- value
- end
- end
- end
-end
diff --git a/lib/bandwidth-sdk/models/message_failed_callback.rb b/lib/bandwidth-sdk/models/message_callback.rb
similarity index 89%
rename from lib/bandwidth-sdk/models/message_failed_callback.rb
rename to lib/bandwidth-sdk/models/message_callback.rb
index 0fae1e55..51b553fd 100644
--- a/lib/bandwidth-sdk/models/message_failed_callback.rb
+++ b/lib/bandwidth-sdk/models/message_callback.rb
@@ -14,20 +14,44 @@
require 'time'
module Bandwidth
- # Message Failed Callback
- class MessageFailedCallback
+ # Message Callback Schema
+ class MessageCallback
attr_accessor :time
attr_accessor :type
attr_accessor :to
+ # A detailed description of the event described by the callback.
attr_accessor :description
attr_accessor :message
+ # Optional error code, applicable only when type is `message-failed`.
attr_accessor :error_code
+ 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
{
@@ -49,10 +73,10 @@ def self.acceptable_attributes
def self.openapi_types
{
:'time' => :'Time',
- :'type' => :'String',
+ :'type' => :'CallbackTypeEnum',
:'to' => :'String',
:'description' => :'String',
- :'message' => :'MessageFailedCallbackMessage',
+ :'message' => :'MessageCallbackMessage',
:'error_code' => :'Integer'
}
end
@@ -60,6 +84,7 @@ def self.openapi_types
# List of attributes with nullable: true
def self.openapi_nullable
Set.new([
+ :'error_code'
])
end
@@ -67,13 +92,13 @@ def self.openapi_nullable
# @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::MessageFailedCallback` initialize method'
+ fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::MessageCallback` initialize method'
end
# check to see if the attribute exists and convert string to symbol for hash key
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
- fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::MessageFailedCallback`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::MessageCallback`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
end
h[k.to_sym] = v
}
@@ -110,8 +135,6 @@ def initialize(attributes = {})
if attributes.key?(:'error_code')
self.error_code = attributes[:'error_code']
- else
- self.error_code = nil
end
end
@@ -140,10 +163,6 @@ def list_invalid_properties
invalid_properties.push('invalid value for "message", message cannot be nil.')
end
- if @error_code.nil?
- invalid_properties.push('invalid value for "error_code", error_code cannot be nil.')
- end
-
invalid_properties
end
@@ -156,7 +175,6 @@ def valid?
return false if @to.nil?
return false if @description.nil?
return false if @message.nil?
- return false if @error_code.nil?
true
end
diff --git a/lib/bandwidth-sdk/models/inbound_message_callback_message.rb b/lib/bandwidth-sdk/models/message_callback_message.rb
similarity index 96%
rename from lib/bandwidth-sdk/models/inbound_message_callback_message.rb
rename to lib/bandwidth-sdk/models/message_callback_message.rb
index 9c99e4e4..9392bb82 100644
--- a/lib/bandwidth-sdk/models/inbound_message_callback_message.rb
+++ b/lib/bandwidth-sdk/models/message_callback_message.rb
@@ -14,8 +14,8 @@
require 'time'
module Bandwidth
- # Inbound Message Callback Message Schema
- class InboundMessageCallbackMessage
+ # Message payload schema within a MessageCallback
+ class MessageCallbackMessage
attr_accessor :id
attr_accessor :owner
@@ -36,6 +36,7 @@ class InboundMessageCallbackMessage
attr_accessor :tag
+ # Optional media, applicable only for mms
attr_accessor :media
attr_accessor :priority
@@ -106,6 +107,7 @@ def self.openapi_types
# List of attributes with nullable: true
def self.openapi_nullable
Set.new([
+ :'media',
])
end
@@ -113,13 +115,13 @@ def self.openapi_nullable
# @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::InboundMessageCallbackMessage` initialize method'
+ fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::MessageCallbackMessage` initialize method'
end
# check to see if the attribute exists and convert string to symbol for hash key
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
- fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::InboundMessageCallbackMessage`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::MessageCallbackMessage`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
end
h[k.to_sym] = v
}
diff --git a/lib/bandwidth-sdk/models/message_delivered_callback.rb b/lib/bandwidth-sdk/models/message_delivered_callback.rb
deleted file mode 100644
index 8422a312..00000000
--- a/lib/bandwidth-sdk/models/message_delivered_callback.rb
+++ /dev/null
@@ -1,284 +0,0 @@
-=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.8.0
-
-=end
-
-require 'date'
-require 'time'
-
-module Bandwidth
- # Message Delivered Callback
- class MessageDeliveredCallback
- attr_accessor :time
-
- attr_accessor :type
-
- attr_accessor :to
-
- attr_accessor :description
-
- attr_accessor :message
-
- # Attribute mapping from ruby-style variable name to JSON key.
- def self.attribute_map
- {
- :'time' => :'time',
- :'type' => :'type',
- :'to' => :'to',
- :'description' => :'description',
- :'message' => :'message'
- }
- end
-
- # Returns all the JSON keys this model knows about
- def self.acceptable_attributes
- attribute_map.values
- end
-
- # Attribute type mapping.
- def self.openapi_types
- {
- :'time' => :'Time',
- :'type' => :'String',
- :'to' => :'String',
- :'description' => :'String',
- :'message' => :'MessageDeliveredCallbackMessage'
- }
- 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::MessageDeliveredCallback` initialize method'
- end
-
- # check to see if the attribute exists and convert string to symbol for hash key
- attributes = attributes.each_with_object({}) { |(k, v), h|
- if (!self.class.attribute_map.key?(k.to_sym))
- fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::MessageDeliveredCallback`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
- end
- h[k.to_sym] = v
- }
-
- if attributes.key?(:'time')
- self.time = attributes[:'time']
- else
- self.time = nil
- end
-
- if attributes.key?(:'type')
- self.type = attributes[:'type']
- else
- self.type = nil
- end
-
- if attributes.key?(:'to')
- self.to = attributes[:'to']
- else
- self.to = nil
- end
-
- if attributes.key?(:'description')
- self.description = attributes[:'description']
- else
- self.description = nil
- end
-
- if attributes.key?(:'message')
- self.message = attributes[:'message']
- else
- self.message = 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 @time.nil?
- invalid_properties.push('invalid value for "time", time cannot be nil.')
- end
-
- if @type.nil?
- invalid_properties.push('invalid value for "type", type cannot be nil.')
- end
-
- if @to.nil?
- invalid_properties.push('invalid value for "to", to cannot be nil.')
- end
-
- if @description.nil?
- invalid_properties.push('invalid value for "description", description cannot be nil.')
- end
-
- if @message.nil?
- invalid_properties.push('invalid value for "message", message 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 @time.nil?
- return false if @type.nil?
- return false if @to.nil?
- return false if @description.nil?
- return false if @message.nil?
- 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 &&
- time == o.time &&
- type == o.type &&
- to == o.to &&
- description == o.description &&
- message == o.message
- 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
- [time, type, to, description, message].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
-
- # Deserializes the data based on type
- # @param string type Data type
- # @param string value Value to be deserialized
- # @return [Object] Deserialized data
- def self._deserialize(type, value)
- case type.to_sym
- when :Time
- Time.parse(value)
- when :Date
- Date.parse(value)
- when :String
- value.to_s
- when :Integer
- value.to_i
- when :Float
- value.to_f
- when :Boolean
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
- true
- else
- false
- end
- when :Object
- # generic object (usually a Hash), return directly
- value
- when /\AArray<(?.+)>\z/
- inner_type = Regexp.last_match[:inner_type]
- value.map { |v| _deserialize(inner_type, v) }
- when /\AHash<(?.+?), (?.+)>\z/
- k_type = Regexp.last_match[:k_type]
- v_type = Regexp.last_match[:v_type]
- {}.tap do |hash|
- value.each do |k, v|
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
- end
- end
- else # model
- # models (e.g. Pet) or oneOf
- klass = Bandwidth.const_get(type)
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
- end
- end
-
- # Returns the string representation of the object
- # @return [String] String presentation of the object
- def to_s
- to_hash.to_s
- end
-
- # to_body is an alias to to_hash (backward compatibility)
- # @return [Hash] Returns the object in the form of hash
- def to_body
- to_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
-
- # Outputs non-array value in the form of hash
- # For object, use to_hash. Otherwise, just return the value
- # @param [Object] value Any valid value
- # @return [Hash] Returns the value in the form of hash
- def _to_hash(value)
- if value.is_a?(Array)
- value.compact.map { |v| _to_hash(v) }
- elsif value.is_a?(Hash)
- {}.tap do |hash|
- value.each { |k, v| hash[k] = _to_hash(v) }
- end
- elsif value.respond_to? :to_hash
- value.to_hash
- else
- value
- end
- end
- end
-end
diff --git a/lib/bandwidth-sdk/models/message_delivered_callback_message.rb b/lib/bandwidth-sdk/models/message_delivered_callback_message.rb
deleted file mode 100644
index a9ba4ca8..00000000
--- a/lib/bandwidth-sdk/models/message_delivered_callback_message.rb
+++ /dev/null
@@ -1,418 +0,0 @@
-=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.8.0
-
-=end
-
-require 'date'
-require 'time'
-
-module Bandwidth
- # Message Delivered Callback Message Schema
- class MessageDeliveredCallbackMessage
- attr_accessor :id
-
- attr_accessor :owner
-
- attr_accessor :application_id
-
- attr_accessor :time
-
- attr_accessor :segment_count
-
- attr_accessor :direction
-
- attr_accessor :to
-
- attr_accessor :from
-
- attr_accessor :text
-
- attr_accessor :tag
-
- attr_accessor :media
-
- attr_accessor :priority
-
- 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
- {
- :'id' => :'id',
- :'owner' => :'owner',
- :'application_id' => :'applicationId',
- :'time' => :'time',
- :'segment_count' => :'segmentCount',
- :'direction' => :'direction',
- :'to' => :'to',
- :'from' => :'from',
- :'text' => :'text',
- :'tag' => :'tag',
- :'media' => :'media',
- :'priority' => :'priority'
- }
- end
-
- # Returns all the JSON keys this model knows about
- def self.acceptable_attributes
- attribute_map.values
- end
-
- # Attribute type mapping.
- def self.openapi_types
- {
- :'id' => :'String',
- :'owner' => :'String',
- :'application_id' => :'String',
- :'time' => :'Time',
- :'segment_count' => :'Integer',
- :'direction' => :'MessageDirectionEnum',
- :'to' => :'Array',
- :'from' => :'String',
- :'text' => :'String',
- :'tag' => :'String',
- :'media' => :'Array',
- :'priority' => :'PriorityEnum'
- }
- 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::MessageDeliveredCallbackMessage` initialize method'
- end
-
- # check to see if the attribute exists and convert string to symbol for hash key
- attributes = attributes.each_with_object({}) { |(k, v), h|
- if (!self.class.attribute_map.key?(k.to_sym))
- fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::MessageDeliveredCallbackMessage`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
- end
- h[k.to_sym] = v
- }
-
- if attributes.key?(:'id')
- self.id = attributes[:'id']
- else
- self.id = nil
- end
-
- if attributes.key?(:'owner')
- self.owner = attributes[:'owner']
- else
- self.owner = nil
- end
-
- if attributes.key?(:'application_id')
- self.application_id = attributes[:'application_id']
- else
- self.application_id = nil
- end
-
- if attributes.key?(:'time')
- self.time = attributes[:'time']
- else
- self.time = nil
- end
-
- if attributes.key?(:'segment_count')
- self.segment_count = attributes[:'segment_count']
- else
- self.segment_count = nil
- end
-
- if attributes.key?(:'direction')
- self.direction = attributes[:'direction']
- else
- self.direction = nil
- end
-
- if attributes.key?(:'to')
- if (value = attributes[:'to']).is_a?(Array)
- self.to = value
- end
- else
- self.to = nil
- end
-
- if attributes.key?(:'from')
- self.from = attributes[:'from']
- else
- self.from = nil
- end
-
- if attributes.key?(:'text')
- self.text = attributes[:'text']
- else
- self.text = nil
- end
-
- if attributes.key?(:'tag')
- self.tag = attributes[:'tag']
- else
- self.tag = nil
- end
-
- if attributes.key?(:'media')
- if (value = attributes[:'media']).is_a?(Array)
- self.media = value
- end
- end
-
- if attributes.key?(:'priority')
- self.priority = attributes[:'priority']
- 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 @id.nil?
- invalid_properties.push('invalid value for "id", id cannot be nil.')
- end
-
- if @owner.nil?
- invalid_properties.push('invalid value for "owner", owner cannot be nil.')
- end
-
- if @application_id.nil?
- invalid_properties.push('invalid value for "application_id", application_id cannot be nil.')
- end
-
- if @time.nil?
- invalid_properties.push('invalid value for "time", time cannot be nil.')
- end
-
- if @segment_count.nil?
- invalid_properties.push('invalid value for "segment_count", segment_count cannot be nil.')
- end
-
- if @direction.nil?
- invalid_properties.push('invalid value for "direction", direction cannot be nil.')
- end
-
- if @to.nil?
- invalid_properties.push('invalid value for "to", to cannot be nil.')
- end
-
- if @from.nil?
- invalid_properties.push('invalid value for "from", from cannot be nil.')
- end
-
- if @text.nil?
- invalid_properties.push('invalid value for "text", text cannot be nil.')
- end
-
- if @tag.nil?
- invalid_properties.push('invalid value for "tag", tag 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 @id.nil?
- return false if @owner.nil?
- return false if @application_id.nil?
- return false if @time.nil?
- return false if @segment_count.nil?
- return false if @direction.nil?
- return false if @to.nil?
- return false if @from.nil?
- return false if @text.nil?
- return false if @tag.nil?
- true
- end
-
- # Custom attribute writer method with validation
- # @param [Object] to Value to be assigned
- def to=(to)
- if to.nil?
- fail ArgumentError, 'to cannot be nil'
- end
-
- @to = to
- 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 &&
- owner == o.owner &&
- application_id == o.application_id &&
- time == o.time &&
- segment_count == o.segment_count &&
- direction == o.direction &&
- to == o.to &&
- from == o.from &&
- text == o.text &&
- tag == o.tag &&
- media == o.media &&
- priority == o.priority
- 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, owner, application_id, time, segment_count, direction, to, from, text, tag, media, priority].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
-
- # Deserializes the data based on type
- # @param string type Data type
- # @param string value Value to be deserialized
- # @return [Object] Deserialized data
- def self._deserialize(type, value)
- case type.to_sym
- when :Time
- Time.parse(value)
- when :Date
- Date.parse(value)
- when :String
- value.to_s
- when :Integer
- value.to_i
- when :Float
- value.to_f
- when :Boolean
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
- true
- else
- false
- end
- when :Object
- # generic object (usually a Hash), return directly
- value
- when /\AArray<(?.+)>\z/
- inner_type = Regexp.last_match[:inner_type]
- value.map { |v| _deserialize(inner_type, v) }
- when /\AHash<(?.+?), (?.+)>\z/
- k_type = Regexp.last_match[:k_type]
- v_type = Regexp.last_match[:v_type]
- {}.tap do |hash|
- value.each do |k, v|
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
- end
- end
- else # model
- # models (e.g. Pet) or oneOf
- klass = Bandwidth.const_get(type)
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
- end
- end
-
- # Returns the string representation of the object
- # @return [String] String presentation of the object
- def to_s
- to_hash.to_s
- end
-
- # to_body is an alias to to_hash (backward compatibility)
- # @return [Hash] Returns the object in the form of hash
- def to_body
- to_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
-
- # Outputs non-array value in the form of hash
- # For object, use to_hash. Otherwise, just return the value
- # @param [Object] value Any valid value
- # @return [Hash] Returns the value in the form of hash
- def _to_hash(value)
- if value.is_a?(Array)
- value.compact.map { |v| _to_hash(v) }
- elsif value.is_a?(Hash)
- {}.tap do |hash|
- value.each { |k, v| hash[k] = _to_hash(v) }
- end
- elsif value.respond_to? :to_hash
- value.to_hash
- else
- value
- end
- end
- end
-end
diff --git a/lib/bandwidth-sdk/models/message_failed_callback_message.rb b/lib/bandwidth-sdk/models/message_failed_callback_message.rb
deleted file mode 100644
index be2e2c2d..00000000
--- a/lib/bandwidth-sdk/models/message_failed_callback_message.rb
+++ /dev/null
@@ -1,418 +0,0 @@
-=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.8.0
-
-=end
-
-require 'date'
-require 'time'
-
-module Bandwidth
- # Message Failed Callback Message Schema
- class MessageFailedCallbackMessage
- attr_accessor :id
-
- attr_accessor :owner
-
- attr_accessor :application_id
-
- attr_accessor :time
-
- attr_accessor :segment_count
-
- attr_accessor :direction
-
- attr_accessor :to
-
- attr_accessor :from
-
- attr_accessor :text
-
- attr_accessor :tag
-
- attr_accessor :media
-
- attr_accessor :priority
-
- 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
- {
- :'id' => :'id',
- :'owner' => :'owner',
- :'application_id' => :'applicationId',
- :'time' => :'time',
- :'segment_count' => :'segmentCount',
- :'direction' => :'direction',
- :'to' => :'to',
- :'from' => :'from',
- :'text' => :'text',
- :'tag' => :'tag',
- :'media' => :'media',
- :'priority' => :'priority'
- }
- end
-
- # Returns all the JSON keys this model knows about
- def self.acceptable_attributes
- attribute_map.values
- end
-
- # Attribute type mapping.
- def self.openapi_types
- {
- :'id' => :'String',
- :'owner' => :'String',
- :'application_id' => :'String',
- :'time' => :'Time',
- :'segment_count' => :'Integer',
- :'direction' => :'MessageDirectionEnum',
- :'to' => :'Array',
- :'from' => :'String',
- :'text' => :'String',
- :'tag' => :'String',
- :'media' => :'Array',
- :'priority' => :'PriorityEnum'
- }
- 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::MessageFailedCallbackMessage` initialize method'
- end
-
- # check to see if the attribute exists and convert string to symbol for hash key
- attributes = attributes.each_with_object({}) { |(k, v), h|
- if (!self.class.attribute_map.key?(k.to_sym))
- fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::MessageFailedCallbackMessage`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
- end
- h[k.to_sym] = v
- }
-
- if attributes.key?(:'id')
- self.id = attributes[:'id']
- else
- self.id = nil
- end
-
- if attributes.key?(:'owner')
- self.owner = attributes[:'owner']
- else
- self.owner = nil
- end
-
- if attributes.key?(:'application_id')
- self.application_id = attributes[:'application_id']
- else
- self.application_id = nil
- end
-
- if attributes.key?(:'time')
- self.time = attributes[:'time']
- else
- self.time = nil
- end
-
- if attributes.key?(:'segment_count')
- self.segment_count = attributes[:'segment_count']
- else
- self.segment_count = nil
- end
-
- if attributes.key?(:'direction')
- self.direction = attributes[:'direction']
- else
- self.direction = nil
- end
-
- if attributes.key?(:'to')
- if (value = attributes[:'to']).is_a?(Array)
- self.to = value
- end
- else
- self.to = nil
- end
-
- if attributes.key?(:'from')
- self.from = attributes[:'from']
- else
- self.from = nil
- end
-
- if attributes.key?(:'text')
- self.text = attributes[:'text']
- else
- self.text = nil
- end
-
- if attributes.key?(:'tag')
- self.tag = attributes[:'tag']
- else
- self.tag = nil
- end
-
- if attributes.key?(:'media')
- if (value = attributes[:'media']).is_a?(Array)
- self.media = value
- end
- end
-
- if attributes.key?(:'priority')
- self.priority = attributes[:'priority']
- 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 @id.nil?
- invalid_properties.push('invalid value for "id", id cannot be nil.')
- end
-
- if @owner.nil?
- invalid_properties.push('invalid value for "owner", owner cannot be nil.')
- end
-
- if @application_id.nil?
- invalid_properties.push('invalid value for "application_id", application_id cannot be nil.')
- end
-
- if @time.nil?
- invalid_properties.push('invalid value for "time", time cannot be nil.')
- end
-
- if @segment_count.nil?
- invalid_properties.push('invalid value for "segment_count", segment_count cannot be nil.')
- end
-
- if @direction.nil?
- invalid_properties.push('invalid value for "direction", direction cannot be nil.')
- end
-
- if @to.nil?
- invalid_properties.push('invalid value for "to", to cannot be nil.')
- end
-
- if @from.nil?
- invalid_properties.push('invalid value for "from", from cannot be nil.')
- end
-
- if @text.nil?
- invalid_properties.push('invalid value for "text", text cannot be nil.')
- end
-
- if @tag.nil?
- invalid_properties.push('invalid value for "tag", tag 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 @id.nil?
- return false if @owner.nil?
- return false if @application_id.nil?
- return false if @time.nil?
- return false if @segment_count.nil?
- return false if @direction.nil?
- return false if @to.nil?
- return false if @from.nil?
- return false if @text.nil?
- return false if @tag.nil?
- true
- end
-
- # Custom attribute writer method with validation
- # @param [Object] to Value to be assigned
- def to=(to)
- if to.nil?
- fail ArgumentError, 'to cannot be nil'
- end
-
- @to = to
- 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 &&
- owner == o.owner &&
- application_id == o.application_id &&
- time == o.time &&
- segment_count == o.segment_count &&
- direction == o.direction &&
- to == o.to &&
- from == o.from &&
- text == o.text &&
- tag == o.tag &&
- media == o.media &&
- priority == o.priority
- 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, owner, application_id, time, segment_count, direction, to, from, text, tag, media, priority].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
-
- # Deserializes the data based on type
- # @param string type Data type
- # @param string value Value to be deserialized
- # @return [Object] Deserialized data
- def self._deserialize(type, value)
- case type.to_sym
- when :Time
- Time.parse(value)
- when :Date
- Date.parse(value)
- when :String
- value.to_s
- when :Integer
- value.to_i
- when :Float
- value.to_f
- when :Boolean
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
- true
- else
- false
- end
- when :Object
- # generic object (usually a Hash), return directly
- value
- when /\AArray<(?.+)>\z/
- inner_type = Regexp.last_match[:inner_type]
- value.map { |v| _deserialize(inner_type, v) }
- when /\AHash<(?.+?), (?.+)>\z/
- k_type = Regexp.last_match[:k_type]
- v_type = Regexp.last_match[:v_type]
- {}.tap do |hash|
- value.each do |k, v|
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
- end
- end
- else # model
- # models (e.g. Pet) or oneOf
- klass = Bandwidth.const_get(type)
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
- end
- end
-
- # Returns the string representation of the object
- # @return [String] String presentation of the object
- def to_s
- to_hash.to_s
- end
-
- # to_body is an alias to to_hash (backward compatibility)
- # @return [Hash] Returns the object in the form of hash
- def to_body
- to_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
-
- # Outputs non-array value in the form of hash
- # For object, use to_hash. Otherwise, just return the value
- # @param [Object] value Any valid value
- # @return [Hash] Returns the value in the form of hash
- def _to_hash(value)
- if value.is_a?(Array)
- value.compact.map { |v| _to_hash(v) }
- elsif value.is_a?(Hash)
- {}.tap do |hash|
- value.each { |k, v| hash[k] = _to_hash(v) }
- end
- elsif value.respond_to? :to_hash
- value.to_hash
- else
- value
- end
- end
- end
-end
diff --git a/lib/bandwidth-sdk/models/message_sending_callback.rb b/lib/bandwidth-sdk/models/message_sending_callback.rb
deleted file mode 100644
index 79e5368e..00000000
--- a/lib/bandwidth-sdk/models/message_sending_callback.rb
+++ /dev/null
@@ -1,284 +0,0 @@
-=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.8.0
-
-=end
-
-require 'date'
-require 'time'
-
-module Bandwidth
- # Message Sending Callback
- class MessageSendingCallback
- attr_accessor :time
-
- attr_accessor :type
-
- attr_accessor :to
-
- attr_accessor :description
-
- attr_accessor :message
-
- # Attribute mapping from ruby-style variable name to JSON key.
- def self.attribute_map
- {
- :'time' => :'time',
- :'type' => :'type',
- :'to' => :'to',
- :'description' => :'description',
- :'message' => :'message'
- }
- end
-
- # Returns all the JSON keys this model knows about
- def self.acceptable_attributes
- attribute_map.values
- end
-
- # Attribute type mapping.
- def self.openapi_types
- {
- :'time' => :'Time',
- :'type' => :'String',
- :'to' => :'String',
- :'description' => :'String',
- :'message' => :'MessageSendingCallbackMessage'
- }
- 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::MessageSendingCallback` initialize method'
- end
-
- # check to see if the attribute exists and convert string to symbol for hash key
- attributes = attributes.each_with_object({}) { |(k, v), h|
- if (!self.class.attribute_map.key?(k.to_sym))
- fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::MessageSendingCallback`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
- end
- h[k.to_sym] = v
- }
-
- if attributes.key?(:'time')
- self.time = attributes[:'time']
- else
- self.time = nil
- end
-
- if attributes.key?(:'type')
- self.type = attributes[:'type']
- else
- self.type = nil
- end
-
- if attributes.key?(:'to')
- self.to = attributes[:'to']
- else
- self.to = nil
- end
-
- if attributes.key?(:'description')
- self.description = attributes[:'description']
- else
- self.description = nil
- end
-
- if attributes.key?(:'message')
- self.message = attributes[:'message']
- else
- self.message = 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 @time.nil?
- invalid_properties.push('invalid value for "time", time cannot be nil.')
- end
-
- if @type.nil?
- invalid_properties.push('invalid value for "type", type cannot be nil.')
- end
-
- if @to.nil?
- invalid_properties.push('invalid value for "to", to cannot be nil.')
- end
-
- if @description.nil?
- invalid_properties.push('invalid value for "description", description cannot be nil.')
- end
-
- if @message.nil?
- invalid_properties.push('invalid value for "message", message 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 @time.nil?
- return false if @type.nil?
- return false if @to.nil?
- return false if @description.nil?
- return false if @message.nil?
- 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 &&
- time == o.time &&
- type == o.type &&
- to == o.to &&
- description == o.description &&
- message == o.message
- 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
- [time, type, to, description, message].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
-
- # Deserializes the data based on type
- # @param string type Data type
- # @param string value Value to be deserialized
- # @return [Object] Deserialized data
- def self._deserialize(type, value)
- case type.to_sym
- when :Time
- Time.parse(value)
- when :Date
- Date.parse(value)
- when :String
- value.to_s
- when :Integer
- value.to_i
- when :Float
- value.to_f
- when :Boolean
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
- true
- else
- false
- end
- when :Object
- # generic object (usually a Hash), return directly
- value
- when /\AArray<(?.+)>\z/
- inner_type = Regexp.last_match[:inner_type]
- value.map { |v| _deserialize(inner_type, v) }
- when /\AHash<(?.+?), (?.+)>\z/
- k_type = Regexp.last_match[:k_type]
- v_type = Regexp.last_match[:v_type]
- {}.tap do |hash|
- value.each do |k, v|
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
- end
- end
- else # model
- # models (e.g. Pet) or oneOf
- klass = Bandwidth.const_get(type)
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
- end
- end
-
- # Returns the string representation of the object
- # @return [String] String presentation of the object
- def to_s
- to_hash.to_s
- end
-
- # to_body is an alias to to_hash (backward compatibility)
- # @return [Hash] Returns the object in the form of hash
- def to_body
- to_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
-
- # Outputs non-array value in the form of hash
- # For object, use to_hash. Otherwise, just return the value
- # @param [Object] value Any valid value
- # @return [Hash] Returns the value in the form of hash
- def _to_hash(value)
- if value.is_a?(Array)
- value.compact.map { |v| _to_hash(v) }
- elsif value.is_a?(Hash)
- {}.tap do |hash|
- value.each { |k, v| hash[k] = _to_hash(v) }
- end
- elsif value.respond_to? :to_hash
- value.to_hash
- else
- value
- end
- end
- end
-end
diff --git a/lib/bandwidth-sdk/models/message_sending_callback_message.rb b/lib/bandwidth-sdk/models/message_sending_callback_message.rb
deleted file mode 100644
index eac3ed26..00000000
--- a/lib/bandwidth-sdk/models/message_sending_callback_message.rb
+++ /dev/null
@@ -1,418 +0,0 @@
-=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.8.0
-
-=end
-
-require 'date'
-require 'time'
-
-module Bandwidth
- # Message Sending Callback Message Schema
- class MessageSendingCallbackMessage
- attr_accessor :id
-
- attr_accessor :owner
-
- attr_accessor :application_id
-
- attr_accessor :time
-
- attr_accessor :segment_count
-
- attr_accessor :direction
-
- attr_accessor :to
-
- attr_accessor :from
-
- attr_accessor :text
-
- attr_accessor :tag
-
- attr_accessor :media
-
- attr_accessor :priority
-
- 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
- {
- :'id' => :'id',
- :'owner' => :'owner',
- :'application_id' => :'applicationId',
- :'time' => :'time',
- :'segment_count' => :'segmentCount',
- :'direction' => :'direction',
- :'to' => :'to',
- :'from' => :'from',
- :'text' => :'text',
- :'tag' => :'tag',
- :'media' => :'media',
- :'priority' => :'priority'
- }
- end
-
- # Returns all the JSON keys this model knows about
- def self.acceptable_attributes
- attribute_map.values
- end
-
- # Attribute type mapping.
- def self.openapi_types
- {
- :'id' => :'String',
- :'owner' => :'String',
- :'application_id' => :'String',
- :'time' => :'Time',
- :'segment_count' => :'Integer',
- :'direction' => :'MessageDirectionEnum',
- :'to' => :'Array',
- :'from' => :'String',
- :'text' => :'String',
- :'tag' => :'String',
- :'media' => :'Array',
- :'priority' => :'PriorityEnum'
- }
- 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::MessageSendingCallbackMessage` initialize method'
- end
-
- # check to see if the attribute exists and convert string to symbol for hash key
- attributes = attributes.each_with_object({}) { |(k, v), h|
- if (!self.class.attribute_map.key?(k.to_sym))
- fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::MessageSendingCallbackMessage`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
- end
- h[k.to_sym] = v
- }
-
- if attributes.key?(:'id')
- self.id = attributes[:'id']
- else
- self.id = nil
- end
-
- if attributes.key?(:'owner')
- self.owner = attributes[:'owner']
- else
- self.owner = nil
- end
-
- if attributes.key?(:'application_id')
- self.application_id = attributes[:'application_id']
- else
- self.application_id = nil
- end
-
- if attributes.key?(:'time')
- self.time = attributes[:'time']
- else
- self.time = nil
- end
-
- if attributes.key?(:'segment_count')
- self.segment_count = attributes[:'segment_count']
- else
- self.segment_count = nil
- end
-
- if attributes.key?(:'direction')
- self.direction = attributes[:'direction']
- else
- self.direction = nil
- end
-
- if attributes.key?(:'to')
- if (value = attributes[:'to']).is_a?(Array)
- self.to = value
- end
- else
- self.to = nil
- end
-
- if attributes.key?(:'from')
- self.from = attributes[:'from']
- else
- self.from = nil
- end
-
- if attributes.key?(:'text')
- self.text = attributes[:'text']
- else
- self.text = nil
- end
-
- if attributes.key?(:'tag')
- self.tag = attributes[:'tag']
- end
-
- if attributes.key?(:'media')
- if (value = attributes[:'media']).is_a?(Array)
- self.media = value
- end
- else
- self.media = nil
- end
-
- if attributes.key?(:'priority')
- self.priority = attributes[:'priority']
- 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 @id.nil?
- invalid_properties.push('invalid value for "id", id cannot be nil.')
- end
-
- if @owner.nil?
- invalid_properties.push('invalid value for "owner", owner cannot be nil.')
- end
-
- if @application_id.nil?
- invalid_properties.push('invalid value for "application_id", application_id cannot be nil.')
- end
-
- if @time.nil?
- invalid_properties.push('invalid value for "time", time cannot be nil.')
- end
-
- if @segment_count.nil?
- invalid_properties.push('invalid value for "segment_count", segment_count cannot be nil.')
- end
-
- if @direction.nil?
- invalid_properties.push('invalid value for "direction", direction cannot be nil.')
- end
-
- if @to.nil?
- invalid_properties.push('invalid value for "to", to cannot be nil.')
- end
-
- if @from.nil?
- invalid_properties.push('invalid value for "from", from cannot be nil.')
- end
-
- if @text.nil?
- invalid_properties.push('invalid value for "text", text cannot be nil.')
- end
-
- if @media.nil?
- invalid_properties.push('invalid value for "media", media 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 @id.nil?
- return false if @owner.nil?
- return false if @application_id.nil?
- return false if @time.nil?
- return false if @segment_count.nil?
- return false if @direction.nil?
- return false if @to.nil?
- return false if @from.nil?
- return false if @text.nil?
- return false if @media.nil?
- true
- end
-
- # Custom attribute writer method with validation
- # @param [Object] to Value to be assigned
- def to=(to)
- if to.nil?
- fail ArgumentError, 'to cannot be nil'
- end
-
- @to = to
- 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 &&
- owner == o.owner &&
- application_id == o.application_id &&
- time == o.time &&
- segment_count == o.segment_count &&
- direction == o.direction &&
- to == o.to &&
- from == o.from &&
- text == o.text &&
- tag == o.tag &&
- media == o.media &&
- priority == o.priority
- 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, owner, application_id, time, segment_count, direction, to, from, text, tag, media, priority].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
-
- # Deserializes the data based on type
- # @param string type Data type
- # @param string value Value to be deserialized
- # @return [Object] Deserialized data
- def self._deserialize(type, value)
- case type.to_sym
- when :Time
- Time.parse(value)
- when :Date
- Date.parse(value)
- when :String
- value.to_s
- when :Integer
- value.to_i
- when :Float
- value.to_f
- when :Boolean
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
- true
- else
- false
- end
- when :Object
- # generic object (usually a Hash), return directly
- value
- when /\AArray<(?.+)>\z/
- inner_type = Regexp.last_match[:inner_type]
- value.map { |v| _deserialize(inner_type, v) }
- when /\AHash<(?.+?), (?.+)>\z/
- k_type = Regexp.last_match[:k_type]
- v_type = Regexp.last_match[:v_type]
- {}.tap do |hash|
- value.each do |k, v|
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
- end
- end
- else # model
- # models (e.g. Pet) or oneOf
- klass = Bandwidth.const_get(type)
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
- end
- end
-
- # Returns the string representation of the object
- # @return [String] String presentation of the object
- def to_s
- to_hash.to_s
- end
-
- # to_body is an alias to to_hash (backward compatibility)
- # @return [Hash] Returns the object in the form of hash
- def to_body
- to_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
-
- # Outputs non-array value in the form of hash
- # For object, use to_hash. Otherwise, just return the value
- # @param [Object] value Any valid value
- # @return [Hash] Returns the value in the form of hash
- def _to_hash(value)
- if value.is_a?(Array)
- value.compact.map { |v| _to_hash(v) }
- elsif value.is_a?(Hash)
- {}.tap do |hash|
- value.each { |k, v| hash[k] = _to_hash(v) }
- end
- elsif value.respond_to? :to_hash
- value.to_hash
- else
- value
- end
- end
- end
-end
diff --git a/lib/bandwidth-sdk/models/transcription_list.rb b/lib/bandwidth-sdk/models/transcription_list.rb
deleted file mode 100644
index c638a60f..00000000
--- a/lib/bandwidth-sdk/models/transcription_list.rb
+++ /dev/null
@@ -1,214 +0,0 @@
-=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
-OpenAPI Generator version: 7.0.0
-
-=end
-
-require 'date'
-require 'time'
-
-module Bandwidth
- class TranscriptionList
- attr_accessor :transcripts
-
- # Attribute mapping from ruby-style variable name to JSON key.
- def self.attribute_map
- {
- :'transcripts' => :'transcripts'
- }
- end
-
- # Returns all the JSON keys this model knows about
- def self.acceptable_attributes
- attribute_map.values
- end
-
- # Attribute type mapping.
- def self.openapi_types
- {
- :'transcripts' => :'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::TranscriptionList` initialize method'
- end
-
- # check to see if the attribute exists and convert string to symbol for hash key
- attributes = attributes.each_with_object({}) { |(k, v), h|
- if (!self.class.attribute_map.key?(k.to_sym))
- fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::TranscriptionList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
- end
- h[k.to_sym] = v
- }
-
- if attributes.key?(:'transcripts')
- if (value = attributes[:'transcripts']).is_a?(Array)
- self.transcripts = 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 &&
- transcripts == o.transcripts
- 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
- [transcripts].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
-
- # Deserializes the data based on type
- # @param string type Data type
- # @param string value Value to be deserialized
- # @return [Object] Deserialized data
- def self._deserialize(type, value)
- case type.to_sym
- when :Time
- Time.parse(value)
- when :Date
- Date.parse(value)
- when :String
- value.to_s
- when :Integer
- value.to_i
- when :Float
- value.to_f
- when :Boolean
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
- true
- else
- false
- end
- when :Object
- # generic object (usually a Hash), return directly
- value
- when /\AArray<(?.+)>\z/
- inner_type = Regexp.last_match[:inner_type]
- value.map { |v| _deserialize(inner_type, v) }
- when /\AHash<(?.+?), (?.+)>\z/
- k_type = Regexp.last_match[:k_type]
- v_type = Regexp.last_match[:v_type]
- {}.tap do |hash|
- value.each do |k, v|
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
- end
- end
- else # model
- # models (e.g. Pet) or oneOf
- klass = Bandwidth.const_get(type)
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
- end
- end
-
- # Returns the string representation of the object
- # @return [String] String presentation of the object
- def to_s
- to_hash.to_s
- end
-
- # to_body is an alias to to_hash (backward compatibility)
- # @return [Hash] Returns the object in the form of hash
- def to_body
- to_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
-
- # Outputs non-array value in the form of hash
- # For object, use to_hash. Otherwise, just return the value
- # @param [Object] value Any valid value
- # @return [Hash] Returns the value in the form of hash
- def _to_hash(value)
- if value.is_a?(Array)
- value.compact.map { |v| _to_hash(v) }
- elsif value.is_a?(Hash)
- {}.tap do |hash|
- value.each { |k, v| hash[k] = _to_hash(v) }
- end
- elsif value.respond_to? :to_hash
- value.to_hash
- else
- value
- end
- end
- end
-end
diff --git a/lib/bandwidth-sdk/models/transcription_metadata.rb b/lib/bandwidth-sdk/models/transcription_metadata.rb
deleted file mode 100644
index 1a341e70..00000000
--- a/lib/bandwidth-sdk/models/transcription_metadata.rb
+++ /dev/null
@@ -1,244 +0,0 @@
-=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
-OpenAPI Generator version: 7.0.0
-
-=end
-
-require 'date'
-require 'time'
-
-module Bandwidth
- # If the recording was transcribed, metadata about the transcription
- class TranscriptionMetadata
- # The unique transcription ID
- attr_accessor :id
-
- # The current status of the process. For recording, current possible values are 'processing', 'partial', 'complete', 'deleted', and 'error'. For transcriptions, current possible values are 'none', 'processing', 'available', 'error', 'timeout', 'file-size-too-big', and 'file-size-too-small'. Additional states may be added in the future, so your application must be tolerant of unknown values.
- attr_accessor :status
-
- # The time that the transcription was completed
- attr_accessor :completed_time
-
- # The URL of the [transcription](#operation/getCallTranscription)
- attr_accessor :url
-
- # Attribute mapping from ruby-style variable name to JSON key.
- def self.attribute_map
- {
- :'id' => :'id',
- :'status' => :'status',
- :'completed_time' => :'completedTime',
- :'url' => :'url'
- }
- end
-
- # Returns all the JSON keys this model knows about
- def self.acceptable_attributes
- attribute_map.values
- end
-
- # Attribute type mapping.
- def self.openapi_types
- {
- :'id' => :'String',
- :'status' => :'String',
- :'completed_time' => :'String',
- :'url' => :'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::TranscriptionMetadata` initialize method'
- end
-
- # check to see if the attribute exists and convert string to symbol for hash key
- attributes = attributes.each_with_object({}) { |(k, v), h|
- if (!self.class.attribute_map.key?(k.to_sym))
- fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::TranscriptionMetadata`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
- end
- h[k.to_sym] = v
- }
-
- if attributes.key?(:'id')
- self.id = attributes[:'id']
- end
-
- if attributes.key?(:'status')
- self.status = attributes[:'status']
- end
-
- if attributes.key?(:'completed_time')
- self.completed_time = attributes[:'completed_time']
- end
-
- if attributes.key?(:'url')
- self.url = attributes[:'url']
- 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 &&
- id == o.id &&
- status == o.status &&
- completed_time == o.completed_time &&
- url == o.url
- 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, status, completed_time, url].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
-
- # Deserializes the data based on type
- # @param string type Data type
- # @param string value Value to be deserialized
- # @return [Object] Deserialized data
- def self._deserialize(type, value)
- case type.to_sym
- when :Time
- Time.parse(value)
- when :Date
- Date.parse(value)
- when :String
- value.to_s
- when :Integer
- value.to_i
- when :Float
- value.to_f
- when :Boolean
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
- true
- else
- false
- end
- when :Object
- # generic object (usually a Hash), return directly
- value
- when /\AArray<(?.+)>\z/
- inner_type = Regexp.last_match[:inner_type]
- value.map { |v| _deserialize(inner_type, v) }
- when /\AHash<(?.+?), (?.+)>\z/
- k_type = Regexp.last_match[:k_type]
- v_type = Regexp.last_match[:v_type]
- {}.tap do |hash|
- value.each do |k, v|
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
- end
- end
- else # model
- # models (e.g. Pet) or oneOf
- klass = Bandwidth.const_get(type)
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
- end
- end
-
- # Returns the string representation of the object
- # @return [String] String presentation of the object
- def to_s
- to_hash.to_s
- end
-
- # to_body is an alias to to_hash (backward compatibility)
- # @return [Hash] Returns the object in the form of hash
- def to_body
- to_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
-
- # Outputs non-array value in the form of hash
- # For object, use to_hash. Otherwise, just return the value
- # @param [Object] value Any valid value
- # @return [Hash] Returns the value in the form of hash
- def _to_hash(value)
- if value.is_a?(Array)
- value.compact.map { |v| _to_hash(v) }
- elsif value.is_a?(Hash)
- {}.tap do |hash|
- value.each { |k, v| hash[k] = _to_hash(v) }
- end
- elsif value.respond_to? :to_hash
- value.to_hash
- else
- value
- end
- end
- end
-end