bandwidth-sdk 17.0.1 → 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 (229) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +2 -2
  3. data/README.md +18 -0
  4. data/bandwidth-sdk.gemspec +1 -2
  5. data/bandwidth.yml +7 -0
  6. data/coverage/.last_run.json +1 -1
  7. data/coverage/.resultset.json +198 -387
  8. data/coverage/index.html +5842 -7703
  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/MultiChannelApi.md +4 -1
  19. data/docs/PhoneNumberLookupApi.md +12 -3
  20. data/docs/RecordingsApi.md +40 -10
  21. data/docs/StatisticsApi.md +4 -1
  22. data/docs/TollFreeVerificationApi.md +36 -9
  23. data/docs/TranscriptionsApi.md +12 -3
  24. data/lib/bandwidth-sdk/api/calls_api.rb +6 -6
  25. data/lib/bandwidth-sdk/api/conferences_api.rb +10 -10
  26. data/lib/bandwidth-sdk/api/media_api.rb +5 -5
  27. data/lib/bandwidth-sdk/api/messages_api.rb +3 -3
  28. data/lib/bandwidth-sdk/api/mfa_api.rb +4 -4
  29. data/lib/bandwidth-sdk/api/multi_channel_api.rb +2 -2
  30. data/lib/bandwidth-sdk/api/phone_number_lookup_api.rb +4 -4
  31. data/lib/bandwidth-sdk/api/recordings_api.rb +11 -11
  32. data/lib/bandwidth-sdk/api/statistics_api.rb +2 -2
  33. data/lib/bandwidth-sdk/api/toll_free_verification_api.rb +13 -13
  34. data/lib/bandwidth-sdk/api/transcriptions_api.rb +4 -4
  35. data/lib/bandwidth-sdk/api_client.rb +9 -5
  36. data/lib/bandwidth-sdk/api_error.rb +1 -1
  37. data/lib/bandwidth-sdk/api_model_base.rb +88 -0
  38. data/lib/bandwidth-sdk/configuration.rb +50 -1
  39. data/lib/bandwidth-sdk/models/account_statistics.rb +11 -78
  40. data/lib/bandwidth-sdk/models/additional_denial_reason.rb +41 -78
  41. data/lib/bandwidth-sdk/models/address.rb +23 -90
  42. data/lib/bandwidth-sdk/models/answer_callback.rb +11 -78
  43. data/lib/bandwidth-sdk/models/async_lookup_request.rb +11 -78
  44. data/lib/bandwidth-sdk/models/blocked_webhook.rb +13 -80
  45. data/lib/bandwidth-sdk/models/bridge_complete_callback.rb +11 -78
  46. data/lib/bandwidth-sdk/models/bridge_target_complete_callback.rb +11 -78
  47. data/lib/bandwidth-sdk/models/business_entity_type_enum.rb +1 -1
  48. data/lib/bandwidth-sdk/models/business_registration_type_enum.rb +1 -1
  49. data/lib/bandwidth-sdk/models/call_direction_enum.rb +1 -1
  50. data/lib/bandwidth-sdk/models/call_recording_metadata.rb +11 -78
  51. data/lib/bandwidth-sdk/models/call_state.rb +11 -78
  52. data/lib/bandwidth-sdk/models/call_state_enum.rb +1 -1
  53. data/lib/bandwidth-sdk/models/call_transcription.rb +11 -78
  54. data/lib/bandwidth-sdk/models/call_transcription_detected_language_enum.rb +1 -1
  55. data/lib/bandwidth-sdk/models/call_transcription_metadata.rb +11 -78
  56. data/lib/bandwidth-sdk/models/call_transcription_response.rb +11 -78
  57. data/lib/bandwidth-sdk/models/call_transcription_track_enum.rb +1 -1
  58. data/lib/bandwidth-sdk/models/callback.rb +1 -1
  59. data/lib/bandwidth-sdk/models/callback_method_enum.rb +1 -1
  60. data/lib/bandwidth-sdk/models/card_width_enum.rb +1 -1
  61. data/lib/bandwidth-sdk/models/code_request.rb +11 -78
  62. data/lib/bandwidth-sdk/models/completed_lookup_status_enum.rb +1 -1
  63. data/lib/bandwidth-sdk/models/conference.rb +11 -78
  64. data/lib/bandwidth-sdk/models/conference_completed_callback.rb +11 -78
  65. data/lib/bandwidth-sdk/models/conference_created_callback.rb +11 -78
  66. data/lib/bandwidth-sdk/models/conference_member.rb +11 -78
  67. data/lib/bandwidth-sdk/models/conference_member_exit_callback.rb +11 -78
  68. data/lib/bandwidth-sdk/models/conference_member_join_callback.rb +11 -78
  69. data/lib/bandwidth-sdk/models/conference_recording_available_callback.rb +11 -78
  70. data/lib/bandwidth-sdk/models/conference_recording_metadata.rb +11 -78
  71. data/lib/bandwidth-sdk/models/conference_redirect_callback.rb +11 -78
  72. data/lib/bandwidth-sdk/models/conference_state_enum.rb +1 -1
  73. data/lib/bandwidth-sdk/models/contact.rb +19 -86
  74. data/lib/bandwidth-sdk/models/create_async_bulk_lookup_response.rb +11 -78
  75. data/lib/bandwidth-sdk/models/create_async_bulk_lookup_response_data.rb +11 -78
  76. data/lib/bandwidth-sdk/models/create_call.rb +41 -78
  77. data/lib/bandwidth-sdk/models/create_call_response.rb +81 -78
  78. data/lib/bandwidth-sdk/models/create_message_request_error.rb +31 -78
  79. data/lib/bandwidth-sdk/models/create_multi_channel_message_response.rb +11 -78
  80. data/lib/bandwidth-sdk/models/create_sync_lookup_response.rb +11 -78
  81. data/lib/bandwidth-sdk/models/create_sync_lookup_response_data.rb +11 -78
  82. data/lib/bandwidth-sdk/models/deactivation_event_enum.rb +1 -1
  83. data/lib/bandwidth-sdk/models/disconnect_callback.rb +11 -78
  84. data/lib/bandwidth-sdk/models/diversion.rb +11 -78
  85. data/lib/bandwidth-sdk/models/dtmf_callback.rb +11 -78
  86. data/lib/bandwidth-sdk/models/error.rb +11 -78
  87. data/lib/bandwidth-sdk/models/error_object.rb +41 -78
  88. data/lib/bandwidth-sdk/models/error_source.rb +11 -78
  89. data/lib/bandwidth-sdk/models/failure_webhook.rb +13 -80
  90. data/lib/bandwidth-sdk/models/field_error.rb +11 -78
  91. data/lib/bandwidth-sdk/models/file_format_enum.rb +1 -1
  92. data/lib/bandwidth-sdk/models/gather_callback.rb +11 -78
  93. data/lib/bandwidth-sdk/models/get_async_bulk_lookup_response.rb +11 -78
  94. data/lib/bandwidth-sdk/models/get_async_bulk_lookup_response_data.rb +11 -78
  95. data/lib/bandwidth-sdk/models/in_progress_lookup_status_enum.rb +1 -1
  96. data/lib/bandwidth-sdk/models/inbound_callback.rb +61 -78
  97. data/lib/bandwidth-sdk/models/inbound_callback_message.rb +81 -78
  98. data/lib/bandwidth-sdk/models/inbound_callback_type_enum.rb +1 -1
  99. data/lib/bandwidth-sdk/models/initiate_callback.rb +11 -78
  100. data/lib/bandwidth-sdk/models/latest_message_delivery_status_enum.rb +1 -1
  101. data/lib/bandwidth-sdk/models/line_type_enum.rb +1 -1
  102. data/lib/bandwidth-sdk/models/link.rb +11 -78
  103. data/lib/bandwidth-sdk/models/link_schema.rb +11 -78
  104. data/lib/bandwidth-sdk/models/links_object.rb +11 -78
  105. data/lib/bandwidth-sdk/models/list_message_direction_enum.rb +1 -1
  106. data/lib/bandwidth-sdk/models/list_message_item.rb +11 -78
  107. data/lib/bandwidth-sdk/models/lookup_error_response.rb +11 -78
  108. data/lib/bandwidth-sdk/models/lookup_error_schema.rb +11 -78
  109. data/lib/bandwidth-sdk/models/lookup_error_schema_meta.rb +11 -78
  110. data/lib/bandwidth-sdk/models/lookup_result.rb +11 -78
  111. data/lib/bandwidth-sdk/models/machine_detection_complete_callback.rb +11 -78
  112. data/lib/bandwidth-sdk/models/machine_detection_configuration.rb +11 -78
  113. data/lib/bandwidth-sdk/models/machine_detection_mode_enum.rb +1 -1
  114. data/lib/bandwidth-sdk/models/machine_detection_result.rb +11 -78
  115. data/lib/bandwidth-sdk/models/media.rb +11 -78
  116. data/lib/bandwidth-sdk/models/message.rb +11 -78
  117. data/lib/bandwidth-sdk/models/message_direction_enum.rb +1 -1
  118. data/lib/bandwidth-sdk/models/message_request.rb +31 -78
  119. data/lib/bandwidth-sdk/models/message_status_enum.rb +1 -1
  120. data/lib/bandwidth-sdk/models/message_type_enum.rb +1 -1
  121. data/lib/bandwidth-sdk/models/messages_list.rb +11 -78
  122. data/lib/bandwidth-sdk/models/messaging_code_response.rb +11 -78
  123. data/lib/bandwidth-sdk/models/messaging_request_error.rb +31 -78
  124. data/lib/bandwidth-sdk/models/mfa_forbidden_request_error.rb +11 -78
  125. data/lib/bandwidth-sdk/models/mfa_request_error.rb +11 -78
  126. data/lib/bandwidth-sdk/models/mfa_unauthorized_request_error.rb +11 -78
  127. data/lib/bandwidth-sdk/models/mms_message_content.rb +11 -78
  128. data/lib/bandwidth-sdk/models/mms_message_content_file.rb +11 -78
  129. data/lib/bandwidth-sdk/models/multi_channel_action.rb +3 -4
  130. data/lib/bandwidth-sdk/models/multi_channel_action_calendar_event.rb +41 -78
  131. data/lib/bandwidth-sdk/models/multi_channel_channel_list_mms_object.rb +51 -78
  132. data/lib/bandwidth-sdk/models/multi_channel_channel_list_mms_response_object.rb +61 -78
  133. data/lib/bandwidth-sdk/models/multi_channel_channel_list_object_base.rb +41 -78
  134. data/lib/bandwidth-sdk/models/multi_channel_channel_list_owner_object.rb +21 -78
  135. data/lib/bandwidth-sdk/models/multi_channel_channel_list_rbm_object.rb +51 -78
  136. data/lib/bandwidth-sdk/models/multi_channel_channel_list_rbm_object_all_of_content.rb +3 -4
  137. data/lib/bandwidth-sdk/models/multi_channel_channel_list_rbm_response_object.rb +61 -78
  138. data/lib/bandwidth-sdk/models/multi_channel_channel_list_request_object.rb +3 -4
  139. data/lib/bandwidth-sdk/models/multi_channel_channel_list_response_object.rb +3 -4
  140. data/lib/bandwidth-sdk/models/multi_channel_channel_list_sms_object.rb +51 -78
  141. data/lib/bandwidth-sdk/models/multi_channel_channel_list_sms_response_object.rb +61 -78
  142. data/lib/bandwidth-sdk/models/multi_channel_error.rb +11 -78
  143. data/lib/bandwidth-sdk/models/multi_channel_message_channel_enum.rb +1 -1
  144. data/lib/bandwidth-sdk/models/multi_channel_message_content.rb +11 -78
  145. data/lib/bandwidth-sdk/models/multi_channel_message_request.rb +21 -78
  146. data/lib/bandwidth-sdk/models/multi_channel_message_response_data.rb +41 -78
  147. data/lib/bandwidth-sdk/models/opt_in_workflow.rb +25 -82
  148. data/lib/bandwidth-sdk/models/page_info.rb +11 -78
  149. data/lib/bandwidth-sdk/models/priority_enum.rb +1 -1
  150. data/lib/bandwidth-sdk/models/product_type_enum.rb +1 -1
  151. data/lib/bandwidth-sdk/models/rbm_action_base.rb +21 -78
  152. data/lib/bandwidth-sdk/models/rbm_action_dial.rb +31 -78
  153. data/lib/bandwidth-sdk/models/rbm_action_open_url.rb +21 -78
  154. data/lib/bandwidth-sdk/models/rbm_action_type_enum.rb +1 -1
  155. data/lib/bandwidth-sdk/models/rbm_action_view_location.rb +41 -78
  156. data/lib/bandwidth-sdk/models/rbm_card_content.rb +11 -78
  157. data/lib/bandwidth-sdk/models/rbm_card_content_media.rb +21 -78
  158. data/lib/bandwidth-sdk/models/rbm_location_response.rb +11 -78
  159. data/lib/bandwidth-sdk/models/rbm_media_height_enum.rb +1 -1
  160. data/lib/bandwidth-sdk/models/rbm_message_carousel_card.rb +21 -78
  161. data/lib/bandwidth-sdk/models/rbm_message_content_file.rb +11 -78
  162. data/lib/bandwidth-sdk/models/rbm_message_content_rich_card.rb +3 -4
  163. data/lib/bandwidth-sdk/models/rbm_message_content_text.rb +11 -78
  164. data/lib/bandwidth-sdk/models/rbm_message_media.rb +21 -78
  165. data/lib/bandwidth-sdk/models/rbm_standalone_card.rb +41 -78
  166. data/lib/bandwidth-sdk/models/rbm_suggestion_response.rb +11 -78
  167. data/lib/bandwidth-sdk/models/recording_available_callback.rb +11 -78
  168. data/lib/bandwidth-sdk/models/recording_complete_callback.rb +11 -78
  169. data/lib/bandwidth-sdk/models/recording_state_enum.rb +1 -1
  170. data/lib/bandwidth-sdk/models/recording_transcription_metadata.rb +11 -78
  171. data/lib/bandwidth-sdk/models/recording_transcriptions.rb +11 -78
  172. data/lib/bandwidth-sdk/models/redirect_callback.rb +11 -78
  173. data/lib/bandwidth-sdk/models/redirect_method_enum.rb +1 -1
  174. data/lib/bandwidth-sdk/models/sms_message_content.rb +11 -78
  175. data/lib/bandwidth-sdk/models/standalone_card_orientation_enum.rb +1 -1
  176. data/lib/bandwidth-sdk/models/status_callback.rb +61 -78
  177. data/lib/bandwidth-sdk/models/status_callback_message.rb +81 -78
  178. data/lib/bandwidth-sdk/models/status_callback_type_enum.rb +6 -6
  179. data/lib/bandwidth-sdk/models/stir_shaken.rb +11 -78
  180. data/lib/bandwidth-sdk/models/sync_lookup_request.rb +11 -78
  181. data/lib/bandwidth-sdk/models/telephone_number.rb +11 -78
  182. data/lib/bandwidth-sdk/models/tfv_basic_authentication.rb +11 -78
  183. data/lib/bandwidth-sdk/models/tfv_callback_status_enum.rb +1 -1
  184. data/lib/bandwidth-sdk/models/tfv_error.rb +11 -78
  185. data/lib/bandwidth-sdk/models/tfv_status.rb +13 -80
  186. data/lib/bandwidth-sdk/models/tfv_status_enum.rb +1 -1
  187. data/lib/bandwidth-sdk/models/tfv_submission_info.rb +21 -88
  188. data/lib/bandwidth-sdk/models/tfv_submission_wrapper.rb +11 -78
  189. data/lib/bandwidth-sdk/models/thumbnail_alignment_enum.rb +1 -1
  190. data/lib/bandwidth-sdk/models/transcribe_recording.rb +11 -78
  191. data/lib/bandwidth-sdk/models/transcription.rb +11 -78
  192. data/lib/bandwidth-sdk/models/transcription_available_callback.rb +11 -78
  193. data/lib/bandwidth-sdk/models/transfer_answer_callback.rb +11 -78
  194. data/lib/bandwidth-sdk/models/transfer_complete_callback.rb +11 -78
  195. data/lib/bandwidth-sdk/models/transfer_disconnect_callback.rb +11 -78
  196. data/lib/bandwidth-sdk/models/update_call.rb +11 -78
  197. data/lib/bandwidth-sdk/models/update_call_recording.rb +21 -78
  198. data/lib/bandwidth-sdk/models/update_conference.rb +11 -78
  199. data/lib/bandwidth-sdk/models/update_conference_member.rb +11 -78
  200. data/lib/bandwidth-sdk/models/verification_denial_webhook.rb +13 -80
  201. data/lib/bandwidth-sdk/models/verification_request.rb +51 -88
  202. data/lib/bandwidth-sdk/models/verification_update_request.rb +51 -88
  203. data/lib/bandwidth-sdk/models/verification_webhook.rb +13 -80
  204. data/lib/bandwidth-sdk/models/verify_code_request.rb +13 -80
  205. data/lib/bandwidth-sdk/models/verify_code_response.rb +11 -78
  206. data/lib/bandwidth-sdk/models/voice_api_error.rb +11 -78
  207. data/lib/bandwidth-sdk/models/voice_code_response.rb +11 -78
  208. data/lib/bandwidth-sdk/models/webhook_subscription.rb +13 -80
  209. data/lib/bandwidth-sdk/models/webhook_subscription_basic_authentication.rb +11 -78
  210. data/lib/bandwidth-sdk/models/webhook_subscription_request_schema.rb +15 -82
  211. data/lib/bandwidth-sdk/models/webhook_subscription_type_enum.rb +1 -1
  212. data/lib/bandwidth-sdk/models/webhook_subscriptions_list_body.rb +21 -78
  213. data/lib/bandwidth-sdk/version.rb +2 -2
  214. data/lib/bandwidth-sdk.rb +2 -1
  215. data/openapitools.json +1 -1
  216. data/spec/smoke/calls_api_spec.rb +50 -76
  217. data/spec/smoke/conferences_api_spec.rb +7 -5
  218. data/spec/smoke/media_api_spec.rb +4 -2
  219. data/spec/smoke/messages_api_spec.rb +9 -4
  220. data/spec/smoke/mfa_api_spec.rb +9 -4
  221. data/spec/smoke/multi_channel_api_spec.rb +4 -2
  222. data/spec/smoke/phone_number_lookup_api_spec.rb +6 -4
  223. data/spec/smoke/recordings_api_spec.rb +7 -33
  224. data/spec/smoke/statistics_api_spec.rb +16 -8
  225. data/spec/smoke/toll_free_verification_api_spec.rb +6 -4
  226. data/spec/smoke/transcriptions_api_spec.rb +7 -5
  227. data/spec/spec_helper.rb +2 -0
  228. data/spec/unit/models/verify_code_request_spec.rb +1 -1
  229. metadata +5 -2
@@ -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 CreateAsyncBulkLookupResponse
17
+ class CreateAsyncBulkLookupResponse < ApiModelBase
18
18
  # Links for pagination (if applicable)
19
19
  attr_accessor :links
20
20
 
@@ -31,9 +31,14 @@ module Bandwidth
31
31
  }
32
32
  end
33
33
 
34
+ # Returns attribute mapping this model knows about
35
+ def self.acceptable_attribute_map
36
+ attribute_map
37
+ end
38
+
34
39
  # Returns all the JSON keys this model knows about
35
40
  def self.acceptable_attributes
36
- attribute_map.values
41
+ acceptable_attribute_map.values
37
42
  end
38
43
 
39
44
  # 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::CreateAsyncBulkLookupResponse`. 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::CreateAsyncBulkLookupResponse`. 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
 
@@ -15,7 +15,7 @@ require 'time'
15
15
 
16
16
  module Bandwidth
17
17
  # The phone number lookup response data
18
- class CreateAsyncBulkLookupResponseData
18
+ class CreateAsyncBulkLookupResponseData < ApiModelBase
19
19
  # The phone number lookup request ID from Bandwidth.
20
20
  attr_accessor :request_id
21
21
 
@@ -51,9 +51,14 @@ module Bandwidth
51
51
  }
52
52
  end
53
53
 
54
+ # Returns attribute mapping this model knows about
55
+ def self.acceptable_attribute_map
56
+ attribute_map
57
+ end
58
+
54
59
  # Returns all the JSON keys this model knows about
55
60
  def self.acceptable_attributes
56
- attribute_map.values
61
+ acceptable_attribute_map.values
57
62
  end
58
63
 
59
64
  # Attribute type mapping.
@@ -78,9 +83,10 @@ module Bandwidth
78
83
  end
79
84
 
80
85
  # check to see if the attribute exists and convert string to symbol for hash key
86
+ acceptable_attribute_map = self.class.acceptable_attribute_map
81
87
  attributes = attributes.each_with_object({}) { |(k, v), h|
82
- if (!self.class.attribute_map.key?(k.to_sym))
83
- fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::CreateAsyncBulkLookupResponseData`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
88
+ if (!acceptable_attribute_map.key?(k.to_sym))
89
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::CreateAsyncBulkLookupResponseData`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
84
90
  end
85
91
  h[k.to_sym] = v
86
92
  }
@@ -153,61 +159,6 @@ module Bandwidth
153
159
  new(transformed_hash)
154
160
  end
155
161
 
156
- # Deserializes the data based on type
157
- # @param string type Data type
158
- # @param string value Value to be deserialized
159
- # @return [Object] Deserialized data
160
- def self._deserialize(type, value)
161
- case type.to_sym
162
- when :Time
163
- Time.parse(value)
164
- when :Date
165
- Date.parse(value)
166
- when :String
167
- value.to_s
168
- when :Integer
169
- value.to_i
170
- when :Float
171
- value.to_f
172
- when :Boolean
173
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
174
- true
175
- else
176
- false
177
- end
178
- when :Object
179
- # generic object (usually a Hash), return directly
180
- value
181
- when /\AArray<(?<inner_type>.+)>\z/
182
- inner_type = Regexp.last_match[:inner_type]
183
- value.map { |v| _deserialize(inner_type, v) }
184
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
185
- k_type = Regexp.last_match[:k_type]
186
- v_type = Regexp.last_match[:v_type]
187
- {}.tap do |hash|
188
- value.each do |k, v|
189
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
190
- end
191
- end
192
- else # model
193
- # models (e.g. Pet) or oneOf
194
- klass = Bandwidth.const_get(type)
195
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
196
- end
197
- end
198
-
199
- # Returns the string representation of the object
200
- # @return [String] String presentation of the object
201
- def to_s
202
- to_hash.to_s
203
- end
204
-
205
- # to_body is an alias to to_hash (backward compatibility)
206
- # @return [Hash] Returns the object in the form of hash
207
- def to_body
208
- to_hash
209
- end
210
-
211
162
  # Returns the object in the form of hash
212
163
  # @return [Hash] Returns the object in the form of hash
213
164
  def to_hash
@@ -223,23 +174,5 @@ module Bandwidth
223
174
  end
224
175
  hash
225
176
  end
226
-
227
- # Outputs non-array value in the form of hash
228
- # For object, use to_hash. Otherwise, just return the value
229
- # @param [Object] value Any valid value
230
- # @return [Hash] Returns the value in the form of hash
231
- def _to_hash(value)
232
- if value.is_a?(Array)
233
- value.compact.map { |v| _to_hash(v) }
234
- elsif value.is_a?(Hash)
235
- {}.tap do |hash|
236
- value.each { |k, v| hash[k] = _to_hash(v) }
237
- end
238
- elsif value.respond_to? :to_hash
239
- value.to_hash
240
- else
241
- value
242
- end
243
- end
244
177
  end
245
178
  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 CreateCall
17
+ class CreateCall < ApiModelBase
18
18
  # The destination to call (must be an E.164 formatted number (e.g. `+15555551212`) or a SIP URI (e.g. `sip:user@server.example`)).
19
19
  attr_accessor :to
20
20
 
@@ -123,9 +123,14 @@ module Bandwidth
123
123
  }
124
124
  end
125
125
 
126
+ # Returns attribute mapping this model knows about
127
+ def self.acceptable_attribute_map
128
+ attribute_map
129
+ end
130
+
126
131
  # Returns all the JSON keys this model knows about
127
132
  def self.acceptable_attributes
128
- attribute_map.values
133
+ acceptable_attribute_map.values
129
134
  end
130
135
 
131
136
  # Attribute type mapping.
@@ -185,9 +190,10 @@ module Bandwidth
185
190
  end
186
191
 
187
192
  # check to see if the attribute exists and convert string to symbol for hash key
193
+ acceptable_attribute_map = self.class.acceptable_attribute_map
188
194
  attributes = attributes.each_with_object({}) { |(k, v), h|
189
- if (!self.class.attribute_map.key?(k.to_sym))
190
- fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::CreateCall`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
195
+ if (!acceptable_attribute_map.key?(k.to_sym))
196
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::CreateCall`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
191
197
  end
192
198
  h[k.to_sym] = v
193
199
  }
@@ -407,6 +413,26 @@ module Bandwidth
407
413
  true
408
414
  end
409
415
 
416
+ # Custom attribute writer method with validation
417
+ # @param [Object] to Value to be assigned
418
+ def to=(to)
419
+ if to.nil?
420
+ fail ArgumentError, 'to cannot be nil'
421
+ end
422
+
423
+ @to = to
424
+ end
425
+
426
+ # Custom attribute writer method with validation
427
+ # @param [Object] from Value to be assigned
428
+ def from=(from)
429
+ if from.nil?
430
+ fail ArgumentError, 'from cannot be nil'
431
+ end
432
+
433
+ @from = from
434
+ end
435
+
410
436
  # Custom attribute writer method with validation
411
437
  # @param [Object] display_name Value to be assigned
412
438
  def display_name=(display_name)
@@ -417,6 +443,16 @@ module Bandwidth
417
443
  @display_name = display_name
418
444
  end
419
445
 
446
+ # Custom attribute writer method with validation
447
+ # @param [Object] application_id Value to be assigned
448
+ def application_id=(application_id)
449
+ if application_id.nil?
450
+ fail ArgumentError, 'application_id cannot be nil'
451
+ end
452
+
453
+ @application_id = application_id
454
+ end
455
+
420
456
  # Custom attribute writer method with validation
421
457
  # @param [Object] answer_url Value to be assigned
422
458
  def answer_url=(answer_url)
@@ -606,61 +642,6 @@ module Bandwidth
606
642
  new(transformed_hash)
607
643
  end
608
644
 
609
- # Deserializes the data based on type
610
- # @param string type Data type
611
- # @param string value Value to be deserialized
612
- # @return [Object] Deserialized data
613
- def self._deserialize(type, value)
614
- case type.to_sym
615
- when :Time
616
- Time.parse(value)
617
- when :Date
618
- Date.parse(value)
619
- when :String
620
- value.to_s
621
- when :Integer
622
- value.to_i
623
- when :Float
624
- value.to_f
625
- when :Boolean
626
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
627
- true
628
- else
629
- false
630
- end
631
- when :Object
632
- # generic object (usually a Hash), return directly
633
- value
634
- when /\AArray<(?<inner_type>.+)>\z/
635
- inner_type = Regexp.last_match[:inner_type]
636
- value.map { |v| _deserialize(inner_type, v) }
637
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
638
- k_type = Regexp.last_match[:k_type]
639
- v_type = Regexp.last_match[:v_type]
640
- {}.tap do |hash|
641
- value.each do |k, v|
642
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
643
- end
644
- end
645
- else # model
646
- # models (e.g. Pet) or oneOf
647
- klass = Bandwidth.const_get(type)
648
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
649
- end
650
- end
651
-
652
- # Returns the string representation of the object
653
- # @return [String] String presentation of the object
654
- def to_s
655
- to_hash.to_s
656
- end
657
-
658
- # to_body is an alias to to_hash (backward compatibility)
659
- # @return [Hash] Returns the object in the form of hash
660
- def to_body
661
- to_hash
662
- end
663
-
664
645
  # Returns the object in the form of hash
665
646
  # @return [Hash] Returns the object in the form of hash
666
647
  def to_hash
@@ -676,23 +657,5 @@ module Bandwidth
676
657
  end
677
658
  hash
678
659
  end
679
-
680
- # Outputs non-array value in the form of hash
681
- # For object, use to_hash. Otherwise, just return the value
682
- # @param [Object] value Any valid value
683
- # @return [Hash] Returns the value in the form of hash
684
- def _to_hash(value)
685
- if value.is_a?(Array)
686
- value.compact.map { |v| _to_hash(v) }
687
- elsif value.is_a?(Hash)
688
- {}.tap do |hash|
689
- value.each { |k, v| hash[k] = _to_hash(v) }
690
- end
691
- elsif value.respond_to? :to_hash
692
- value.to_hash
693
- else
694
- value
695
- end
696
- end
697
660
  end
698
661
  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 CreateCallResponse
17
+ class CreateCallResponse < ApiModelBase
18
18
  # The id of the application associated with the `from` number.
19
19
  attr_accessor :application_id
20
20
 
@@ -124,9 +124,14 @@ module Bandwidth
124
124
  }
125
125
  end
126
126
 
127
+ # Returns attribute mapping this model knows about
128
+ def self.acceptable_attribute_map
129
+ attribute_map
130
+ end
131
+
127
132
  # Returns all the JSON keys this model knows about
128
133
  def self.acceptable_attributes
129
- attribute_map.values
134
+ acceptable_attribute_map.values
130
135
  end
131
136
 
132
137
  # Attribute type mapping.
@@ -182,9 +187,10 @@ module Bandwidth
182
187
  end
183
188
 
184
189
  # check to see if the attribute exists and convert string to symbol for hash key
190
+ acceptable_attribute_map = self.class.acceptable_attribute_map
185
191
  attributes = attributes.each_with_object({}) { |(k, v), h|
186
- if (!self.class.attribute_map.key?(k.to_sym))
187
- fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::CreateCallResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
192
+ if (!acceptable_attribute_map.key?(k.to_sym))
193
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::CreateCallResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
188
194
  end
189
195
  h[k.to_sym] = v
190
196
  }
@@ -364,6 +370,76 @@ module Bandwidth
364
370
  true
365
371
  end
366
372
 
373
+ # Custom attribute writer method with validation
374
+ # @param [Object] application_id Value to be assigned
375
+ def application_id=(application_id)
376
+ if application_id.nil?
377
+ fail ArgumentError, 'application_id cannot be nil'
378
+ end
379
+
380
+ @application_id = application_id
381
+ end
382
+
383
+ # Custom attribute writer method with validation
384
+ # @param [Object] account_id Value to be assigned
385
+ def account_id=(account_id)
386
+ if account_id.nil?
387
+ fail ArgumentError, 'account_id cannot be nil'
388
+ end
389
+
390
+ @account_id = account_id
391
+ end
392
+
393
+ # Custom attribute writer method with validation
394
+ # @param [Object] call_id Value to be assigned
395
+ def call_id=(call_id)
396
+ if call_id.nil?
397
+ fail ArgumentError, 'call_id cannot be nil'
398
+ end
399
+
400
+ @call_id = call_id
401
+ end
402
+
403
+ # Custom attribute writer method with validation
404
+ # @param [Object] to Value to be assigned
405
+ def to=(to)
406
+ if to.nil?
407
+ fail ArgumentError, 'to cannot be nil'
408
+ end
409
+
410
+ @to = to
411
+ end
412
+
413
+ # Custom attribute writer method with validation
414
+ # @param [Object] from Value to be assigned
415
+ def from=(from)
416
+ if from.nil?
417
+ fail ArgumentError, 'from cannot be nil'
418
+ end
419
+
420
+ @from = from
421
+ end
422
+
423
+ # Custom attribute writer method with validation
424
+ # @param [Object] call_url Value to be assigned
425
+ def call_url=(call_url)
426
+ if call_url.nil?
427
+ fail ArgumentError, 'call_url cannot be nil'
428
+ end
429
+
430
+ @call_url = call_url
431
+ end
432
+
433
+ # Custom attribute writer method with validation
434
+ # @param [Object] answer_url Value to be assigned
435
+ def answer_url=(answer_url)
436
+ if answer_url.nil?
437
+ fail ArgumentError, 'answer_url cannot be nil'
438
+ end
439
+
440
+ @answer_url = answer_url
441
+ end
442
+
367
443
  # Custom attribute writer method with validation
368
444
  # @param [Object] username Value to be assigned
369
445
  def username=(username)
@@ -467,61 +543,6 @@ module Bandwidth
467
543
  new(transformed_hash)
468
544
  end
469
545
 
470
- # Deserializes the data based on type
471
- # @param string type Data type
472
- # @param string value Value to be deserialized
473
- # @return [Object] Deserialized data
474
- def self._deserialize(type, value)
475
- case type.to_sym
476
- when :Time
477
- Time.parse(value)
478
- when :Date
479
- Date.parse(value)
480
- when :String
481
- value.to_s
482
- when :Integer
483
- value.to_i
484
- when :Float
485
- value.to_f
486
- when :Boolean
487
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
488
- true
489
- else
490
- false
491
- end
492
- when :Object
493
- # generic object (usually a Hash), return directly
494
- value
495
- when /\AArray<(?<inner_type>.+)>\z/
496
- inner_type = Regexp.last_match[:inner_type]
497
- value.map { |v| _deserialize(inner_type, v) }
498
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
499
- k_type = Regexp.last_match[:k_type]
500
- v_type = Regexp.last_match[:v_type]
501
- {}.tap do |hash|
502
- value.each do |k, v|
503
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
504
- end
505
- end
506
- else # model
507
- # models (e.g. Pet) or oneOf
508
- klass = Bandwidth.const_get(type)
509
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
510
- end
511
- end
512
-
513
- # Returns the string representation of the object
514
- # @return [String] String presentation of the object
515
- def to_s
516
- to_hash.to_s
517
- end
518
-
519
- # to_body is an alias to to_hash (backward compatibility)
520
- # @return [Hash] Returns the object in the form of hash
521
- def to_body
522
- to_hash
523
- end
524
-
525
546
  # Returns the object in the form of hash
526
547
  # @return [Hash] Returns the object in the form of hash
527
548
  def to_hash
@@ -537,23 +558,5 @@ module Bandwidth
537
558
  end
538
559
  hash
539
560
  end
540
-
541
- # Outputs non-array value in the form of hash
542
- # For object, use to_hash. Otherwise, just return the value
543
- # @param [Object] value Any valid value
544
- # @return [Hash] Returns the value in the form of hash
545
- def _to_hash(value)
546
- if value.is_a?(Array)
547
- value.compact.map { |v| _to_hash(v) }
548
- elsif value.is_a?(Hash)
549
- {}.tap do |hash|
550
- value.each { |k, v| hash[k] = _to_hash(v) }
551
- end
552
- elsif value.respond_to? :to_hash
553
- value.to_hash
554
- else
555
- value
556
- end
557
- end
558
561
  end
559
562
  end