bandwidth-sdk 17.0.0 → 17.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +3 -3
  3. data/README.md +11 -3
  4. data/bandwidth.yml +78 -22
  5. data/coverage/.last_run.json +1 -1
  6. data/coverage/.resultset.json +115 -96
  7. data/coverage/index.html +660 -390
  8. data/docs/MultiChannelAction.md +32 -81
  9. data/docs/MultiChannelApi.md +1 -1
  10. data/docs/{MultiChannelChannelListObject.md → MultiChannelChannelListMMSObject.md} +3 -3
  11. data/docs/{MultiChannelMessageResponseDataChannelListInner.md → MultiChannelChannelListMMSResponseObject.md} +3 -3
  12. data/docs/MultiChannelChannelListObjectBase.md +22 -0
  13. data/docs/MultiChannelChannelListOwnerObject.md +18 -0
  14. data/docs/MultiChannelChannelListRBMObject.md +24 -0
  15. data/docs/{MultiChannelChannelListObjectContent.md → MultiChannelChannelListRBMObjectAllOfContent.md} +6 -10
  16. data/docs/MultiChannelChannelListRBMResponseObject.md +26 -0
  17. data/docs/MultiChannelChannelListRequestObject.md +24 -0
  18. data/docs/MultiChannelChannelListResponseObject.md +26 -0
  19. data/docs/MultiChannelChannelListSMSObject.md +24 -0
  20. data/docs/MultiChannelChannelListSMSResponseObject.md +26 -0
  21. data/docs/MultiChannelMessageRequest.md +1 -1
  22. data/docs/MultiChannelMessageResponseData.md +1 -1
  23. data/docs/RbmActionBase.md +1 -1
  24. data/docs/RbmSuggestionResponse.md +1 -1
  25. data/lib/bandwidth-sdk/models/multi_channel_action.rb +71 -26
  26. data/lib/bandwidth-sdk/models/{multi_channel_channel_list_object.rb → multi_channel_channel_list_mms_object.rb} +11 -4
  27. data/lib/bandwidth-sdk/models/{multi_channel_message_response_data_channel_list_inner.rb → multi_channel_channel_list_mms_response_object.rb} +6 -5
  28. data/lib/bandwidth-sdk/models/multi_channel_channel_list_object_base.rb +275 -0
  29. data/lib/bandwidth-sdk/models/multi_channel_channel_list_owner_object.rb +220 -0
  30. data/lib/bandwidth-sdk/models/multi_channel_channel_list_rbm_object.rb +298 -0
  31. data/lib/bandwidth-sdk/models/{multi_channel_channel_list_object_content.rb → multi_channel_channel_list_rbm_object_all_of_content.rb} +2 -4
  32. data/lib/bandwidth-sdk/models/multi_channel_channel_list_rbm_response_object.rb +316 -0
  33. data/lib/bandwidth-sdk/models/multi_channel_channel_list_request_object.rb +104 -0
  34. data/lib/bandwidth-sdk/models/multi_channel_channel_list_response_object.rb +104 -0
  35. data/lib/bandwidth-sdk/models/multi_channel_channel_list_sms_object.rb +298 -0
  36. data/lib/bandwidth-sdk/models/multi_channel_channel_list_sms_response_object.rb +316 -0
  37. data/lib/bandwidth-sdk/models/multi_channel_message_request.rb +1 -1
  38. data/lib/bandwidth-sdk/models/multi_channel_message_response_data.rb +1 -1
  39. data/lib/bandwidth-sdk/version.rb +1 -1
  40. data/lib/bandwidth-sdk.rb +11 -3
  41. data/spec/smoke/multi_channel_api_spec.rb +124 -23
  42. data/spec/smoke/phone_number_lookup_api_spec.rb +1 -1
  43. data/spec/unit/api/multi_channel_api_spec.rb +13 -2
  44. metadata +24 -8
@@ -1,89 +1,40 @@
1
1
  # Bandwidth::MultiChannelAction
2
2
 
3
- ## Class instance methods
4
-
5
- ### `openapi_one_of`
6
-
7
- Returns the list of classes defined in oneOf.
8
-
9
- #### Example
10
-
11
- ```ruby
12
- require 'bandwidth-sdk'
13
-
14
- Bandwidth::MultiChannelAction.openapi_one_of
15
- # =>
16
- # [
17
- # :'MultiChannelActionCalendarEvent',
18
- # :'RbmActionBase',
19
- # :'RbmActionDial',
20
- # :'RbmActionOpenUrl',
21
- # :'RbmActionViewLocation'
22
- # ]
23
- ```
24
-
25
- ### `openapi_discriminator_name`
26
-
27
- Returns the discriminator's property name.
28
-
29
- #### Example
30
-
31
- ```ruby
32
- require 'bandwidth-sdk'
33
-
34
- Bandwidth::MultiChannelAction.openapi_discriminator_name
35
- # => :'type'
36
- ```
37
-
38
- ### `openapi_discriminator_name`
39
-
40
- Returns the discriminator's mapping.
41
-
42
- #### Example
43
-
44
- ```ruby
45
- require 'bandwidth-sdk'
46
-
47
- Bandwidth::MultiChannelAction.openapi_discriminator_mapping
48
- # =>
49
- # {
50
- # :'CREATE_CALENDAR_EVENT' => :'MultiChannelActionCalendarEvent',
51
- # :'DIAL_PHONE' => :'RbmActionDial',
52
- # :'OPEN_URL' => :'RbmActionOpenUrl',
53
- # :'REPLY' => :'RbmActionBase',
54
- # :'REQUEST_LOCATION' => :'RbmActionBase',
55
- # :'SHOW_LOCATION' => :'RbmActionViewLocation'
56
- # }
57
- ```
58
-
59
- ### build
60
-
61
- Find the appropriate object from the `openapi_one_of` list and casts the data into it.
62
-
63
- #### Example
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **type** | [**RbmActionTypeEnum**](RbmActionTypeEnum.md) | | |
8
+ | **text** | **String** | Displayed text for user to click | |
9
+ | **postback_data** | **String** | Base64 payload the customer receives when the reply is clicked. | |
10
+ | **phone_number** | **String** | The phone number to dial. Must be E164 format. | |
11
+ | **latitude** | **Float** | The latitude of the location. | |
12
+ | **longitude** | **Float** | The longitude of the location. | |
13
+ | **label** | **String** | The label of the location. | [optional] |
14
+ | **title** | **String** | The title of the event. | |
15
+ | **start_time** | **Time** | The start time of the event. | |
16
+ | **end_time** | **Time** | The end time of the event. | |
17
+ | **description** | **String** | The description of the event. | [optional] |
18
+ | **url** | **String** | The URL to open in browser. | |
19
+
20
+ ## Example
64
21
 
65
22
  ```ruby
66
23
  require 'bandwidth-sdk'
67
24
 
68
- Bandwidth::MultiChannelAction.build(data)
69
- # => #<MultiChannelActionCalendarEvent:0x00007fdd4aab02a0>
70
-
71
- Bandwidth::MultiChannelAction.build(data_that_doesnt_match)
72
- # => nil
25
+ instance = Bandwidth::MultiChannelAction.new(
26
+ type: null,
27
+ text: Hello world,
28
+ postback_data: U0dWc2JHOGdkMjl5YkdRPQ&#x3D;&#x3D;,
29
+ phone_number: +15552223333,
30
+ latitude: 37.7749,
31
+ longitude: -122.4194,
32
+ label: San Francisco,
33
+ title: Meeting with John,
34
+ start_time: 2022-09-14T18:20:16Z,
35
+ end_time: 2022-09-14T18:20:16Z,
36
+ description: Discuss the new project,
37
+ url: https://dev.bandwidth.com
38
+ )
73
39
  ```
74
40
 
75
- #### Parameters
76
-
77
- | Name | Type | Description |
78
- | ---- | ---- | ----------- |
79
- | **data** | **Mixed** | data to be matched against the list of oneOf items |
80
-
81
- #### Return type
82
-
83
- - `MultiChannelActionCalendarEvent`
84
- - `RbmActionBase`
85
- - `RbmActionDial`
86
- - `RbmActionOpenUrl`
87
- - `RbmActionViewLocation`
88
- - `nil` (if no type matches)
89
-
@@ -29,7 +29,7 @@ end
29
29
 
30
30
  api_instance = Bandwidth::MultiChannelApi.new
31
31
  account_id = '9900000' # String | Your Bandwidth Account ID.
32
- multi_channel_message_request = Bandwidth::MultiChannelMessageRequest.new({to: '+15552223333', channel_list: [Bandwidth::MultiChannelChannelListObject.new({from: 'BandwidthRBM', application_id: '93de2206-9669-4e07-948d-329f4b722ee2', channel: Bandwidth::MultiChannelMessageChannelEnum::RBM, content: Bandwidth::MmsMessageContent.new})]}) # MultiChannelMessageRequest |
32
+ multi_channel_message_request = Bandwidth::MultiChannelMessageRequest.new({to: '+15552223333', channel_list: [Bandwidth::MultiChannelChannelListRequestObject.new({from: 'BandwidthRBM', application_id: '93de2206-9669-4e07-948d-329f4b722ee2', channel: Bandwidth::MultiChannelMessageChannelEnum::RBM, content: Bandwidth::MmsMessageContent.new})]}) # MultiChannelMessageRequest |
33
33
 
34
34
  begin
35
35
  # Create Multi-Channel Message
@@ -1,4 +1,4 @@
1
- # Bandwidth::MultiChannelChannelListObject
1
+ # Bandwidth::MultiChannelChannelListMMSObject
2
2
 
3
3
  ## Properties
4
4
 
@@ -7,14 +7,14 @@
7
7
  | **from** | **String** | The sender ID of the message. This could be an alphanumeric sender ID. | |
8
8
  | **application_id** | **String** | The ID of the Application your from number or senderId is associated with in the Bandwidth Phone Number Dashboard. | |
9
9
  | **channel** | [**MultiChannelMessageChannelEnum**](MultiChannelMessageChannelEnum.md) | | |
10
- | **content** | [**MultiChannelChannelListObjectContent**](MultiChannelChannelListObjectContent.md) | | |
10
+ | **content** | [**MmsMessageContent**](MmsMessageContent.md) | | |
11
11
 
12
12
  ## Example
13
13
 
14
14
  ```ruby
15
15
  require 'bandwidth-sdk'
16
16
 
17
- instance = Bandwidth::MultiChannelChannelListObject.new(
17
+ instance = Bandwidth::MultiChannelChannelListMMSObject.new(
18
18
  from: BandwidthRBM,
19
19
  application_id: 93de2206-9669-4e07-948d-329f4b722ee2,
20
20
  channel: null,
@@ -1,4 +1,4 @@
1
- # Bandwidth::MultiChannelMessageResponseDataChannelListInner
1
+ # Bandwidth::MultiChannelChannelListMMSResponseObject
2
2
 
3
3
  ## Properties
4
4
 
@@ -7,7 +7,7 @@
7
7
  | **from** | **String** | The sender ID of the message. This could be an alphanumeric sender ID. | |
8
8
  | **application_id** | **String** | The ID of the Application your from number or senderId is associated with in the Bandwidth Phone Number Dashboard. | |
9
9
  | **channel** | [**MultiChannelMessageChannelEnum**](MultiChannelMessageChannelEnum.md) | | |
10
- | **content** | [**MultiChannelChannelListObjectContent**](MultiChannelChannelListObjectContent.md) | | |
10
+ | **content** | [**MmsMessageContent**](MmsMessageContent.md) | | |
11
11
  | **owner** | **String** | The Bandwidth senderId associated with the message. Identical to &#39;from&#39;. | |
12
12
 
13
13
  ## Example
@@ -15,7 +15,7 @@
15
15
  ```ruby
16
16
  require 'bandwidth-sdk'
17
17
 
18
- instance = Bandwidth::MultiChannelMessageResponseDataChannelListInner.new(
18
+ instance = Bandwidth::MultiChannelChannelListMMSResponseObject.new(
19
19
  from: BandwidthRBM,
20
20
  application_id: 93de2206-9669-4e07-948d-329f4b722ee2,
21
21
  channel: null,
@@ -0,0 +1,22 @@
1
+ # Bandwidth::MultiChannelChannelListObjectBase
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **from** | **String** | The sender ID of the message. This could be an alphanumeric sender ID. | |
8
+ | **application_id** | **String** | The ID of the Application your from number or senderId is associated with in the Bandwidth Phone Number Dashboard. | |
9
+ | **channel** | [**MultiChannelMessageChannelEnum**](MultiChannelMessageChannelEnum.md) | | |
10
+
11
+ ## Example
12
+
13
+ ```ruby
14
+ require 'bandwidth-sdk'
15
+
16
+ instance = Bandwidth::MultiChannelChannelListObjectBase.new(
17
+ from: BandwidthRBM,
18
+ application_id: 93de2206-9669-4e07-948d-329f4b722ee2,
19
+ channel: null
20
+ )
21
+ ```
22
+
@@ -0,0 +1,18 @@
1
+ # Bandwidth::MultiChannelChannelListOwnerObject
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **owner** | **String** | The Bandwidth senderId associated with the message. Identical to &#39;from&#39;. | |
8
+
9
+ ## Example
10
+
11
+ ```ruby
12
+ require 'bandwidth-sdk'
13
+
14
+ instance = Bandwidth::MultiChannelChannelListOwnerObject.new(
15
+ owner: null
16
+ )
17
+ ```
18
+
@@ -0,0 +1,24 @@
1
+ # Bandwidth::MultiChannelChannelListRBMObject
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **from** | **String** | The sender ID of the message. This could be an alphanumeric sender ID. | |
8
+ | **application_id** | **String** | The ID of the Application your from number or senderId is associated with in the Bandwidth Phone Number Dashboard. | |
9
+ | **channel** | [**MultiChannelMessageChannelEnum**](MultiChannelMessageChannelEnum.md) | | |
10
+ | **content** | [**MultiChannelChannelListRBMObjectAllOfContent**](MultiChannelChannelListRBMObjectAllOfContent.md) | | |
11
+
12
+ ## Example
13
+
14
+ ```ruby
15
+ require 'bandwidth-sdk'
16
+
17
+ instance = Bandwidth::MultiChannelChannelListRBMObject.new(
18
+ from: BandwidthRBM,
19
+ application_id: 93de2206-9669-4e07-948d-329f4b722ee2,
20
+ channel: null,
21
+ content: null
22
+ )
23
+ ```
24
+
@@ -1,4 +1,4 @@
1
- # Bandwidth::MultiChannelChannelListObjectContent
1
+ # Bandwidth::MultiChannelChannelListRBMObjectAllOfContent
2
2
 
3
3
  ## Class instance methods
4
4
 
@@ -11,14 +11,12 @@ Returns the list of classes defined in oneOf.
11
11
  ```ruby
12
12
  require 'bandwidth-sdk'
13
13
 
14
- Bandwidth::MultiChannelChannelListObjectContent.openapi_one_of
14
+ Bandwidth::MultiChannelChannelListRBMObjectAllOfContent.openapi_one_of
15
15
  # =>
16
16
  # [
17
- # :'MmsMessageContent',
18
17
  # :'RbmMessageContentRichCard',
19
18
  # :'RbmMessageContentText',
20
- # :'RbmMessageMedia',
21
- # :'SmsMessageContent'
19
+ # :'RbmMessageMedia'
22
20
  # ]
23
21
  ```
24
22
 
@@ -31,10 +29,10 @@ Find the appropriate object from the `openapi_one_of` list and casts the data in
31
29
  ```ruby
32
30
  require 'bandwidth-sdk'
33
31
 
34
- Bandwidth::MultiChannelChannelListObjectContent.build(data)
35
- # => #<MmsMessageContent:0x00007fdd4aab02a0>
32
+ Bandwidth::MultiChannelChannelListRBMObjectAllOfContent.build(data)
33
+ # => #<RbmMessageContentRichCard:0x00007fdd4aab02a0>
36
34
 
37
- Bandwidth::MultiChannelChannelListObjectContent.build(data_that_doesnt_match)
35
+ Bandwidth::MultiChannelChannelListRBMObjectAllOfContent.build(data_that_doesnt_match)
38
36
  # => nil
39
37
  ```
40
38
 
@@ -46,10 +44,8 @@ Bandwidth::MultiChannelChannelListObjectContent.build(data_that_doesnt_match)
46
44
 
47
45
  #### Return type
48
46
 
49
- - `MmsMessageContent`
50
47
  - `RbmMessageContentRichCard`
51
48
  - `RbmMessageContentText`
52
49
  - `RbmMessageMedia`
53
- - `SmsMessageContent`
54
50
  - `nil` (if no type matches)
55
51
 
@@ -0,0 +1,26 @@
1
+ # Bandwidth::MultiChannelChannelListRBMResponseObject
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **from** | **String** | The sender ID of the message. This could be an alphanumeric sender ID. | |
8
+ | **application_id** | **String** | The ID of the Application your from number or senderId is associated with in the Bandwidth Phone Number Dashboard. | |
9
+ | **channel** | [**MultiChannelMessageChannelEnum**](MultiChannelMessageChannelEnum.md) | | |
10
+ | **content** | [**MultiChannelChannelListRBMObjectAllOfContent**](MultiChannelChannelListRBMObjectAllOfContent.md) | | |
11
+ | **owner** | **String** | The Bandwidth senderId associated with the message. Identical to &#39;from&#39;. | |
12
+
13
+ ## Example
14
+
15
+ ```ruby
16
+ require 'bandwidth-sdk'
17
+
18
+ instance = Bandwidth::MultiChannelChannelListRBMResponseObject.new(
19
+ from: BandwidthRBM,
20
+ application_id: 93de2206-9669-4e07-948d-329f4b722ee2,
21
+ channel: null,
22
+ content: null,
23
+ owner: null
24
+ )
25
+ ```
26
+
@@ -0,0 +1,24 @@
1
+ # Bandwidth::MultiChannelChannelListRequestObject
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **from** | **String** | The sender ID of the message. This could be an alphanumeric sender ID. | |
8
+ | **application_id** | **String** | The ID of the Application your from number or senderId is associated with in the Bandwidth Phone Number Dashboard. | |
9
+ | **channel** | [**MultiChannelMessageChannelEnum**](MultiChannelMessageChannelEnum.md) | | |
10
+ | **content** | [**MmsMessageContent**](MmsMessageContent.md) | | |
11
+
12
+ ## Example
13
+
14
+ ```ruby
15
+ require 'bandwidth-sdk'
16
+
17
+ instance = Bandwidth::MultiChannelChannelListRequestObject.new(
18
+ from: BandwidthRBM,
19
+ application_id: 93de2206-9669-4e07-948d-329f4b722ee2,
20
+ channel: null,
21
+ content: null
22
+ )
23
+ ```
24
+
@@ -0,0 +1,26 @@
1
+ # Bandwidth::MultiChannelChannelListResponseObject
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **from** | **String** | The sender ID of the message. This could be an alphanumeric sender ID. | |
8
+ | **application_id** | **String** | The ID of the Application your from number or senderId is associated with in the Bandwidth Phone Number Dashboard. | |
9
+ | **channel** | [**MultiChannelMessageChannelEnum**](MultiChannelMessageChannelEnum.md) | | |
10
+ | **content** | [**MmsMessageContent**](MmsMessageContent.md) | | |
11
+ | **owner** | **String** | The Bandwidth senderId associated with the message. Identical to &#39;from&#39;. | |
12
+
13
+ ## Example
14
+
15
+ ```ruby
16
+ require 'bandwidth-sdk'
17
+
18
+ instance = Bandwidth::MultiChannelChannelListResponseObject.new(
19
+ from: BandwidthRBM,
20
+ application_id: 93de2206-9669-4e07-948d-329f4b722ee2,
21
+ channel: null,
22
+ content: null,
23
+ owner: null
24
+ )
25
+ ```
26
+
@@ -0,0 +1,24 @@
1
+ # Bandwidth::MultiChannelChannelListSMSObject
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **from** | **String** | The sender ID of the message. This could be an alphanumeric sender ID. | |
8
+ | **application_id** | **String** | The ID of the Application your from number or senderId is associated with in the Bandwidth Phone Number Dashboard. | |
9
+ | **channel** | [**MultiChannelMessageChannelEnum**](MultiChannelMessageChannelEnum.md) | | |
10
+ | **content** | [**SmsMessageContent**](SmsMessageContent.md) | | |
11
+
12
+ ## Example
13
+
14
+ ```ruby
15
+ require 'bandwidth-sdk'
16
+
17
+ instance = Bandwidth::MultiChannelChannelListSMSObject.new(
18
+ from: BandwidthRBM,
19
+ application_id: 93de2206-9669-4e07-948d-329f4b722ee2,
20
+ channel: null,
21
+ content: null
22
+ )
23
+ ```
24
+
@@ -0,0 +1,26 @@
1
+ # Bandwidth::MultiChannelChannelListSMSResponseObject
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **from** | **String** | The sender ID of the message. This could be an alphanumeric sender ID. | |
8
+ | **application_id** | **String** | The ID of the Application your from number or senderId is associated with in the Bandwidth Phone Number Dashboard. | |
9
+ | **channel** | [**MultiChannelMessageChannelEnum**](MultiChannelMessageChannelEnum.md) | | |
10
+ | **content** | [**SmsMessageContent**](SmsMessageContent.md) | | |
11
+ | **owner** | **String** | The Bandwidth senderId associated with the message. Identical to &#39;from&#39;. | |
12
+
13
+ ## Example
14
+
15
+ ```ruby
16
+ require 'bandwidth-sdk'
17
+
18
+ instance = Bandwidth::MultiChannelChannelListSMSResponseObject.new(
19
+ from: BandwidthRBM,
20
+ application_id: 93de2206-9669-4e07-948d-329f4b722ee2,
21
+ channel: null,
22
+ content: null,
23
+ owner: null
24
+ )
25
+ ```
26
+
@@ -5,7 +5,7 @@
5
5
  | Name | Type | Description | Notes |
6
6
  | ---- | ---- | ----------- | ----- |
7
7
  | **to** | **String** | The phone number the message should be sent to in E164 format. | |
8
- | **channel_list** | [**Array&lt;MultiChannelChannelListObject&gt;**](MultiChannelChannelListObject.md) | A list of message bodies. The messages will be attempted in the order they are listed. Once a message sends successfully, the others will be ignored. | |
8
+ | **channel_list** | [**Array&lt;MultiChannelChannelListRequestObject&gt;**](MultiChannelChannelListRequestObject.md) | A list of message bodies. The messages will be attempted in the order they are listed. Once a message sends successfully, the others will be ignored. | |
9
9
  | **tag** | **String** | A custom string that will be included in callback events of the message. Max 1024 characters. | [optional] |
10
10
  | **priority** | [**PriorityEnum**](PriorityEnum.md) | | [optional] |
11
11
  | **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. | [optional] |
@@ -8,7 +8,7 @@
8
8
  | **time** | **Time** | The time the message was received by the Bandwidth API. | |
9
9
  | **direction** | [**MessageDirectionEnum**](MessageDirectionEnum.md) | | |
10
10
  | **to** | **Array&lt;String&gt;** | The destination phone number(s) of the message, in E164 format. | |
11
- | **channel_list** | [**Array&lt;MultiChannelMessageResponseDataChannelListInner&gt;**](MultiChannelMessageResponseDataChannelListInner.md) | A list of message bodies. The messages will be attempted in the order they are listed. Once a message sends successfully, the others will be ignored. | |
11
+ | **channel_list** | [**Array&lt;MultiChannelChannelListResponseObject&gt;**](MultiChannelChannelListResponseObject.md) | A list of message bodies. The messages will be attempted in the order they are listed. Once a message sends successfully, the others will be ignored. | |
12
12
  | **tag** | **String** | A custom string that will be included in callback events of the message. Max 1024 characters. | [optional] |
13
13
  | **priority** | [**PriorityEnum**](PriorityEnum.md) | | [optional] |
14
14
  | **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. | [optional] |
@@ -16,7 +16,7 @@ require 'bandwidth-sdk'
16
16
  instance = Bandwidth::RbmActionBase.new(
17
17
  type: null,
18
18
  text: Hello world,
19
- postback_data: [B@1d33e72e
19
+ postback_data: [B@7d5d77a6
20
20
  )
21
21
  ```
22
22
 
@@ -14,7 +14,7 @@ require 'bandwidth-sdk'
14
14
 
15
15
  instance = Bandwidth::RbmSuggestionResponse.new(
16
16
  text: Yes, I would like to proceed,
17
- postback_data: [B@1d33e72e
17
+ postback_data: [B@7d5d77a6
18
18
  )
19
19
  ```
20
20
 
@@ -16,8 +16,8 @@ require 'time'
16
16
  module Bandwidth
17
17
  module MultiChannelAction
18
18
  class << self
19
- # List of class defined in oneOf (OpenAPI v3)
20
- def openapi_one_of
19
+ # List of class defined in anyOf (OpenAPI v3)
20
+ def openapi_any_of
21
21
  [
22
22
  :'MultiChannelActionCalendarEvent',
23
23
  :'RbmActionBase',
@@ -27,35 +27,80 @@ module Bandwidth
27
27
  ]
28
28
  end
29
29
 
30
- # Discriminator's property name (OpenAPI v3)
31
- def openapi_discriminator_name
32
- :'type'
33
- end
34
-
35
- # Discriminator's mapping (OpenAPI v3)
36
- def openapi_discriminator_mapping
37
- {
38
- :'CREATE_CALENDAR_EVENT' => :'MultiChannelActionCalendarEvent',
39
- :'DIAL_PHONE' => :'RbmActionDial',
40
- :'OPEN_URL' => :'RbmActionOpenUrl',
41
- :'REPLY' => :'RbmActionBase',
42
- :'REQUEST_LOCATION' => :'RbmActionBase',
43
- :'SHOW_LOCATION' => :'RbmActionViewLocation'
44
- }
45
- end
46
-
47
30
  # Builds the object
48
- # @param [Mixed] Data to be matched against the list of oneOf items
31
+ # @param [Mixed] Data to be matched against the list of anyOf items
49
32
  # @return [Object] Returns the model or the data itself
50
33
  def build(data)
51
- discriminator_value = data[openapi_discriminator_name]
52
- return nil if discriminator_value.nil?
53
-
54
- klass = openapi_discriminator_mapping[discriminator_value.to_s.to_sym]
55
- return nil unless klass
34
+ # Go through the list of anyOf items and attempt to identify the appropriate one.
35
+ # Note:
36
+ # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
37
+ # due to the way the deserialization is made in the base_object template (it just casts without verifying).
38
+ # - TODO: scalar values are de facto behaving as if they were nullable.
39
+ # - TODO: logging when debugging is set.
40
+ openapi_any_of.each do |klass|
41
+ begin
42
+ next if klass == :AnyType # "nullable: true"
43
+ typed_data = find_and_cast_into_type(klass, data)
44
+ return typed_data if typed_data
45
+ rescue # rescue all errors so we keep iterating even if the current item lookup raises
46
+ end
47
+ end
56
48
 
57
- Bandwidth.const_get(klass).build_from_hash(data)
49
+ openapi_any_of.include?(:AnyType) ? data : nil
58
50
  end
51
+
52
+ private
53
+
54
+ SchemaMismatchError = Class.new(StandardError)
55
+
56
+ # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse.
57
+ def find_and_cast_into_type(klass, data)
58
+ return if data.nil?
59
+
60
+ case klass.to_s
61
+ when 'Boolean'
62
+ return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass)
63
+ when 'Float'
64
+ return data if data.instance_of?(Float)
65
+ when 'Integer'
66
+ return data if data.instance_of?(Integer)
67
+ when 'Time'
68
+ return Time.parse(data)
69
+ when 'Date'
70
+ return Date.parse(data)
71
+ when 'String'
72
+ return data if data.instance_of?(String)
73
+ when 'Object' # "type: object"
74
+ return data if data.instance_of?(Hash)
75
+ when /\AArray<(?<sub_type>.+)>\z/ # "type: array"
76
+ if data.instance_of?(Array)
77
+ sub_type = Regexp.last_match[:sub_type]
78
+ return data.map { |item| find_and_cast_into_type(sub_type, item) }
79
+ end
80
+ when /\AHash<String, (?<sub_type>.+)>\z/ # "type: object" with "additionalProperties: { ... }"
81
+ if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) }
82
+ sub_type = Regexp.last_match[:sub_type]
83
+ return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) }
84
+ end
85
+ else # model
86
+ const = Bandwidth.const_get(klass)
87
+ if const
88
+ if const.respond_to?(:openapi_any_of) # nested anyOf model
89
+ model = const.build(data)
90
+ return model if model
91
+ else
92
+ # raise if data contains keys that are not known to the model
93
+ raise if const.respond_to?(:acceptable_attributes) && !(data.keys - const.acceptable_attributes).empty?
94
+ model = const.build_from_hash(data)
95
+ return model if model
96
+ end
97
+ end
98
+ end
99
+
100
+ raise # if no match by now, raise
101
+ rescue
102
+ raise SchemaMismatchError, "#{data} doesn't match the #{klass} type"
103
+ end
59
104
  end
60
105
  end
61
106
  end
@@ -14,7 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Bandwidth
17
- class MultiChannelChannelListObject
17
+ class MultiChannelChannelListMMSObject
18
18
  # The sender ID of the message. This could be an alphanumeric sender ID.
19
19
  attr_accessor :from
20
20
 
@@ -68,7 +68,7 @@ module Bandwidth
68
68
  :'from' => :'String',
69
69
  :'application_id' => :'String',
70
70
  :'channel' => :'MultiChannelMessageChannelEnum',
71
- :'content' => :'MultiChannelChannelListObjectContent'
71
+ :'content' => :'MmsMessageContent'
72
72
  }
73
73
  end
74
74
 
@@ -78,17 +78,24 @@ module Bandwidth
78
78
  ])
79
79
  end
80
80
 
81
+ # List of class defined in allOf (OpenAPI v3)
82
+ def self.openapi_all_of
83
+ [
84
+ :'MultiChannelChannelListObjectBase'
85
+ ]
86
+ end
87
+
81
88
  # Initializes the object
82
89
  # @param [Hash] attributes Model attributes in the form of hash
83
90
  def initialize(attributes = {})
84
91
  if (!attributes.is_a?(Hash))
85
- fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::MultiChannelChannelListObject` initialize method'
92
+ fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::MultiChannelChannelListMMSObject` initialize method'
86
93
  end
87
94
 
88
95
  # check to see if the attribute exists and convert string to symbol for hash key
89
96
  attributes = attributes.each_with_object({}) { |(k, v), h|
90
97
  if (!self.class.attribute_map.key?(k.to_sym))
91
- fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::MultiChannelChannelListObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
98
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::MultiChannelChannelListMMSObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
92
99
  end
93
100
  h[k.to_sym] = v
94
101
  }