From 48ef48cc75182de7319a41900cb4b9e55ac43010 Mon Sep 17 00:00:00 2001 From: DX-Bandwidth Date: Tue, 14 Jan 2025 14:06:43 +0000 Subject: [PATCH 1/7] Generate SDK with OpenAPI Generator Version --- .openapi-generator/FILES | 22 +- README.md | 11 +- bandwidth.yml | 893 ++++++++---------- docs/CallbackTypeEnum.md | 15 + docs/MediaApi.md | 6 +- docs/Message.md | 6 +- docs/MessageCallback.md | 28 + docs/MessageCallbackMessage.md | 40 + docs/MessageRequest.md | 6 +- docs/MessagesApi.md | 32 +- lib/bandwidth-sdk.rb | 11 +- lib/bandwidth-sdk/api/media_api.rb | 6 +- lib/bandwidth-sdk/api/messages_api.rb | 32 +- .../models/callback_type_enum.rb | 42 + lib/bandwidth-sdk/models/message.rb | 4 +- lib/bandwidth-sdk/models/message_callback.rb | 318 +++++++ .../models/message_callback_message.rb | 413 ++++++++ lib/bandwidth-sdk/models/message_request.rb | 6 +- 18 files changed, 1337 insertions(+), 554 deletions(-) create mode 100644 docs/CallbackTypeEnum.md create mode 100644 docs/MessageCallback.md create mode 100644 docs/MessageCallbackMessage.md create mode 100644 lib/bandwidth-sdk/models/callback_type_enum.rb create mode 100644 lib/bandwidth-sdk/models/message_callback.rb create mode 100644 lib/bandwidth-sdk/models/message_callback_message.rb 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.yml b/bandwidth.yml index 11c79d23..8725d1d6 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: |- @@ -1344,7 +1357,7 @@ components: example: default messageStatusEnum: type: string - description: >- + description: > The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED. enum: @@ -1574,10 +1587,10 @@ 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: >- + description: > The number of segments the original message from the user is broken into before sending over to carrier networks. example: 2 @@ -1600,7 +1613,7 @@ components: type: array items: type: string - description: >- + description: > The list of media URLs sent in the message. Including a `filename` field in the `Content-Disposition` header of the media linked with a URL will set the displayed file name. This is a best practice to @@ -1647,7 +1660,7 @@ components: type: string from: type: string - description: >- + description: > Either an alphanumeric sender ID or the sender's Bandwidth phone number in E.164 format, which must be hosted within Bandwidth and linked to the account that is generating the message. @@ -1668,7 +1681,7 @@ components: type: string format: uri maxLength: 4096 - description: >- + description: > A list of URLs to include as media attachments as part of the message. @@ -1687,7 +1700,7 @@ components: expiration: type: string format: date-time - description: >- + description: > A string with the date/time value that the message will automatically expire by. This must be a valid RFC-3339 value, e.g., 2021-03-14T01:59:26Z or 2021-03-13T20:59:26-05:00. Must be a @@ -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 @@ -5127,7 +4891,7 @@ components: name: Cache-Control style: simple explode: false - description: >- + description: > General-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain. example: no-cache @@ -5145,7 +4909,7 @@ components: in: query name: messageId required: false - description: >- + description: > The ID of the message to search for. Special characters need to be encoded using URL encoding. Message IDs could come in different formats, e.g., 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 and @@ -5158,7 +4922,7 @@ components: in: query name: sourceTn required: false - description: >- + description: > The phone number that sent the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. @@ -5170,7 +4934,7 @@ components: in: query name: destinationTn required: false - description: >- + description: > The phone number that received the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 @@ -5182,7 +4946,7 @@ components: in: query name: messageStatus required: false - description: >- + description: > The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED. schema: @@ -5198,7 +4962,7 @@ components: in: query name: carrierName required: false - description: >- + description: > The name of the carrier used for this message. Possible values include but are not limited to Verizon and TMobile. Special characters need to be encoded using URL encoding (i.e. AT&T should be passed as AT%26T). @@ -5224,7 +4988,7 @@ components: in: query name: fromDateTime required: false - description: >- + description: > The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. example: 2022-09-14T18:20:16.000Z @@ -5234,7 +4998,7 @@ components: in: query name: toDateTime required: false - description: >- + description: > The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. example: 2022-09-14T18:20:16.000Z @@ -5270,7 +5034,7 @@ components: in: query name: limit required: false - description: >- + description: > The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000. schema: @@ -5463,19 +5227,330 @@ 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 + 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 @@ -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/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..52c0daf9 100644 --- a/docs/MediaApi.md +++ b/docs/MediaApi.md @@ -253,7 +253,7 @@ media_id = '14762070468292kw2fuqty55yp2b2/0/bw.png' # String | Media ID to retri body = File.new('/path/to/some/file') # File | opts = { content_type: 'audio/wav', # String | The media type of the entity-body. - cache_control: 'no-cache' # String | General-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain. + cache_control: 'no-cache' # String | General-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain. } begin @@ -290,7 +290,7 @@ end | **media_id** | **String** | Media ID to retrieve. | | | **body** | **File** | | | | **content_type** | **String** | The media type of the entity-body. | [optional] | -| **cache_control** | **String** | General-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain. | [optional] | +| **cache_control** | **String** | General-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain. | [optional] | ### Return type @@ -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..d8d64768 100644 --- a/docs/Message.md +++ b/docs/Message.md @@ -8,11 +8,11 @@ | **owner** | **String** | The Bandwidth phone number associated with the message. | [optional] | | **application_id** | **String** | The application ID associated with the message. | [optional] | | **time** | **Time** | The datetime stamp of the message in ISO 8601 | [optional] | -| **segment_count** | **Integer** | The number of segments the original message from the user is broken into before sending over to carrier networks. | [optional] | +| **segment_count** | **Integer** | The number of segments the original message from the user is broken into before sending over to carrier networks. | [optional] | | **direction** | [**MessageDirectionEnum**](MessageDirectionEnum.md) | | [optional] | | **to** | **Array<String>** | The phone number recipients of the message. | [optional] | | **from** | **String** | The phone number the message was sent from. | [optional] | -| **media** | **Array<String>** | The list of media URLs sent in the message. Including a `filename` field in the `Content-Disposition` header of the media linked with a URL will set the displayed file name. This is a best practice to ensure that your media has a readable file name. | [optional] | +| **media** | **Array<String>** | The list of media URLs sent in the message. Including a `filename` field in the `Content-Disposition` header of the media linked with a URL will set the displayed file name. This is a best practice to ensure that your media has a readable file name. | [optional] | | **text** | **String** | The contents of the message. | [optional] | | **tag** | **String** | The custom string set by the user. | [optional] | | **priority** | [**PriorityEnum**](PriorityEnum.md) | | [optional] | @@ -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/docs/MessageRequest.md b/docs/MessageRequest.md index f6c9574f..bd82c1b7 100644 --- a/docs/MessageRequest.md +++ b/docs/MessageRequest.md @@ -6,12 +6,12 @@ | ---- | ---- | ----------- | ----- | | **application_id** | **String** | The ID of the Application your from number is associated with in the Bandwidth Phone Number Dashboard. | | | **to** | **Array<String>** | The phone number(s) the message should be sent to in E164 format. | | -| **from** | **String** | Either an alphanumeric sender ID or the sender's Bandwidth phone number in E.164 format, which must be hosted within Bandwidth and linked to the account that is generating the message. Alphanumeric Sender IDs can contain up to 11 characters, upper-case letters A-Z, lower-case letters a-z, numbers 0-9, space, hyphen -, plus +, underscore _ and ampersand &. Alphanumeric Sender IDs must contain at least one letter. | | +| **from** | **String** | Either an alphanumeric sender ID or the sender's Bandwidth phone number in E.164 format, which must be hosted within Bandwidth and linked to the account that is generating the message. Alphanumeric Sender IDs can contain up to 11 characters, upper-case letters A-Z, lower-case letters a-z, numbers 0-9, space, hyphen -, plus +, underscore _ and ampersand &. Alphanumeric Sender IDs must contain at least one letter. | | | **text** | **String** | The contents of the text message. Must be 2048 characters or less. | [optional] | -| **media** | **Array<String>** | A list of URLs to include as media attachments as part of the message. Each URL can be at most 4096 characters. | [optional] | +| **media** | **Array<String>** | A list of URLs to include as media attachments as part of the message. Each URL can be at most 4096 characters. | [optional] | | **tag** | **String** | A custom string that will be included in callback events of the message. Max 1024 characters. | [optional] | | **priority** | [**PriorityEnum**](PriorityEnum.md) | | [optional] | -| **expiration** | **Time** | A string with the date/time value that the message will automatically expire by. This must be a valid RFC-3339 value, e.g., 2021-03-14T01:59:26Z or 2021-03-13T20:59:26-05:00. Must be a date-time in the future. Not supported on MMS. | [optional] | +| **expiration** | **Time** | A string with the date/time value that the message will automatically expire by. This must be a valid RFC-3339 value, e.g., 2021-03-14T01:59:26Z or 2021-03-13T20:59:26-05:00. Must be a date-time in the future. Not supported on MMS. | [optional] | ## Example diff --git a/docs/MessagesApi.md b/docs/MessagesApi.md index b32f532d..24906755 100644 --- a/docs/MessagesApi.md +++ b/docs/MessagesApi.md @@ -103,20 +103,20 @@ end api_instance = Bandwidth::MessagesApi.new account_id = '9900000' # String | Your Bandwidth Account ID. opts = { - message_id: '9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6', # String | The ID of the message to search for. Special characters need to be encoded using URL encoding. Message IDs could come in different formats, e.g., 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 and 1589228074636lm4k2je7j7jklbn2 are valid message ID formats. Note that you must include at least one query parameter. - source_tn: '%2B15554443333', # String | The phone number that sent the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). - destination_tn: '%2B15554443333', # String | The phone number that received the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). - message_status: Bandwidth::MessageStatusEnum::RECEIVED, # MessageStatusEnum | The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED. + message_id: '9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6', # String | The ID of the message to search for. Special characters need to be encoded using URL encoding. Message IDs could come in different formats, e.g., 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 and 1589228074636lm4k2je7j7jklbn2 are valid message ID formats. Note that you must include at least one query parameter. + source_tn: '%2B15554443333', # String | The phone number that sent the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). + destination_tn: '%2B15554443333', # String | The phone number that received the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). + message_status: Bandwidth::MessageStatusEnum::RECEIVED, # MessageStatusEnum | The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED. message_direction: Bandwidth::ListMessageDirectionEnum::INBOUND, # ListMessageDirectionEnum | The direction of the message. One of INBOUND OUTBOUND. - carrier_name: 'Verizon', # String | The name of the carrier used for this message. Possible values include but are not limited to Verizon and TMobile. Special characters need to be encoded using URL encoding (i.e. AT&T should be passed as AT%26T). + carrier_name: 'Verizon', # String | The name of the carrier used for this message. Possible values include but are not limited to Verizon and TMobile. Special characters need to be encoded using URL encoding (i.e. AT&T should be passed as AT%26T). message_type: Bandwidth::MessageTypeEnum::SMS, # MessageTypeEnum | The type of message. Either sms or mms. error_code: 9902, # Integer | The error code of the message. - from_date_time: '2022-09-14T18:20:16.000Z', # String | The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. - to_date_time: '2022-09-14T18:20:16.000Z', # String | The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. + from_date_time: '2022-09-14T18:20:16.000Z', # String | The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. + to_date_time: '2022-09-14T18:20:16.000Z', # String | The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. campaign_id: 'CJEUMDK', # String | The campaign ID of the message. sort: 'sourceTn:desc', # String | The field and direction to sort by combined with a colon. Direction is either asc or desc. page_token: 'gdEewhcJLQRB5', # String | A base64 encoded value used for pagination of results. - limit: 50, # Integer | The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000. + limit: 50, # Integer | The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000. limit_total_count: true # Boolean | When set to true, the response's totalCount field will have a maximum value of 10,000. When set to false, or excluded, this will give an accurate totalCount of all messages that match the provided filters. If you are experiencing latency, try using this parameter to limit your results. } @@ -152,20 +152,20 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | **account_id** | **String** | Your Bandwidth Account ID. | | -| **message_id** | **String** | The ID of the message to search for. Special characters need to be encoded using URL encoding. Message IDs could come in different formats, e.g., 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 and 1589228074636lm4k2je7j7jklbn2 are valid message ID formats. Note that you must include at least one query parameter. | [optional] | -| **source_tn** | **String** | The phone number that sent the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). | [optional] | -| **destination_tn** | **String** | The phone number that received the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). | [optional] | -| **message_status** | [**MessageStatusEnum**](.md) | The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED. | [optional] | +| **message_id** | **String** | The ID of the message to search for. Special characters need to be encoded using URL encoding. Message IDs could come in different formats, e.g., 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 and 1589228074636lm4k2je7j7jklbn2 are valid message ID formats. Note that you must include at least one query parameter. | [optional] | +| **source_tn** | **String** | The phone number that sent the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). | [optional] | +| **destination_tn** | **String** | The phone number that received the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). | [optional] | +| **message_status** | [**MessageStatusEnum**](.md) | The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED. | [optional] | | **message_direction** | [**ListMessageDirectionEnum**](.md) | The direction of the message. One of INBOUND OUTBOUND. | [optional] | -| **carrier_name** | **String** | The name of the carrier used for this message. Possible values include but are not limited to Verizon and TMobile. Special characters need to be encoded using URL encoding (i.e. AT&T should be passed as AT%26T). | [optional] | +| **carrier_name** | **String** | The name of the carrier used for this message. Possible values include but are not limited to Verizon and TMobile. Special characters need to be encoded using URL encoding (i.e. AT&T should be passed as AT%26T). | [optional] | | **message_type** | [**MessageTypeEnum**](.md) | The type of message. Either sms or mms. | [optional] | | **error_code** | **Integer** | The error code of the message. | [optional] | -| **from_date_time** | **String** | The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. | [optional] | -| **to_date_time** | **String** | The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. | [optional] | +| **from_date_time** | **String** | The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. | [optional] | +| **to_date_time** | **String** | The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. | [optional] | | **campaign_id** | **String** | The campaign ID of the message. | [optional] | | **sort** | **String** | The field and direction to sort by combined with a colon. Direction is either asc or desc. | [optional] | | **page_token** | **String** | A base64 encoded value used for pagination of results. | [optional] | -| **limit** | **Integer** | The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000. | [optional] | +| **limit** | **Integer** | The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000. | [optional] | | **limit_total_count** | **Boolean** | When set to true, the response's totalCount field will have a maximum value of 10,000. When set to false, or excluded, this will give an accurate totalCount of all messages that match the provided filters. If you are experiencing latency, try using this parameter to limit your results. | [optional] | ### Return type 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..937e18d9 100644 --- a/lib/bandwidth-sdk/api/media_api.rb +++ b/lib/bandwidth-sdk/api/media_api.rb @@ -230,7 +230,7 @@ def list_media_with_http_info(account_id, opts = {}) # @param body [File] # @param [Hash] opts the optional parameters # @option opts [String] :content_type The media type of the entity-body. - # @option opts [String] :cache_control General-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain. + # @option opts [String] :cache_control General-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain. # @return [nil] def upload_media(account_id, media_id, body, opts = {}) upload_media_with_http_info(account_id, media_id, body, opts) @@ -244,7 +244,7 @@ def upload_media(account_id, media_id, body, opts = {}) # @param body [File] # @param [Hash] opts the optional parameters # @option opts [String] :content_type The media type of the entity-body. - # @option opts [String] :cache_control General-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain. + # @option opts [String] :cache_control General-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain. # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def upload_media_with_http_info(account_id, media_id, body, opts = {}) if @api_client.config.debugging @@ -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/api/messages_api.rb b/lib/bandwidth-sdk/api/messages_api.rb index 864f53f5..41815714 100644 --- a/lib/bandwidth-sdk/api/messages_api.rb +++ b/lib/bandwidth-sdk/api/messages_api.rb @@ -97,20 +97,20 @@ def create_message_with_http_info(account_id, message_request, opts = {}) # Returns a list of messages based on query parameters. # @param account_id [String] Your Bandwidth Account ID. # @param [Hash] opts the optional parameters - # @option opts [String] :message_id The ID of the message to search for. Special characters need to be encoded using URL encoding. Message IDs could come in different formats, e.g., 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 and 1589228074636lm4k2je7j7jklbn2 are valid message ID formats. Note that you must include at least one query parameter. - # @option opts [String] :source_tn The phone number that sent the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). - # @option opts [String] :destination_tn The phone number that received the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). - # @option opts [MessageStatusEnum] :message_status The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED. + # @option opts [String] :message_id The ID of the message to search for. Special characters need to be encoded using URL encoding. Message IDs could come in different formats, e.g., 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 and 1589228074636lm4k2je7j7jklbn2 are valid message ID formats. Note that you must include at least one query parameter. + # @option opts [String] :source_tn The phone number that sent the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). + # @option opts [String] :destination_tn The phone number that received the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). + # @option opts [MessageStatusEnum] :message_status The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED. # @option opts [ListMessageDirectionEnum] :message_direction The direction of the message. One of INBOUND OUTBOUND. - # @option opts [String] :carrier_name The name of the carrier used for this message. Possible values include but are not limited to Verizon and TMobile. Special characters need to be encoded using URL encoding (i.e. AT&T should be passed as AT%26T). + # @option opts [String] :carrier_name The name of the carrier used for this message. Possible values include but are not limited to Verizon and TMobile. Special characters need to be encoded using URL encoding (i.e. AT&T should be passed as AT%26T). # @option opts [MessageTypeEnum] :message_type The type of message. Either sms or mms. # @option opts [Integer] :error_code The error code of the message. - # @option opts [String] :from_date_time The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. - # @option opts [String] :to_date_time The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. + # @option opts [String] :from_date_time The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. + # @option opts [String] :to_date_time The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. # @option opts [String] :campaign_id The campaign ID of the message. # @option opts [String] :sort The field and direction to sort by combined with a colon. Direction is either asc or desc. # @option opts [String] :page_token A base64 encoded value used for pagination of results. - # @option opts [Integer] :limit The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000. + # @option opts [Integer] :limit The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000. # @option opts [Boolean] :limit_total_count When set to true, the response's totalCount field will have a maximum value of 10,000. When set to false, or excluded, this will give an accurate totalCount of all messages that match the provided filters. If you are experiencing latency, try using this parameter to limit your results. # @return [MessagesList] def list_messages(account_id, opts = {}) @@ -122,20 +122,20 @@ def list_messages(account_id, opts = {}) # Returns a list of messages based on query parameters. # @param account_id [String] Your Bandwidth Account ID. # @param [Hash] opts the optional parameters - # @option opts [String] :message_id The ID of the message to search for. Special characters need to be encoded using URL encoding. Message IDs could come in different formats, e.g., 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 and 1589228074636lm4k2je7j7jklbn2 are valid message ID formats. Note that you must include at least one query parameter. - # @option opts [String] :source_tn The phone number that sent the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). - # @option opts [String] :destination_tn The phone number that received the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). - # @option opts [MessageStatusEnum] :message_status The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED. + # @option opts [String] :message_id The ID of the message to search for. Special characters need to be encoded using URL encoding. Message IDs could come in different formats, e.g., 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 and 1589228074636lm4k2je7j7jklbn2 are valid message ID formats. Note that you must include at least one query parameter. + # @option opts [String] :source_tn The phone number that sent the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). + # @option opts [String] :destination_tn The phone number that received the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). + # @option opts [MessageStatusEnum] :message_status The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED. # @option opts [ListMessageDirectionEnum] :message_direction The direction of the message. One of INBOUND OUTBOUND. - # @option opts [String] :carrier_name The name of the carrier used for this message. Possible values include but are not limited to Verizon and TMobile. Special characters need to be encoded using URL encoding (i.e. AT&T should be passed as AT%26T). + # @option opts [String] :carrier_name The name of the carrier used for this message. Possible values include but are not limited to Verizon and TMobile. Special characters need to be encoded using URL encoding (i.e. AT&T should be passed as AT%26T). # @option opts [MessageTypeEnum] :message_type The type of message. Either sms or mms. # @option opts [Integer] :error_code The error code of the message. - # @option opts [String] :from_date_time The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. - # @option opts [String] :to_date_time The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. + # @option opts [String] :from_date_time The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. + # @option opts [String] :to_date_time The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. # @option opts [String] :campaign_id The campaign ID of the message. # @option opts [String] :sort The field and direction to sort by combined with a colon. Direction is either asc or desc. # @option opts [String] :page_token A base64 encoded value used for pagination of results. - # @option opts [Integer] :limit The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000. + # @option opts [Integer] :limit The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000. # @option opts [Boolean] :limit_total_count When set to true, the response's totalCount field will have a maximum value of 10,000. When set to false, or excluded, this will give an accurate totalCount of all messages that match the provided filters. If you are experiencing latency, try using this parameter to limit your results. # @return [Array<(MessagesList, Integer, Hash)>] MessagesList data, response status code and response headers def list_messages_with_http_info(account_id, opts = {}) 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/message.rb b/lib/bandwidth-sdk/models/message.rb index 02172899..a61fe983 100644 --- a/lib/bandwidth-sdk/models/message.rb +++ b/lib/bandwidth-sdk/models/message.rb @@ -27,7 +27,7 @@ class Message # The datetime stamp of the message in ISO 8601 attr_accessor :time - # The number of segments the original message from the user is broken into before sending over to carrier networks. + # The number of segments the original message from the user is broken into before sending over to carrier networks. attr_accessor :segment_count attr_accessor :direction @@ -38,7 +38,7 @@ class Message # The phone number the message was sent from. attr_accessor :from - # The list of media URLs sent in the message. Including a `filename` field in the `Content-Disposition` header of the media linked with a URL will set the displayed file name. This is a best practice to ensure that your media has a readable file name. + # The list of media URLs sent in the message. Including a `filename` field in the `Content-Disposition` header of the media linked with a URL will set the displayed file name. This is a best practice to ensure that your media has a readable file name. attr_accessor :media # The contents of the message. diff --git a/lib/bandwidth-sdk/models/message_callback.rb b/lib/bandwidth-sdk/models/message_callback.rb new file mode 100644 index 00000000..51b553fd --- /dev/null +++ b/lib/bandwidth-sdk/models/message_callback.rb @@ -0,0 +1,318 @@ +=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 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 + { + :'time' => :'time', + :'type' => :'type', + :'to' => :'to', + :'description' => :'description', + :'message' => :'message', + :'error_code' => :'errorCode' + } + 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' => :'CallbackTypeEnum', + :'to' => :'String', + :'description' => :'String', + :'message' => :'MessageCallbackMessage', + :'error_code' => :'Integer' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'error_code' + ]) + 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::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::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 + } + + 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 + + if attributes.key?(:'error_code') + self.error_code = attributes[:'error_code'] + 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 && + error_code == o.error_code + 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, error_code].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_callback_message.rb b/lib/bandwidth-sdk/models/message_callback_message.rb new file mode 100644 index 00000000..9392bb82 --- /dev/null +++ b/lib/bandwidth-sdk/models/message_callback_message.rb @@ -0,0 +1,413 @@ +=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 payload schema within a MessageCallback + class MessageCallbackMessage + 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 + + # Optional media, applicable only for mms + 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([ + :'media', + ]) + 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::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::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 + } + + 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 + 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 + + 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? + 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_request.rb b/lib/bandwidth-sdk/models/message_request.rb index 829f918a..1a684012 100644 --- a/lib/bandwidth-sdk/models/message_request.rb +++ b/lib/bandwidth-sdk/models/message_request.rb @@ -21,13 +21,13 @@ class MessageRequest # The phone number(s) the message should be sent to in E164 format. attr_accessor :to - # Either an alphanumeric sender ID or the sender's Bandwidth phone number in E.164 format, which must be hosted within Bandwidth and linked to the account that is generating the message. Alphanumeric Sender IDs can contain up to 11 characters, upper-case letters A-Z, lower-case letters a-z, numbers 0-9, space, hyphen -, plus +, underscore _ and ampersand &. Alphanumeric Sender IDs must contain at least one letter. + # Either an alphanumeric sender ID or the sender's Bandwidth phone number in E.164 format, which must be hosted within Bandwidth and linked to the account that is generating the message. Alphanumeric Sender IDs can contain up to 11 characters, upper-case letters A-Z, lower-case letters a-z, numbers 0-9, space, hyphen -, plus +, underscore _ and ampersand &. Alphanumeric Sender IDs must contain at least one letter. attr_accessor :from # The contents of the text message. Must be 2048 characters or less. attr_accessor :text - # A list of URLs to include as media attachments as part of the message. Each URL can be at most 4096 characters. + # A list of URLs to include as media attachments as part of the message. Each URL can be at most 4096 characters. attr_accessor :media # A custom string that will be included in callback events of the message. Max 1024 characters. @@ -35,7 +35,7 @@ class MessageRequest attr_accessor :priority - # A string with the date/time value that the message will automatically expire by. This must be a valid RFC-3339 value, e.g., 2021-03-14T01:59:26Z or 2021-03-13T20:59:26-05:00. Must be a date-time in the future. Not supported on MMS. + # A string with the date/time value that the message will automatically expire by. This must be a valid RFC-3339 value, e.g., 2021-03-14T01:59:26Z or 2021-03-13T20:59:26-05:00. Must be a date-time in the future. Not supported on MMS. attr_accessor :expiration class EnumAttributeValidator From 87d46b9622a4353e053461044367f4459d5448d1 Mon Sep 17 00:00:00 2001 From: ckoegel Date: Tue, 14 Jan 2025 11:09:42 -0500 Subject: [PATCH 2/7] fix spaces in docs --- bandwidth.yml | 30 +++++++++++++++--------------- docs/MediaApi.md | 4 ++-- docs/Message.md | 4 ++-- docs/MessageRequest.md | 6 +++--- docs/MessagesApi.md | 32 ++++++++++++++++---------------- 5 files changed, 38 insertions(+), 38 deletions(-) diff --git a/bandwidth.yml b/bandwidth.yml index 8725d1d6..87921dfa 100644 --- a/bandwidth.yml +++ b/bandwidth.yml @@ -1357,7 +1357,7 @@ components: example: default messageStatusEnum: type: string - description: > + description: >- The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED. enum: @@ -1590,7 +1590,7 @@ components: example: 2024-12-02T20:15:57.278Z segmentCount: type: integer - description: > + description: >- The number of segments the original message from the user is broken into before sending over to carrier networks. example: 2 @@ -1613,7 +1613,7 @@ components: type: array items: type: string - description: > + description: >- The list of media URLs sent in the message. Including a `filename` field in the `Content-Disposition` header of the media linked with a URL will set the displayed file name. This is a best practice to @@ -1660,7 +1660,7 @@ components: type: string from: type: string - description: > + description: >- Either an alphanumeric sender ID or the sender's Bandwidth phone number in E.164 format, which must be hosted within Bandwidth and linked to the account that is generating the message. @@ -1681,7 +1681,7 @@ components: type: string format: uri maxLength: 4096 - description: > + description: >- A list of URLs to include as media attachments as part of the message. @@ -1700,7 +1700,7 @@ components: expiration: type: string format: date-time - description: > + description: >- A string with the date/time value that the message will automatically expire by. This must be a valid RFC-3339 value, e.g., 2021-03-14T01:59:26Z or 2021-03-13T20:59:26-05:00. Must be a @@ -4891,7 +4891,7 @@ components: name: Cache-Control style: simple explode: false - description: > + description: >- General-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain. example: no-cache @@ -4909,7 +4909,7 @@ components: in: query name: messageId required: false - description: > + description: >- The ID of the message to search for. Special characters need to be encoded using URL encoding. Message IDs could come in different formats, e.g., 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 and @@ -4922,7 +4922,7 @@ components: in: query name: sourceTn required: false - description: > + description: >- The phone number that sent the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. @@ -4934,7 +4934,7 @@ components: in: query name: destinationTn required: false - description: > + description: >- The phone number that received the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 @@ -4946,7 +4946,7 @@ components: in: query name: messageStatus required: false - description: > + description: >- The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED. schema: @@ -4962,7 +4962,7 @@ components: in: query name: carrierName required: false - description: > + description: >- The name of the carrier used for this message. Possible values include but are not limited to Verizon and TMobile. Special characters need to be encoded using URL encoding (i.e. AT&T should be passed as AT%26T). @@ -4988,7 +4988,7 @@ components: in: query name: fromDateTime required: false - description: > + description: >- The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. example: 2022-09-14T18:20:16.000Z @@ -4998,7 +4998,7 @@ components: in: query name: toDateTime required: false - description: > + description: >- The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. example: 2022-09-14T18:20:16.000Z @@ -5034,7 +5034,7 @@ components: in: query name: limit required: false - description: > + description: >- The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000. schema: diff --git a/docs/MediaApi.md b/docs/MediaApi.md index 52c0daf9..6d1c2e09 100644 --- a/docs/MediaApi.md +++ b/docs/MediaApi.md @@ -253,7 +253,7 @@ media_id = '14762070468292kw2fuqty55yp2b2/0/bw.png' # String | Media ID to retri body = File.new('/path/to/some/file') # File | opts = { content_type: 'audio/wav', # String | The media type of the entity-body. - cache_control: 'no-cache' # String | General-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain. + cache_control: 'no-cache' # String | General-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain. } begin @@ -290,7 +290,7 @@ end | **media_id** | **String** | Media ID to retrieve. | | | **body** | **File** | | | | **content_type** | **String** | The media type of the entity-body. | [optional] | -| **cache_control** | **String** | General-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain. | [optional] | +| **cache_control** | **String** | General-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain. | [optional] | ### Return type diff --git a/docs/Message.md b/docs/Message.md index d8d64768..0471c8ed 100644 --- a/docs/Message.md +++ b/docs/Message.md @@ -8,11 +8,11 @@ | **owner** | **String** | The Bandwidth phone number associated with the message. | [optional] | | **application_id** | **String** | The application ID associated with the message. | [optional] | | **time** | **Time** | The datetime stamp of the message in ISO 8601 | [optional] | -| **segment_count** | **Integer** | The number of segments the original message from the user is broken into before sending over to carrier networks. | [optional] | +| **segment_count** | **Integer** | The number of segments the original message from the user is broken into before sending over to carrier networks. | [optional] | | **direction** | [**MessageDirectionEnum**](MessageDirectionEnum.md) | | [optional] | | **to** | **Array<String>** | The phone number recipients of the message. | [optional] | | **from** | **String** | The phone number the message was sent from. | [optional] | -| **media** | **Array<String>** | The list of media URLs sent in the message. Including a `filename` field in the `Content-Disposition` header of the media linked with a URL will set the displayed file name. This is a best practice to ensure that your media has a readable file name. | [optional] | +| **media** | **Array<String>** | The list of media URLs sent in the message. Including a `filename` field in the `Content-Disposition` header of the media linked with a URL will set the displayed file name. This is a best practice to ensure that your media has a readable file name. | [optional] | | **text** | **String** | The contents of the message. | [optional] | | **tag** | **String** | The custom string set by the user. | [optional] | | **priority** | [**PriorityEnum**](PriorityEnum.md) | | [optional] | diff --git a/docs/MessageRequest.md b/docs/MessageRequest.md index bd82c1b7..f6c9574f 100644 --- a/docs/MessageRequest.md +++ b/docs/MessageRequest.md @@ -6,12 +6,12 @@ | ---- | ---- | ----------- | ----- | | **application_id** | **String** | The ID of the Application your from number is associated with in the Bandwidth Phone Number Dashboard. | | | **to** | **Array<String>** | The phone number(s) the message should be sent to in E164 format. | | -| **from** | **String** | Either an alphanumeric sender ID or the sender's Bandwidth phone number in E.164 format, which must be hosted within Bandwidth and linked to the account that is generating the message. Alphanumeric Sender IDs can contain up to 11 characters, upper-case letters A-Z, lower-case letters a-z, numbers 0-9, space, hyphen -, plus +, underscore _ and ampersand &. Alphanumeric Sender IDs must contain at least one letter. | | +| **from** | **String** | Either an alphanumeric sender ID or the sender's Bandwidth phone number in E.164 format, which must be hosted within Bandwidth and linked to the account that is generating the message. Alphanumeric Sender IDs can contain up to 11 characters, upper-case letters A-Z, lower-case letters a-z, numbers 0-9, space, hyphen -, plus +, underscore _ and ampersand &. Alphanumeric Sender IDs must contain at least one letter. | | | **text** | **String** | The contents of the text message. Must be 2048 characters or less. | [optional] | -| **media** | **Array<String>** | A list of URLs to include as media attachments as part of the message. Each URL can be at most 4096 characters. | [optional] | +| **media** | **Array<String>** | A list of URLs to include as media attachments as part of the message. Each URL can be at most 4096 characters. | [optional] | | **tag** | **String** | A custom string that will be included in callback events of the message. Max 1024 characters. | [optional] | | **priority** | [**PriorityEnum**](PriorityEnum.md) | | [optional] | -| **expiration** | **Time** | A string with the date/time value that the message will automatically expire by. This must be a valid RFC-3339 value, e.g., 2021-03-14T01:59:26Z or 2021-03-13T20:59:26-05:00. Must be a date-time in the future. Not supported on MMS. | [optional] | +| **expiration** | **Time** | A string with the date/time value that the message will automatically expire by. This must be a valid RFC-3339 value, e.g., 2021-03-14T01:59:26Z or 2021-03-13T20:59:26-05:00. Must be a date-time in the future. Not supported on MMS. | [optional] | ## Example diff --git a/docs/MessagesApi.md b/docs/MessagesApi.md index 24906755..b32f532d 100644 --- a/docs/MessagesApi.md +++ b/docs/MessagesApi.md @@ -103,20 +103,20 @@ end api_instance = Bandwidth::MessagesApi.new account_id = '9900000' # String | Your Bandwidth Account ID. opts = { - message_id: '9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6', # String | The ID of the message to search for. Special characters need to be encoded using URL encoding. Message IDs could come in different formats, e.g., 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 and 1589228074636lm4k2je7j7jklbn2 are valid message ID formats. Note that you must include at least one query parameter. - source_tn: '%2B15554443333', # String | The phone number that sent the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). - destination_tn: '%2B15554443333', # String | The phone number that received the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). - message_status: Bandwidth::MessageStatusEnum::RECEIVED, # MessageStatusEnum | The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED. + message_id: '9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6', # String | The ID of the message to search for. Special characters need to be encoded using URL encoding. Message IDs could come in different formats, e.g., 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 and 1589228074636lm4k2je7j7jklbn2 are valid message ID formats. Note that you must include at least one query parameter. + source_tn: '%2B15554443333', # String | The phone number that sent the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). + destination_tn: '%2B15554443333', # String | The phone number that received the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). + message_status: Bandwidth::MessageStatusEnum::RECEIVED, # MessageStatusEnum | The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED. message_direction: Bandwidth::ListMessageDirectionEnum::INBOUND, # ListMessageDirectionEnum | The direction of the message. One of INBOUND OUTBOUND. - carrier_name: 'Verizon', # String | The name of the carrier used for this message. Possible values include but are not limited to Verizon and TMobile. Special characters need to be encoded using URL encoding (i.e. AT&T should be passed as AT%26T). + carrier_name: 'Verizon', # String | The name of the carrier used for this message. Possible values include but are not limited to Verizon and TMobile. Special characters need to be encoded using URL encoding (i.e. AT&T should be passed as AT%26T). message_type: Bandwidth::MessageTypeEnum::SMS, # MessageTypeEnum | The type of message. Either sms or mms. error_code: 9902, # Integer | The error code of the message. - from_date_time: '2022-09-14T18:20:16.000Z', # String | The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. - to_date_time: '2022-09-14T18:20:16.000Z', # String | The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. + from_date_time: '2022-09-14T18:20:16.000Z', # String | The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. + to_date_time: '2022-09-14T18:20:16.000Z', # String | The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. campaign_id: 'CJEUMDK', # String | The campaign ID of the message. sort: 'sourceTn:desc', # String | The field and direction to sort by combined with a colon. Direction is either asc or desc. page_token: 'gdEewhcJLQRB5', # String | A base64 encoded value used for pagination of results. - limit: 50, # Integer | The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000. + limit: 50, # Integer | The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000. limit_total_count: true # Boolean | When set to true, the response's totalCount field will have a maximum value of 10,000. When set to false, or excluded, this will give an accurate totalCount of all messages that match the provided filters. If you are experiencing latency, try using this parameter to limit your results. } @@ -152,20 +152,20 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | **account_id** | **String** | Your Bandwidth Account ID. | | -| **message_id** | **String** | The ID of the message to search for. Special characters need to be encoded using URL encoding. Message IDs could come in different formats, e.g., 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 and 1589228074636lm4k2je7j7jklbn2 are valid message ID formats. Note that you must include at least one query parameter. | [optional] | -| **source_tn** | **String** | The phone number that sent the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). | [optional] | -| **destination_tn** | **String** | The phone number that received the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). | [optional] | -| **message_status** | [**MessageStatusEnum**](.md) | The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED. | [optional] | +| **message_id** | **String** | The ID of the message to search for. Special characters need to be encoded using URL encoding. Message IDs could come in different formats, e.g., 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 and 1589228074636lm4k2je7j7jklbn2 are valid message ID formats. Note that you must include at least one query parameter. | [optional] | +| **source_tn** | **String** | The phone number that sent the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). | [optional] | +| **destination_tn** | **String** | The phone number that received the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). | [optional] | +| **message_status** | [**MessageStatusEnum**](.md) | The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED. | [optional] | | **message_direction** | [**ListMessageDirectionEnum**](.md) | The direction of the message. One of INBOUND OUTBOUND. | [optional] | -| **carrier_name** | **String** | The name of the carrier used for this message. Possible values include but are not limited to Verizon and TMobile. Special characters need to be encoded using URL encoding (i.e. AT&T should be passed as AT%26T). | [optional] | +| **carrier_name** | **String** | The name of the carrier used for this message. Possible values include but are not limited to Verizon and TMobile. Special characters need to be encoded using URL encoding (i.e. AT&T should be passed as AT%26T). | [optional] | | **message_type** | [**MessageTypeEnum**](.md) | The type of message. Either sms or mms. | [optional] | | **error_code** | **Integer** | The error code of the message. | [optional] | -| **from_date_time** | **String** | The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. | [optional] | -| **to_date_time** | **String** | The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. | [optional] | +| **from_date_time** | **String** | The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. | [optional] | +| **to_date_time** | **String** | The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. | [optional] | | **campaign_id** | **String** | The campaign ID of the message. | [optional] | | **sort** | **String** | The field and direction to sort by combined with a colon. Direction is either asc or desc. | [optional] | | **page_token** | **String** | A base64 encoded value used for pagination of results. | [optional] | -| **limit** | **Integer** | The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000. | [optional] | +| **limit** | **Integer** | The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000. | [optional] | | **limit_total_count** | **Boolean** | When set to true, the response's totalCount field will have a maximum value of 10,000. When set to false, or excluded, this will give an accurate totalCount of all messages that match the provided filters. If you are experiencing latency, try using this parameter to limit your results. | [optional] | ### Return type From 09415425ef134d98cc0aa472be0505dc88a888fe Mon Sep 17 00:00:00 2001 From: ckoegel Date: Tue, 14 Jan 2025 11:10:10 -0500 Subject: [PATCH 3/7] spaces --- lib/bandwidth-sdk/api/media_api.rb | 4 +-- lib/bandwidth-sdk/api/messages_api.rb | 32 ++++++++++----------- lib/bandwidth-sdk/models/message.rb | 4 +-- lib/bandwidth-sdk/models/message_request.rb | 6 ++-- 4 files changed, 23 insertions(+), 23 deletions(-) diff --git a/lib/bandwidth-sdk/api/media_api.rb b/lib/bandwidth-sdk/api/media_api.rb index 937e18d9..1b98dec4 100644 --- a/lib/bandwidth-sdk/api/media_api.rb +++ b/lib/bandwidth-sdk/api/media_api.rb @@ -230,7 +230,7 @@ def list_media_with_http_info(account_id, opts = {}) # @param body [File] # @param [Hash] opts the optional parameters # @option opts [String] :content_type The media type of the entity-body. - # @option opts [String] :cache_control General-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain. + # @option opts [String] :cache_control General-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain. # @return [nil] def upload_media(account_id, media_id, body, opts = {}) upload_media_with_http_info(account_id, media_id, body, opts) @@ -244,7 +244,7 @@ def upload_media(account_id, media_id, body, opts = {}) # @param body [File] # @param [Hash] opts the optional parameters # @option opts [String] :content_type The media type of the entity-body. - # @option opts [String] :cache_control General-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain. + # @option opts [String] :cache_control General-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain. # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def upload_media_with_http_info(account_id, media_id, body, opts = {}) if @api_client.config.debugging diff --git a/lib/bandwidth-sdk/api/messages_api.rb b/lib/bandwidth-sdk/api/messages_api.rb index 41815714..864f53f5 100644 --- a/lib/bandwidth-sdk/api/messages_api.rb +++ b/lib/bandwidth-sdk/api/messages_api.rb @@ -97,20 +97,20 @@ def create_message_with_http_info(account_id, message_request, opts = {}) # Returns a list of messages based on query parameters. # @param account_id [String] Your Bandwidth Account ID. # @param [Hash] opts the optional parameters - # @option opts [String] :message_id The ID of the message to search for. Special characters need to be encoded using URL encoding. Message IDs could come in different formats, e.g., 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 and 1589228074636lm4k2je7j7jklbn2 are valid message ID formats. Note that you must include at least one query parameter. - # @option opts [String] :source_tn The phone number that sent the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). - # @option opts [String] :destination_tn The phone number that received the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). - # @option opts [MessageStatusEnum] :message_status The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED. + # @option opts [String] :message_id The ID of the message to search for. Special characters need to be encoded using URL encoding. Message IDs could come in different formats, e.g., 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 and 1589228074636lm4k2je7j7jklbn2 are valid message ID formats. Note that you must include at least one query parameter. + # @option opts [String] :source_tn The phone number that sent the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). + # @option opts [String] :destination_tn The phone number that received the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). + # @option opts [MessageStatusEnum] :message_status The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED. # @option opts [ListMessageDirectionEnum] :message_direction The direction of the message. One of INBOUND OUTBOUND. - # @option opts [String] :carrier_name The name of the carrier used for this message. Possible values include but are not limited to Verizon and TMobile. Special characters need to be encoded using URL encoding (i.e. AT&T should be passed as AT%26T). + # @option opts [String] :carrier_name The name of the carrier used for this message. Possible values include but are not limited to Verizon and TMobile. Special characters need to be encoded using URL encoding (i.e. AT&T should be passed as AT%26T). # @option opts [MessageTypeEnum] :message_type The type of message. Either sms or mms. # @option opts [Integer] :error_code The error code of the message. - # @option opts [String] :from_date_time The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. - # @option opts [String] :to_date_time The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. + # @option opts [String] :from_date_time The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. + # @option opts [String] :to_date_time The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. # @option opts [String] :campaign_id The campaign ID of the message. # @option opts [String] :sort The field and direction to sort by combined with a colon. Direction is either asc or desc. # @option opts [String] :page_token A base64 encoded value used for pagination of results. - # @option opts [Integer] :limit The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000. + # @option opts [Integer] :limit The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000. # @option opts [Boolean] :limit_total_count When set to true, the response's totalCount field will have a maximum value of 10,000. When set to false, or excluded, this will give an accurate totalCount of all messages that match the provided filters. If you are experiencing latency, try using this parameter to limit your results. # @return [MessagesList] def list_messages(account_id, opts = {}) @@ -122,20 +122,20 @@ def list_messages(account_id, opts = {}) # Returns a list of messages based on query parameters. # @param account_id [String] Your Bandwidth Account ID. # @param [Hash] opts the optional parameters - # @option opts [String] :message_id The ID of the message to search for. Special characters need to be encoded using URL encoding. Message IDs could come in different formats, e.g., 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 and 1589228074636lm4k2je7j7jklbn2 are valid message ID formats. Note that you must include at least one query parameter. - # @option opts [String] :source_tn The phone number that sent the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). - # @option opts [String] :destination_tn The phone number that received the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). - # @option opts [MessageStatusEnum] :message_status The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED. + # @option opts [String] :message_id The ID of the message to search for. Special characters need to be encoded using URL encoding. Message IDs could come in different formats, e.g., 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 and 1589228074636lm4k2je7j7jklbn2 are valid message ID formats. Note that you must include at least one query parameter. + # @option opts [String] :source_tn The phone number that sent the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). + # @option opts [String] :destination_tn The phone number that received the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). + # @option opts [MessageStatusEnum] :message_status The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED. # @option opts [ListMessageDirectionEnum] :message_direction The direction of the message. One of INBOUND OUTBOUND. - # @option opts [String] :carrier_name The name of the carrier used for this message. Possible values include but are not limited to Verizon and TMobile. Special characters need to be encoded using URL encoding (i.e. AT&T should be passed as AT%26T). + # @option opts [String] :carrier_name The name of the carrier used for this message. Possible values include but are not limited to Verizon and TMobile. Special characters need to be encoded using URL encoding (i.e. AT&T should be passed as AT%26T). # @option opts [MessageTypeEnum] :message_type The type of message. Either sms or mms. # @option opts [Integer] :error_code The error code of the message. - # @option opts [String] :from_date_time The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. - # @option opts [String] :to_date_time The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. + # @option opts [String] :from_date_time The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. + # @option opts [String] :to_date_time The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. # @option opts [String] :campaign_id The campaign ID of the message. # @option opts [String] :sort The field and direction to sort by combined with a colon. Direction is either asc or desc. # @option opts [String] :page_token A base64 encoded value used for pagination of results. - # @option opts [Integer] :limit The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000. + # @option opts [Integer] :limit The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000. # @option opts [Boolean] :limit_total_count When set to true, the response's totalCount field will have a maximum value of 10,000. When set to false, or excluded, this will give an accurate totalCount of all messages that match the provided filters. If you are experiencing latency, try using this parameter to limit your results. # @return [Array<(MessagesList, Integer, Hash)>] MessagesList data, response status code and response headers def list_messages_with_http_info(account_id, opts = {}) diff --git a/lib/bandwidth-sdk/models/message.rb b/lib/bandwidth-sdk/models/message.rb index a61fe983..02172899 100644 --- a/lib/bandwidth-sdk/models/message.rb +++ b/lib/bandwidth-sdk/models/message.rb @@ -27,7 +27,7 @@ class Message # The datetime stamp of the message in ISO 8601 attr_accessor :time - # The number of segments the original message from the user is broken into before sending over to carrier networks. + # The number of segments the original message from the user is broken into before sending over to carrier networks. attr_accessor :segment_count attr_accessor :direction @@ -38,7 +38,7 @@ class Message # The phone number the message was sent from. attr_accessor :from - # The list of media URLs sent in the message. Including a `filename` field in the `Content-Disposition` header of the media linked with a URL will set the displayed file name. This is a best practice to ensure that your media has a readable file name. + # The list of media URLs sent in the message. Including a `filename` field in the `Content-Disposition` header of the media linked with a URL will set the displayed file name. This is a best practice to ensure that your media has a readable file name. attr_accessor :media # The contents of the message. diff --git a/lib/bandwidth-sdk/models/message_request.rb b/lib/bandwidth-sdk/models/message_request.rb index 1a684012..829f918a 100644 --- a/lib/bandwidth-sdk/models/message_request.rb +++ b/lib/bandwidth-sdk/models/message_request.rb @@ -21,13 +21,13 @@ class MessageRequest # The phone number(s) the message should be sent to in E164 format. attr_accessor :to - # Either an alphanumeric sender ID or the sender's Bandwidth phone number in E.164 format, which must be hosted within Bandwidth and linked to the account that is generating the message. Alphanumeric Sender IDs can contain up to 11 characters, upper-case letters A-Z, lower-case letters a-z, numbers 0-9, space, hyphen -, plus +, underscore _ and ampersand &. Alphanumeric Sender IDs must contain at least one letter. + # Either an alphanumeric sender ID or the sender's Bandwidth phone number in E.164 format, which must be hosted within Bandwidth and linked to the account that is generating the message. Alphanumeric Sender IDs can contain up to 11 characters, upper-case letters A-Z, lower-case letters a-z, numbers 0-9, space, hyphen -, plus +, underscore _ and ampersand &. Alphanumeric Sender IDs must contain at least one letter. attr_accessor :from # The contents of the text message. Must be 2048 characters or less. attr_accessor :text - # A list of URLs to include as media attachments as part of the message. Each URL can be at most 4096 characters. + # A list of URLs to include as media attachments as part of the message. Each URL can be at most 4096 characters. attr_accessor :media # A custom string that will be included in callback events of the message. Max 1024 characters. @@ -35,7 +35,7 @@ class MessageRequest attr_accessor :priority - # A string with the date/time value that the message will automatically expire by. This must be a valid RFC-3339 value, e.g., 2021-03-14T01:59:26Z or 2021-03-13T20:59:26-05:00. Must be a date-time in the future. Not supported on MMS. + # A string with the date/time value that the message will automatically expire by. This must be a valid RFC-3339 value, e.g., 2021-03-14T01:59:26Z or 2021-03-13T20:59:26-05:00. Must be a date-time in the future. Not supported on MMS. attr_accessor :expiration class EnumAttributeValidator From 4d7fe61d7e9a44aa9056d1105df3a635ed14c4bd Mon Sep 17 00:00:00 2001 From: ckoegel Date: Tue, 14 Jan 2025 11:10:22 -0500 Subject: [PATCH 4/7] remove unused models --- .../models/disconenct_callback.rb | 405 ----------------- .../models/inbound_message_callback.rb | 284 ------------ .../inbound_message_callback_message.rb | 411 ----------------- .../models/message_delivered_callback.rb | 284 ------------ .../message_delivered_callback_message.rb | 418 ------------------ .../models/message_failed_callback.rb | 300 ------------- .../models/message_failed_callback_message.rb | 418 ------------------ .../models/message_sending_callback.rb | 284 ------------ .../message_sending_callback_message.rb | 418 ------------------ .../models/transcription_list.rb | 214 --------- .../models/transcription_metadata.rb | 244 ---------- 11 files changed, 3680 deletions(-) delete mode 100644 lib/bandwidth-sdk/models/disconenct_callback.rb delete mode 100644 lib/bandwidth-sdk/models/inbound_message_callback.rb delete mode 100644 lib/bandwidth-sdk/models/inbound_message_callback_message.rb delete mode 100644 lib/bandwidth-sdk/models/message_delivered_callback.rb delete mode 100644 lib/bandwidth-sdk/models/message_delivered_callback_message.rb delete mode 100644 lib/bandwidth-sdk/models/message_failed_callback.rb delete mode 100644 lib/bandwidth-sdk/models/message_failed_callback_message.rb delete mode 100644 lib/bandwidth-sdk/models/message_sending_callback.rb delete mode 100644 lib/bandwidth-sdk/models/message_sending_callback_message.rb delete mode 100644 lib/bandwidth-sdk/models/transcription_list.rb delete mode 100644 lib/bandwidth-sdk/models/transcription_metadata.rb 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/inbound_message_callback_message.rb b/lib/bandwidth-sdk/models/inbound_message_callback_message.rb deleted file mode 100644 index 9c99e4e4..00000000 --- a/lib/bandwidth-sdk/models/inbound_message_callback_message.rb +++ /dev/null @@ -1,411 +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 Message Schema - class InboundMessageCallbackMessage - 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::InboundMessageCallbackMessage` 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 - 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 - 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 - - 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? - 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_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.rb b/lib/bandwidth-sdk/models/message_failed_callback.rb deleted file mode 100644 index 0fae1e55..00000000 --- a/lib/bandwidth-sdk/models/message_failed_callback.rb +++ /dev/null @@ -1,300 +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 - class MessageFailedCallback - attr_accessor :time - - attr_accessor :type - - attr_accessor :to - - attr_accessor :description - - attr_accessor :message - - attr_accessor :error_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'time' => :'time', - :'type' => :'type', - :'to' => :'to', - :'description' => :'description', - :'message' => :'message', - :'error_code' => :'errorCode' - } - 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' => :'MessageFailedCallbackMessage', - :'error_code' => :'Integer' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::MessageFailedCallback` 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 - 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 - - if attributes.key?(:'error_code') - self.error_code = attributes[:'error_code'] - else - self.error_code = 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 - - if @error_code.nil? - invalid_properties.push('invalid value for "error_code", error_code 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? - return false if @error_code.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 && - error_code == o.error_code - 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, error_code].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 From ab19f9b87f3a89527ca89a6ba236851df300a03c Mon Sep 17 00:00:00 2001 From: ckoegel Date: Tue, 14 Jan 2025 11:15:41 -0500 Subject: [PATCH 5/7] update ruby versions for workflows --- .github/workflows/deploy.yml | 2 +- .github/workflows/test-pr.yml | 2 +- .github/workflows/test-smoke.yml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) 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..6ed1278e 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, 3.4] 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 From cc2588ffbf81a7008fb17a26550f241fe4d604b2 Mon Sep 17 00:00:00 2001 From: ckoegel Date: Tue, 14 Jan 2025 11:50:49 -0500 Subject: [PATCH 6/7] update ox version reference --- bandwidth-sdk.gemspec | 2 +- custom_templates/gemspec.mustache | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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/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' From 721abf1fcc70de57817a0973481a82cc64c5e782 Mon Sep 17 00:00:00 2001 From: ckoegel Date: Tue, 14 Jan 2025 12:03:47 -0500 Subject: [PATCH 7/7] no 3.4 for now --- .github/workflows/test-pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-pr.yml b/.github/workflows/test-pr.yml index 6ed1278e..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: [3.0, 3.1, 3.2, 3.3, 3.4] + ruby-version: ['3.0', 3.1, 3.2, 3.3] fail-fast: false steps: - name: Checkout