bandwidth-sdk 17.0.0 → 17.1.0

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 (246) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +4 -4
  3. data/README.md +29 -3
  4. data/bandwidth-sdk.gemspec +1 -2
  5. data/bandwidth.yml +85 -22
  6. data/coverage/.last_run.json +1 -1
  7. data/coverage/.resultset.json +317 -487
  8. data/coverage/index.html +6317 -7908
  9. data/custom_templates/README.mustache +4 -1
  10. data/custom_templates/api_client.mustache +254 -0
  11. data/custom_templates/configuration.mustache +545 -0
  12. data/custom_templates/gem.mustache +2 -0
  13. data/docs/CallsApi.md +20 -5
  14. data/docs/ConferencesApi.md +36 -9
  15. data/docs/MFAApi.md +12 -3
  16. data/docs/MediaApi.md +16 -4
  17. data/docs/MessagesApi.md +8 -2
  18. data/docs/MultiChannelAction.md +32 -81
  19. data/docs/MultiChannelApi.md +5 -2
  20. data/docs/{MultiChannelChannelListObject.md → MultiChannelChannelListMMSObject.md} +3 -3
  21. data/docs/{MultiChannelMessageResponseDataChannelListInner.md → MultiChannelChannelListMMSResponseObject.md} +3 -3
  22. data/docs/MultiChannelChannelListObjectBase.md +22 -0
  23. data/docs/MultiChannelChannelListOwnerObject.md +18 -0
  24. data/docs/MultiChannelChannelListRBMObject.md +24 -0
  25. data/docs/{MultiChannelChannelListObjectContent.md → MultiChannelChannelListRBMObjectAllOfContent.md} +6 -10
  26. data/docs/MultiChannelChannelListRBMResponseObject.md +26 -0
  27. data/docs/MultiChannelChannelListRequestObject.md +24 -0
  28. data/docs/MultiChannelChannelListResponseObject.md +26 -0
  29. data/docs/MultiChannelChannelListSMSObject.md +24 -0
  30. data/docs/MultiChannelChannelListSMSResponseObject.md +26 -0
  31. data/docs/MultiChannelMessageRequest.md +1 -1
  32. data/docs/MultiChannelMessageResponseData.md +1 -1
  33. data/docs/PhoneNumberLookupApi.md +12 -3
  34. data/docs/RbmActionBase.md +1 -1
  35. data/docs/RbmSuggestionResponse.md +1 -1
  36. data/docs/RecordingsApi.md +40 -10
  37. data/docs/StatisticsApi.md +4 -1
  38. data/docs/TollFreeVerificationApi.md +36 -9
  39. data/docs/TranscriptionsApi.md +12 -3
  40. data/lib/bandwidth-sdk/api/calls_api.rb +6 -6
  41. data/lib/bandwidth-sdk/api/conferences_api.rb +10 -10
  42. data/lib/bandwidth-sdk/api/media_api.rb +5 -5
  43. data/lib/bandwidth-sdk/api/messages_api.rb +3 -3
  44. data/lib/bandwidth-sdk/api/mfa_api.rb +4 -4
  45. data/lib/bandwidth-sdk/api/multi_channel_api.rb +2 -2
  46. data/lib/bandwidth-sdk/api/phone_number_lookup_api.rb +4 -4
  47. data/lib/bandwidth-sdk/api/recordings_api.rb +11 -11
  48. data/lib/bandwidth-sdk/api/statistics_api.rb +2 -2
  49. data/lib/bandwidth-sdk/api/toll_free_verification_api.rb +13 -13
  50. data/lib/bandwidth-sdk/api/transcriptions_api.rb +4 -4
  51. data/lib/bandwidth-sdk/api_client.rb +9 -5
  52. data/lib/bandwidth-sdk/api_error.rb +1 -1
  53. data/lib/bandwidth-sdk/api_model_base.rb +88 -0
  54. data/lib/bandwidth-sdk/configuration.rb +50 -1
  55. data/lib/bandwidth-sdk/models/account_statistics.rb +11 -78
  56. data/lib/bandwidth-sdk/models/additional_denial_reason.rb +41 -78
  57. data/lib/bandwidth-sdk/models/address.rb +23 -90
  58. data/lib/bandwidth-sdk/models/answer_callback.rb +11 -78
  59. data/lib/bandwidth-sdk/models/async_lookup_request.rb +11 -78
  60. data/lib/bandwidth-sdk/models/blocked_webhook.rb +13 -80
  61. data/lib/bandwidth-sdk/models/bridge_complete_callback.rb +11 -78
  62. data/lib/bandwidth-sdk/models/bridge_target_complete_callback.rb +11 -78
  63. data/lib/bandwidth-sdk/models/business_entity_type_enum.rb +1 -1
  64. data/lib/bandwidth-sdk/models/business_registration_type_enum.rb +1 -1
  65. data/lib/bandwidth-sdk/models/call_direction_enum.rb +1 -1
  66. data/lib/bandwidth-sdk/models/call_recording_metadata.rb +11 -78
  67. data/lib/bandwidth-sdk/models/call_state.rb +11 -78
  68. data/lib/bandwidth-sdk/models/call_state_enum.rb +1 -1
  69. data/lib/bandwidth-sdk/models/call_transcription.rb +11 -78
  70. data/lib/bandwidth-sdk/models/call_transcription_detected_language_enum.rb +1 -1
  71. data/lib/bandwidth-sdk/models/call_transcription_metadata.rb +11 -78
  72. data/lib/bandwidth-sdk/models/call_transcription_response.rb +11 -78
  73. data/lib/bandwidth-sdk/models/call_transcription_track_enum.rb +1 -1
  74. data/lib/bandwidth-sdk/models/callback.rb +1 -1
  75. data/lib/bandwidth-sdk/models/callback_method_enum.rb +1 -1
  76. data/lib/bandwidth-sdk/models/card_width_enum.rb +1 -1
  77. data/lib/bandwidth-sdk/models/code_request.rb +11 -78
  78. data/lib/bandwidth-sdk/models/completed_lookup_status_enum.rb +1 -1
  79. data/lib/bandwidth-sdk/models/conference.rb +11 -78
  80. data/lib/bandwidth-sdk/models/conference_completed_callback.rb +11 -78
  81. data/lib/bandwidth-sdk/models/conference_created_callback.rb +11 -78
  82. data/lib/bandwidth-sdk/models/conference_member.rb +11 -78
  83. data/lib/bandwidth-sdk/models/conference_member_exit_callback.rb +11 -78
  84. data/lib/bandwidth-sdk/models/conference_member_join_callback.rb +11 -78
  85. data/lib/bandwidth-sdk/models/conference_recording_available_callback.rb +11 -78
  86. data/lib/bandwidth-sdk/models/conference_recording_metadata.rb +11 -78
  87. data/lib/bandwidth-sdk/models/conference_redirect_callback.rb +11 -78
  88. data/lib/bandwidth-sdk/models/conference_state_enum.rb +1 -1
  89. data/lib/bandwidth-sdk/models/contact.rb +19 -86
  90. data/lib/bandwidth-sdk/models/create_async_bulk_lookup_response.rb +11 -78
  91. data/lib/bandwidth-sdk/models/create_async_bulk_lookup_response_data.rb +11 -78
  92. data/lib/bandwidth-sdk/models/create_call.rb +41 -78
  93. data/lib/bandwidth-sdk/models/create_call_response.rb +81 -78
  94. data/lib/bandwidth-sdk/models/create_message_request_error.rb +31 -78
  95. data/lib/bandwidth-sdk/models/create_multi_channel_message_response.rb +11 -78
  96. data/lib/bandwidth-sdk/models/create_sync_lookup_response.rb +11 -78
  97. data/lib/bandwidth-sdk/models/create_sync_lookup_response_data.rb +11 -78
  98. data/lib/bandwidth-sdk/models/deactivation_event_enum.rb +1 -1
  99. data/lib/bandwidth-sdk/models/disconnect_callback.rb +11 -78
  100. data/lib/bandwidth-sdk/models/diversion.rb +11 -78
  101. data/lib/bandwidth-sdk/models/dtmf_callback.rb +11 -78
  102. data/lib/bandwidth-sdk/models/error.rb +11 -78
  103. data/lib/bandwidth-sdk/models/error_object.rb +41 -78
  104. data/lib/bandwidth-sdk/models/error_source.rb +11 -78
  105. data/lib/bandwidth-sdk/models/failure_webhook.rb +13 -80
  106. data/lib/bandwidth-sdk/models/field_error.rb +11 -78
  107. data/lib/bandwidth-sdk/models/file_format_enum.rb +1 -1
  108. data/lib/bandwidth-sdk/models/gather_callback.rb +11 -78
  109. data/lib/bandwidth-sdk/models/get_async_bulk_lookup_response.rb +11 -78
  110. data/lib/bandwidth-sdk/models/get_async_bulk_lookup_response_data.rb +11 -78
  111. data/lib/bandwidth-sdk/models/in_progress_lookup_status_enum.rb +1 -1
  112. data/lib/bandwidth-sdk/models/inbound_callback.rb +61 -78
  113. data/lib/bandwidth-sdk/models/inbound_callback_message.rb +81 -78
  114. data/lib/bandwidth-sdk/models/inbound_callback_type_enum.rb +1 -1
  115. data/lib/bandwidth-sdk/models/initiate_callback.rb +11 -78
  116. data/lib/bandwidth-sdk/models/latest_message_delivery_status_enum.rb +1 -1
  117. data/lib/bandwidth-sdk/models/line_type_enum.rb +1 -1
  118. data/lib/bandwidth-sdk/models/link.rb +11 -78
  119. data/lib/bandwidth-sdk/models/link_schema.rb +11 -78
  120. data/lib/bandwidth-sdk/models/links_object.rb +11 -78
  121. data/lib/bandwidth-sdk/models/list_message_direction_enum.rb +1 -1
  122. data/lib/bandwidth-sdk/models/list_message_item.rb +11 -78
  123. data/lib/bandwidth-sdk/models/lookup_error_response.rb +11 -78
  124. data/lib/bandwidth-sdk/models/lookup_error_schema.rb +11 -78
  125. data/lib/bandwidth-sdk/models/lookup_error_schema_meta.rb +11 -78
  126. data/lib/bandwidth-sdk/models/lookup_result.rb +11 -78
  127. data/lib/bandwidth-sdk/models/machine_detection_complete_callback.rb +11 -78
  128. data/lib/bandwidth-sdk/models/machine_detection_configuration.rb +11 -78
  129. data/lib/bandwidth-sdk/models/machine_detection_mode_enum.rb +1 -1
  130. data/lib/bandwidth-sdk/models/machine_detection_result.rb +11 -78
  131. data/lib/bandwidth-sdk/models/media.rb +11 -78
  132. data/lib/bandwidth-sdk/models/message.rb +11 -78
  133. data/lib/bandwidth-sdk/models/message_direction_enum.rb +1 -1
  134. data/lib/bandwidth-sdk/models/message_request.rb +31 -78
  135. data/lib/bandwidth-sdk/models/message_status_enum.rb +1 -1
  136. data/lib/bandwidth-sdk/models/message_type_enum.rb +1 -1
  137. data/lib/bandwidth-sdk/models/messages_list.rb +11 -78
  138. data/lib/bandwidth-sdk/models/messaging_code_response.rb +11 -78
  139. data/lib/bandwidth-sdk/models/messaging_request_error.rb +31 -78
  140. data/lib/bandwidth-sdk/models/mfa_forbidden_request_error.rb +11 -78
  141. data/lib/bandwidth-sdk/models/mfa_request_error.rb +11 -78
  142. data/lib/bandwidth-sdk/models/mfa_unauthorized_request_error.rb +11 -78
  143. data/lib/bandwidth-sdk/models/mms_message_content.rb +11 -78
  144. data/lib/bandwidth-sdk/models/mms_message_content_file.rb +11 -78
  145. data/lib/bandwidth-sdk/models/multi_channel_action.rb +71 -27
  146. data/lib/bandwidth-sdk/models/multi_channel_action_calendar_event.rb +41 -78
  147. data/lib/bandwidth-sdk/models/{multi_channel_channel_list_object.rb → multi_channel_channel_list_mms_object.rb} +60 -80
  148. data/lib/bandwidth-sdk/models/{multi_channel_message_response_data_channel_list_inner.rb → multi_channel_channel_list_mms_response_object.rb} +65 -81
  149. data/lib/bandwidth-sdk/models/multi_channel_channel_list_object_base.rb +238 -0
  150. data/lib/bandwidth-sdk/models/multi_channel_channel_list_owner_object.rb +163 -0
  151. data/lib/bandwidth-sdk/models/multi_channel_channel_list_rbm_object.rb +271 -0
  152. data/lib/bandwidth-sdk/models/{multi_channel_channel_list_object_content.rb → multi_channel_channel_list_rbm_object_all_of_content.rb} +5 -8
  153. data/lib/bandwidth-sdk/models/multi_channel_channel_list_rbm_response_object.rb +299 -0
  154. data/lib/bandwidth-sdk/models/multi_channel_channel_list_request_object.rb +103 -0
  155. data/lib/bandwidth-sdk/models/multi_channel_channel_list_response_object.rb +103 -0
  156. data/lib/bandwidth-sdk/models/multi_channel_channel_list_sms_object.rb +271 -0
  157. data/lib/bandwidth-sdk/models/multi_channel_channel_list_sms_response_object.rb +299 -0
  158. data/lib/bandwidth-sdk/models/multi_channel_error.rb +11 -78
  159. data/lib/bandwidth-sdk/models/multi_channel_message_channel_enum.rb +1 -1
  160. data/lib/bandwidth-sdk/models/multi_channel_message_content.rb +11 -78
  161. data/lib/bandwidth-sdk/models/multi_channel_message_request.rb +22 -79
  162. data/lib/bandwidth-sdk/models/multi_channel_message_response_data.rb +42 -79
  163. data/lib/bandwidth-sdk/models/opt_in_workflow.rb +25 -82
  164. data/lib/bandwidth-sdk/models/page_info.rb +11 -78
  165. data/lib/bandwidth-sdk/models/priority_enum.rb +1 -1
  166. data/lib/bandwidth-sdk/models/product_type_enum.rb +1 -1
  167. data/lib/bandwidth-sdk/models/rbm_action_base.rb +21 -78
  168. data/lib/bandwidth-sdk/models/rbm_action_dial.rb +31 -78
  169. data/lib/bandwidth-sdk/models/rbm_action_open_url.rb +21 -78
  170. data/lib/bandwidth-sdk/models/rbm_action_type_enum.rb +1 -1
  171. data/lib/bandwidth-sdk/models/rbm_action_view_location.rb +41 -78
  172. data/lib/bandwidth-sdk/models/rbm_card_content.rb +11 -78
  173. data/lib/bandwidth-sdk/models/rbm_card_content_media.rb +21 -78
  174. data/lib/bandwidth-sdk/models/rbm_location_response.rb +11 -78
  175. data/lib/bandwidth-sdk/models/rbm_media_height_enum.rb +1 -1
  176. data/lib/bandwidth-sdk/models/rbm_message_carousel_card.rb +21 -78
  177. data/lib/bandwidth-sdk/models/rbm_message_content_file.rb +11 -78
  178. data/lib/bandwidth-sdk/models/rbm_message_content_rich_card.rb +3 -4
  179. data/lib/bandwidth-sdk/models/rbm_message_content_text.rb +11 -78
  180. data/lib/bandwidth-sdk/models/rbm_message_media.rb +21 -78
  181. data/lib/bandwidth-sdk/models/rbm_standalone_card.rb +41 -78
  182. data/lib/bandwidth-sdk/models/rbm_suggestion_response.rb +11 -78
  183. data/lib/bandwidth-sdk/models/recording_available_callback.rb +11 -78
  184. data/lib/bandwidth-sdk/models/recording_complete_callback.rb +11 -78
  185. data/lib/bandwidth-sdk/models/recording_state_enum.rb +1 -1
  186. data/lib/bandwidth-sdk/models/recording_transcription_metadata.rb +11 -78
  187. data/lib/bandwidth-sdk/models/recording_transcriptions.rb +11 -78
  188. data/lib/bandwidth-sdk/models/redirect_callback.rb +11 -78
  189. data/lib/bandwidth-sdk/models/redirect_method_enum.rb +1 -1
  190. data/lib/bandwidth-sdk/models/sms_message_content.rb +11 -78
  191. data/lib/bandwidth-sdk/models/standalone_card_orientation_enum.rb +1 -1
  192. data/lib/bandwidth-sdk/models/status_callback.rb +61 -78
  193. data/lib/bandwidth-sdk/models/status_callback_message.rb +81 -78
  194. data/lib/bandwidth-sdk/models/status_callback_type_enum.rb +6 -6
  195. data/lib/bandwidth-sdk/models/stir_shaken.rb +11 -78
  196. data/lib/bandwidth-sdk/models/sync_lookup_request.rb +11 -78
  197. data/lib/bandwidth-sdk/models/telephone_number.rb +11 -78
  198. data/lib/bandwidth-sdk/models/tfv_basic_authentication.rb +11 -78
  199. data/lib/bandwidth-sdk/models/tfv_callback_status_enum.rb +1 -1
  200. data/lib/bandwidth-sdk/models/tfv_error.rb +11 -78
  201. data/lib/bandwidth-sdk/models/tfv_status.rb +13 -80
  202. data/lib/bandwidth-sdk/models/tfv_status_enum.rb +1 -1
  203. data/lib/bandwidth-sdk/models/tfv_submission_info.rb +21 -88
  204. data/lib/bandwidth-sdk/models/tfv_submission_wrapper.rb +11 -78
  205. data/lib/bandwidth-sdk/models/thumbnail_alignment_enum.rb +1 -1
  206. data/lib/bandwidth-sdk/models/transcribe_recording.rb +11 -78
  207. data/lib/bandwidth-sdk/models/transcription.rb +11 -78
  208. data/lib/bandwidth-sdk/models/transcription_available_callback.rb +11 -78
  209. data/lib/bandwidth-sdk/models/transfer_answer_callback.rb +11 -78
  210. data/lib/bandwidth-sdk/models/transfer_complete_callback.rb +11 -78
  211. data/lib/bandwidth-sdk/models/transfer_disconnect_callback.rb +11 -78
  212. data/lib/bandwidth-sdk/models/update_call.rb +11 -78
  213. data/lib/bandwidth-sdk/models/update_call_recording.rb +21 -78
  214. data/lib/bandwidth-sdk/models/update_conference.rb +11 -78
  215. data/lib/bandwidth-sdk/models/update_conference_member.rb +11 -78
  216. data/lib/bandwidth-sdk/models/verification_denial_webhook.rb +13 -80
  217. data/lib/bandwidth-sdk/models/verification_request.rb +51 -88
  218. data/lib/bandwidth-sdk/models/verification_update_request.rb +51 -88
  219. data/lib/bandwidth-sdk/models/verification_webhook.rb +13 -80
  220. data/lib/bandwidth-sdk/models/verify_code_request.rb +13 -80
  221. data/lib/bandwidth-sdk/models/verify_code_response.rb +11 -78
  222. data/lib/bandwidth-sdk/models/voice_api_error.rb +11 -78
  223. data/lib/bandwidth-sdk/models/voice_code_response.rb +11 -78
  224. data/lib/bandwidth-sdk/models/webhook_subscription.rb +13 -80
  225. data/lib/bandwidth-sdk/models/webhook_subscription_basic_authentication.rb +11 -78
  226. data/lib/bandwidth-sdk/models/webhook_subscription_request_schema.rb +15 -82
  227. data/lib/bandwidth-sdk/models/webhook_subscription_type_enum.rb +1 -1
  228. data/lib/bandwidth-sdk/models/webhook_subscriptions_list_body.rb +21 -78
  229. data/lib/bandwidth-sdk/version.rb +2 -2
  230. data/lib/bandwidth-sdk.rb +13 -4
  231. data/openapitools.json +1 -1
  232. data/spec/smoke/calls_api_spec.rb +50 -76
  233. data/spec/smoke/conferences_api_spec.rb +7 -5
  234. data/spec/smoke/media_api_spec.rb +4 -2
  235. data/spec/smoke/messages_api_spec.rb +9 -4
  236. data/spec/smoke/mfa_api_spec.rb +9 -4
  237. data/spec/smoke/multi_channel_api_spec.rb +128 -25
  238. data/spec/smoke/phone_number_lookup_api_spec.rb +7 -5
  239. data/spec/smoke/recordings_api_spec.rb +7 -33
  240. data/spec/smoke/statistics_api_spec.rb +16 -8
  241. data/spec/smoke/toll_free_verification_api_spec.rb +6 -4
  242. data/spec/smoke/transcriptions_api_spec.rb +7 -5
  243. data/spec/spec_helper.rb +2 -0
  244. data/spec/unit/api/multi_channel_api_spec.rb +13 -2
  245. data/spec/unit/models/verify_code_request_spec.rb +1 -1
  246. metadata +27 -8
@@ -0,0 +1,299 @@
1
+ =begin
2
+ #Bandwidth
3
+
4
+ #Bandwidth's Communication APIs
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ Contact: letstalk@bandwidth.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.17.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Bandwidth
17
+ class MultiChannelChannelListSMSResponseObject < ApiModelBase
18
+ # The sender ID of the message. This could be an alphanumeric sender ID.
19
+ attr_accessor :from
20
+
21
+ # The ID of the Application your from number or senderId is associated with in the Bandwidth Phone Number Dashboard.
22
+ attr_accessor :application_id
23
+
24
+ attr_accessor :channel
25
+
26
+ attr_accessor :content
27
+
28
+ # The Bandwidth senderId associated with the message. Identical to 'from'.
29
+ attr_accessor :owner
30
+
31
+ class EnumAttributeValidator
32
+ attr_reader :datatype
33
+ attr_reader :allowable_values
34
+
35
+ def initialize(datatype, allowable_values)
36
+ @allowable_values = allowable_values.map do |value|
37
+ case datatype.to_s
38
+ when /Integer/i
39
+ value.to_i
40
+ when /Float/i
41
+ value.to_f
42
+ else
43
+ value
44
+ end
45
+ end
46
+ end
47
+
48
+ def valid?(value)
49
+ !value || allowable_values.include?(value)
50
+ end
51
+ end
52
+
53
+ # Attribute mapping from ruby-style variable name to JSON key.
54
+ def self.attribute_map
55
+ {
56
+ :'from' => :'from',
57
+ :'application_id' => :'applicationId',
58
+ :'channel' => :'channel',
59
+ :'content' => :'content',
60
+ :'owner' => :'owner'
61
+ }
62
+ end
63
+
64
+ # Returns attribute mapping this model knows about
65
+ def self.acceptable_attribute_map
66
+ attribute_map
67
+ end
68
+
69
+ # Returns all the JSON keys this model knows about
70
+ def self.acceptable_attributes
71
+ acceptable_attribute_map.values
72
+ end
73
+
74
+ # Attribute type mapping.
75
+ def self.openapi_types
76
+ {
77
+ :'from' => :'String',
78
+ :'application_id' => :'String',
79
+ :'channel' => :'MultiChannelMessageChannelEnum',
80
+ :'content' => :'SmsMessageContent',
81
+ :'owner' => :'String'
82
+ }
83
+ end
84
+
85
+ # List of attributes with nullable: true
86
+ def self.openapi_nullable
87
+ Set.new([
88
+ ])
89
+ end
90
+
91
+ # List of class defined in allOf (OpenAPI v3)
92
+ def self.openapi_all_of
93
+ [
94
+ :'MultiChannelChannelListOwnerObject',
95
+ :'MultiChannelChannelListSMSObject'
96
+ ]
97
+ end
98
+
99
+ # Initializes the object
100
+ # @param [Hash] attributes Model attributes in the form of hash
101
+ def initialize(attributes = {})
102
+ if (!attributes.is_a?(Hash))
103
+ fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::MultiChannelChannelListSMSResponseObject` initialize method'
104
+ end
105
+
106
+ # check to see if the attribute exists and convert string to symbol for hash key
107
+ acceptable_attribute_map = self.class.acceptable_attribute_map
108
+ attributes = attributes.each_with_object({}) { |(k, v), h|
109
+ if (!acceptable_attribute_map.key?(k.to_sym))
110
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::MultiChannelChannelListSMSResponseObject`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
111
+ end
112
+ h[k.to_sym] = v
113
+ }
114
+
115
+ if attributes.key?(:'from')
116
+ self.from = attributes[:'from']
117
+ else
118
+ self.from = nil
119
+ end
120
+
121
+ if attributes.key?(:'application_id')
122
+ self.application_id = attributes[:'application_id']
123
+ else
124
+ self.application_id = nil
125
+ end
126
+
127
+ if attributes.key?(:'channel')
128
+ self.channel = attributes[:'channel']
129
+ else
130
+ self.channel = nil
131
+ end
132
+
133
+ if attributes.key?(:'content')
134
+ self.content = attributes[:'content']
135
+ else
136
+ self.content = nil
137
+ end
138
+
139
+ if attributes.key?(:'owner')
140
+ self.owner = attributes[:'owner']
141
+ else
142
+ self.owner = nil
143
+ end
144
+ end
145
+
146
+ # Show invalid properties with the reasons. Usually used together with valid?
147
+ # @return Array for valid properties with the reasons
148
+ def list_invalid_properties
149
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
150
+ invalid_properties = Array.new
151
+ if @from.nil?
152
+ invalid_properties.push('invalid value for "from", from cannot be nil.')
153
+ end
154
+
155
+ if @application_id.nil?
156
+ invalid_properties.push('invalid value for "application_id", application_id cannot be nil.')
157
+ end
158
+
159
+ if @channel.nil?
160
+ invalid_properties.push('invalid value for "channel", channel cannot be nil.')
161
+ end
162
+
163
+ if @content.nil?
164
+ invalid_properties.push('invalid value for "content", content cannot be nil.')
165
+ end
166
+
167
+ if @owner.nil?
168
+ invalid_properties.push('invalid value for "owner", owner cannot be nil.')
169
+ end
170
+
171
+ invalid_properties
172
+ end
173
+
174
+ # Check to see if the all the properties in the model are valid
175
+ # @return true if the model is valid
176
+ def valid?
177
+ warn '[DEPRECATED] the `valid?` method is obsolete'
178
+ return false if @from.nil?
179
+ return false if @application_id.nil?
180
+ return false if @channel.nil?
181
+ return false if @content.nil?
182
+ return false if @owner.nil?
183
+ true
184
+ end
185
+
186
+ # Custom attribute writer method with validation
187
+ # @param [Object] from Value to be assigned
188
+ def from=(from)
189
+ if from.nil?
190
+ fail ArgumentError, 'from cannot be nil'
191
+ end
192
+
193
+ @from = from
194
+ end
195
+
196
+ # Custom attribute writer method with validation
197
+ # @param [Object] application_id Value to be assigned
198
+ def application_id=(application_id)
199
+ if application_id.nil?
200
+ fail ArgumentError, 'application_id cannot be nil'
201
+ end
202
+
203
+ @application_id = application_id
204
+ end
205
+
206
+ # Custom attribute writer method with validation
207
+ # @param [Object] channel Value to be assigned
208
+ def channel=(channel)
209
+ if channel.nil?
210
+ fail ArgumentError, 'channel cannot be nil'
211
+ end
212
+
213
+ @channel = channel
214
+ end
215
+
216
+ # Custom attribute writer method with validation
217
+ # @param [Object] content Value to be assigned
218
+ def content=(content)
219
+ if content.nil?
220
+ fail ArgumentError, 'content cannot be nil'
221
+ end
222
+
223
+ @content = content
224
+ end
225
+
226
+ # Custom attribute writer method with validation
227
+ # @param [Object] owner Value to be assigned
228
+ def owner=(owner)
229
+ if owner.nil?
230
+ fail ArgumentError, 'owner cannot be nil'
231
+ end
232
+
233
+ @owner = owner
234
+ end
235
+
236
+ # Checks equality by comparing each attribute.
237
+ # @param [Object] Object to be compared
238
+ def ==(o)
239
+ return true if self.equal?(o)
240
+ self.class == o.class &&
241
+ from == o.from &&
242
+ application_id == o.application_id &&
243
+ channel == o.channel &&
244
+ content == o.content &&
245
+ owner == o.owner
246
+ end
247
+
248
+ # @see the `==` method
249
+ # @param [Object] Object to be compared
250
+ def eql?(o)
251
+ self == o
252
+ end
253
+
254
+ # Calculates hash code according to all attributes.
255
+ # @return [Integer] Hash code
256
+ def hash
257
+ [from, application_id, channel, content, owner].hash
258
+ end
259
+
260
+ # Builds the object from hash
261
+ # @param [Hash] attributes Model attributes in the form of hash
262
+ # @return [Object] Returns the model itself
263
+ def self.build_from_hash(attributes)
264
+ return nil unless attributes.is_a?(Hash)
265
+ attributes = attributes.transform_keys(&:to_sym)
266
+ transformed_hash = {}
267
+ openapi_types.each_pair do |key, type|
268
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
269
+ transformed_hash["#{key}"] = nil
270
+ elsif type =~ /\AArray<(.*)>/i
271
+ # check to ensure the input is an array given that the attribute
272
+ # is documented as an array but the input is not
273
+ if attributes[attribute_map[key]].is_a?(Array)
274
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
275
+ end
276
+ elsif !attributes[attribute_map[key]].nil?
277
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
278
+ end
279
+ end
280
+ new(transformed_hash)
281
+ end
282
+
283
+ # Returns the object in the form of hash
284
+ # @return [Hash] Returns the object in the form of hash
285
+ def to_hash
286
+ hash = {}
287
+ self.class.attribute_map.each_pair do |attr, param|
288
+ value = self.send(attr)
289
+ if value.nil?
290
+ is_nullable = self.class.openapi_nullable.include?(attr)
291
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
292
+ end
293
+
294
+ hash[param] = _to_hash(value)
295
+ end
296
+ hash
297
+ end
298
+ end
299
+ end
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0.0
7
7
  Contact: letstalk@bandwidth.com
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.8.0
9
+ Generator version: 7.17.0
10
10
 
11
11
  =end
12
12
 
@@ -14,7 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Bandwidth
17
- class MultiChannelError
17
+ class MultiChannelError < ApiModelBase
18
18
  attr_accessor :links
19
19
 
20
20
  attr_accessor :data
@@ -30,9 +30,14 @@ module Bandwidth
30
30
  }
31
31
  end
32
32
 
33
+ # Returns attribute mapping this model knows about
34
+ def self.acceptable_attribute_map
35
+ attribute_map
36
+ end
37
+
33
38
  # Returns all the JSON keys this model knows about
34
39
  def self.acceptable_attributes
35
- attribute_map.values
40
+ acceptable_attribute_map.values
36
41
  end
37
42
 
38
43
  # Attribute type mapping.
@@ -59,9 +64,10 @@ module Bandwidth
59
64
  end
60
65
 
61
66
  # check to see if the attribute exists and convert string to symbol for hash key
67
+ acceptable_attribute_map = self.class.acceptable_attribute_map
62
68
  attributes = attributes.each_with_object({}) { |(k, v), h|
63
- if (!self.class.attribute_map.key?(k.to_sym))
64
- fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::MultiChannelError`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
69
+ if (!acceptable_attribute_map.key?(k.to_sym))
70
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::MultiChannelError`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
65
71
  end
66
72
  h[k.to_sym] = v
67
73
  }
@@ -143,61 +149,6 @@ module Bandwidth
143
149
  new(transformed_hash)
144
150
  end
145
151
 
146
- # Deserializes the data based on type
147
- # @param string type Data type
148
- # @param string value Value to be deserialized
149
- # @return [Object] Deserialized data
150
- def self._deserialize(type, value)
151
- case type.to_sym
152
- when :Time
153
- Time.parse(value)
154
- when :Date
155
- Date.parse(value)
156
- when :String
157
- value.to_s
158
- when :Integer
159
- value.to_i
160
- when :Float
161
- value.to_f
162
- when :Boolean
163
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
164
- true
165
- else
166
- false
167
- end
168
- when :Object
169
- # generic object (usually a Hash), return directly
170
- value
171
- when /\AArray<(?<inner_type>.+)>\z/
172
- inner_type = Regexp.last_match[:inner_type]
173
- value.map { |v| _deserialize(inner_type, v) }
174
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
175
- k_type = Regexp.last_match[:k_type]
176
- v_type = Regexp.last_match[:v_type]
177
- {}.tap do |hash|
178
- value.each do |k, v|
179
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
180
- end
181
- end
182
- else # model
183
- # models (e.g. Pet) or oneOf
184
- klass = Bandwidth.const_get(type)
185
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
186
- end
187
- end
188
-
189
- # Returns the string representation of the object
190
- # @return [String] String presentation of the object
191
- def to_s
192
- to_hash.to_s
193
- end
194
-
195
- # to_body is an alias to to_hash (backward compatibility)
196
- # @return [Hash] Returns the object in the form of hash
197
- def to_body
198
- to_hash
199
- end
200
-
201
152
  # Returns the object in the form of hash
202
153
  # @return [Hash] Returns the object in the form of hash
203
154
  def to_hash
@@ -213,23 +164,5 @@ module Bandwidth
213
164
  end
214
165
  hash
215
166
  end
216
-
217
- # Outputs non-array value in the form of hash
218
- # For object, use to_hash. Otherwise, just return the value
219
- # @param [Object] value Any valid value
220
- # @return [Hash] Returns the value in the form of hash
221
- def _to_hash(value)
222
- if value.is_a?(Array)
223
- value.compact.map { |v| _to_hash(v) }
224
- elsif value.is_a?(Hash)
225
- {}.tap do |hash|
226
- value.each { |k, v| hash[k] = _to_hash(v) }
227
- end
228
- elsif value.respond_to? :to_hash
229
- value.to_hash
230
- else
231
- value
232
- end
233
- end
234
167
  end
235
168
  end
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0.0
7
7
  Contact: letstalk@bandwidth.com
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.8.0
9
+ Generator version: 7.17.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0.0
7
7
  Contact: letstalk@bandwidth.com
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.8.0
9
+ Generator version: 7.17.0
10
10
 
11
11
  =end
12
12
 
@@ -15,7 +15,7 @@ require 'time'
15
15
 
16
16
  module Bandwidth
17
17
  # The structure of the content field of a multichannel message.
18
- class MultiChannelMessageContent
18
+ class MultiChannelMessageContent < ApiModelBase
19
19
  attr_accessor :text
20
20
 
21
21
  attr_accessor :media
@@ -28,9 +28,14 @@ module Bandwidth
28
28
  }
29
29
  end
30
30
 
31
+ # Returns attribute mapping this model knows about
32
+ def self.acceptable_attribute_map
33
+ attribute_map
34
+ end
35
+
31
36
  # Returns all the JSON keys this model knows about
32
37
  def self.acceptable_attributes
33
- attribute_map.values
38
+ acceptable_attribute_map.values
34
39
  end
35
40
 
36
41
  # Attribute type mapping.
@@ -55,9 +60,10 @@ module Bandwidth
55
60
  end
56
61
 
57
62
  # check to see if the attribute exists and convert string to symbol for hash key
63
+ acceptable_attribute_map = self.class.acceptable_attribute_map
58
64
  attributes = attributes.each_with_object({}) { |(k, v), h|
59
- if (!self.class.attribute_map.key?(k.to_sym))
60
- fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::MultiChannelMessageContent`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
65
+ if (!acceptable_attribute_map.key?(k.to_sym))
66
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::MultiChannelMessageContent`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
61
67
  end
62
68
  h[k.to_sym] = v
63
69
  }
@@ -130,61 +136,6 @@ module Bandwidth
130
136
  new(transformed_hash)
131
137
  end
132
138
 
133
- # Deserializes the data based on type
134
- # @param string type Data type
135
- # @param string value Value to be deserialized
136
- # @return [Object] Deserialized data
137
- def self._deserialize(type, value)
138
- case type.to_sym
139
- when :Time
140
- Time.parse(value)
141
- when :Date
142
- Date.parse(value)
143
- when :String
144
- value.to_s
145
- when :Integer
146
- value.to_i
147
- when :Float
148
- value.to_f
149
- when :Boolean
150
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
151
- true
152
- else
153
- false
154
- end
155
- when :Object
156
- # generic object (usually a Hash), return directly
157
- value
158
- when /\AArray<(?<inner_type>.+)>\z/
159
- inner_type = Regexp.last_match[:inner_type]
160
- value.map { |v| _deserialize(inner_type, v) }
161
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
162
- k_type = Regexp.last_match[:k_type]
163
- v_type = Regexp.last_match[:v_type]
164
- {}.tap do |hash|
165
- value.each do |k, v|
166
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
167
- end
168
- end
169
- else # model
170
- # models (e.g. Pet) or oneOf
171
- klass = Bandwidth.const_get(type)
172
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
173
- end
174
- end
175
-
176
- # Returns the string representation of the object
177
- # @return [String] String presentation of the object
178
- def to_s
179
- to_hash.to_s
180
- end
181
-
182
- # to_body is an alias to to_hash (backward compatibility)
183
- # @return [Hash] Returns the object in the form of hash
184
- def to_body
185
- to_hash
186
- end
187
-
188
139
  # Returns the object in the form of hash
189
140
  # @return [Hash] Returns the object in the form of hash
190
141
  def to_hash
@@ -200,23 +151,5 @@ module Bandwidth
200
151
  end
201
152
  hash
202
153
  end
203
-
204
- # Outputs non-array value in the form of hash
205
- # For object, use to_hash. Otherwise, just return the value
206
- # @param [Object] value Any valid value
207
- # @return [Hash] Returns the value in the form of hash
208
- def _to_hash(value)
209
- if value.is_a?(Array)
210
- value.compact.map { |v| _to_hash(v) }
211
- elsif value.is_a?(Hash)
212
- {}.tap do |hash|
213
- value.each { |k, v| hash[k] = _to_hash(v) }
214
- end
215
- elsif value.respond_to? :to_hash
216
- value.to_hash
217
- else
218
- value
219
- end
220
- end
221
154
  end
222
155
  end