bandwidth-sdk 16.2.2 → 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 (86) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +9 -9
  3. data/README.md +31 -10
  4. data/bandwidth.yml +629 -299
  5. data/coverage/.last_run.json +1 -1
  6. data/coverage/.resultset.json +241 -119
  7. data/coverage/index.html +2752 -1364
  8. data/docs/AsyncLookupRequest.md +18 -0
  9. data/docs/{LookupRequest.md → CompletedLookupStatusEnum.md} +2 -5
  10. data/docs/CreateAsyncBulkLookupResponse.md +22 -0
  11. data/docs/{CreateLookupResponse.md → CreateAsyncBulkLookupResponseData.md} +4 -4
  12. data/docs/CreateSyncLookupResponse.md +22 -0
  13. data/docs/CreateSyncLookupResponseData.md +22 -0
  14. data/docs/DeactivationEventEnum.md +15 -0
  15. data/docs/GetAsyncBulkLookupResponse.md +22 -0
  16. data/docs/GetAsyncBulkLookupResponseData.md +22 -0
  17. data/docs/InProgressLookupStatusEnum.md +15 -0
  18. data/docs/LatestMessageDeliveryStatusEnum.md +15 -0
  19. data/docs/{LookupStatusEnum.md → LineTypeEnum.md} +2 -2
  20. data/docs/LinkSchema.md +22 -0
  21. data/docs/LookupErrorResponse.md +22 -0
  22. data/docs/LookupErrorSchema.md +24 -0
  23. data/docs/LookupErrorSchemaMeta.md +22 -0
  24. data/docs/LookupResult.md +22 -18
  25. data/docs/MultiChannelAction.md +32 -81
  26. data/docs/MultiChannelApi.md +1 -1
  27. data/docs/{MultiChannelChannelListObject.md → MultiChannelChannelListMMSObject.md} +3 -3
  28. data/docs/{MultiChannelMessageResponseDataChannelListInner.md → MultiChannelChannelListMMSResponseObject.md} +3 -3
  29. data/docs/MultiChannelChannelListObjectBase.md +22 -0
  30. data/docs/MultiChannelChannelListOwnerObject.md +18 -0
  31. data/docs/MultiChannelChannelListRBMObject.md +24 -0
  32. data/docs/{MultiChannelChannelListObjectContent.md → MultiChannelChannelListRBMObjectAllOfContent.md} +6 -10
  33. data/docs/MultiChannelChannelListRBMResponseObject.md +26 -0
  34. data/docs/MultiChannelChannelListRequestObject.md +24 -0
  35. data/docs/MultiChannelChannelListResponseObject.md +26 -0
  36. data/docs/MultiChannelChannelListSMSObject.md +24 -0
  37. data/docs/MultiChannelChannelListSMSResponseObject.md +26 -0
  38. data/docs/MultiChannelMessageRequest.md +1 -1
  39. data/docs/MultiChannelMessageResponseData.md +1 -1
  40. data/docs/PhoneNumberLookupApi.md +111 -38
  41. data/docs/RbmActionBase.md +1 -1
  42. data/docs/RbmSuggestionResponse.md +1 -1
  43. data/docs/SyncLookupRequest.md +18 -0
  44. data/lib/bandwidth-sdk/api/phone_number_lookup_api.rb +117 -47
  45. data/lib/bandwidth-sdk/configuration.rb +10 -4
  46. data/lib/bandwidth-sdk/models/async_lookup_request.rb +232 -0
  47. data/lib/bandwidth-sdk/models/completed_lookup_status_enum.rb +41 -0
  48. data/lib/bandwidth-sdk/models/create_async_bulk_lookup_response.rb +235 -0
  49. data/lib/bandwidth-sdk/models/{create_lookup_response.rb → create_async_bulk_lookup_response_data.rb} +5 -5
  50. data/lib/bandwidth-sdk/models/create_sync_lookup_response.rb +234 -0
  51. data/lib/bandwidth-sdk/models/{lookup_status.rb → create_sync_lookup_response_data.rb} +15 -27
  52. data/lib/bandwidth-sdk/models/deactivation_event_enum.rb +39 -0
  53. data/lib/bandwidth-sdk/models/get_async_bulk_lookup_response.rb +234 -0
  54. data/lib/bandwidth-sdk/models/get_async_bulk_lookup_response_data.rb +257 -0
  55. data/lib/bandwidth-sdk/models/{lookup_status_enum.rb → in_progress_lookup_status_enum.rb} +3 -3
  56. data/lib/bandwidth-sdk/models/latest_message_delivery_status_enum.rb +41 -0
  57. data/lib/bandwidth-sdk/models/line_type_enum.rb +42 -0
  58. data/lib/bandwidth-sdk/models/{tn_lookup_request_error.rb → link_schema.rb} +31 -11
  59. data/lib/bandwidth-sdk/models/lookup_error_response.rb +235 -0
  60. data/lib/bandwidth-sdk/models/lookup_error_schema.rb +242 -0
  61. data/lib/bandwidth-sdk/models/lookup_error_schema_meta.rb +234 -0
  62. data/lib/bandwidth-sdk/models/lookup_result.rb +102 -63
  63. data/lib/bandwidth-sdk/models/multi_channel_action.rb +71 -26
  64. data/lib/bandwidth-sdk/models/{multi_channel_channel_list_object.rb → multi_channel_channel_list_mms_object.rb} +11 -4
  65. data/lib/bandwidth-sdk/models/{multi_channel_message_response_data_channel_list_inner.rb → multi_channel_channel_list_mms_response_object.rb} +6 -5
  66. data/lib/bandwidth-sdk/models/multi_channel_channel_list_object_base.rb +275 -0
  67. data/lib/bandwidth-sdk/models/{lookup_request.rb → multi_channel_channel_list_owner_object.rb} +15 -17
  68. data/lib/bandwidth-sdk/models/multi_channel_channel_list_rbm_object.rb +298 -0
  69. data/lib/bandwidth-sdk/models/{multi_channel_channel_list_object_content.rb → multi_channel_channel_list_rbm_object_all_of_content.rb} +2 -4
  70. data/lib/bandwidth-sdk/models/multi_channel_channel_list_rbm_response_object.rb +316 -0
  71. data/lib/bandwidth-sdk/models/multi_channel_channel_list_request_object.rb +104 -0
  72. data/lib/bandwidth-sdk/models/multi_channel_channel_list_response_object.rb +104 -0
  73. data/lib/bandwidth-sdk/models/multi_channel_channel_list_sms_object.rb +298 -0
  74. data/lib/bandwidth-sdk/models/multi_channel_channel_list_sms_response_object.rb +316 -0
  75. data/lib/bandwidth-sdk/models/multi_channel_message_request.rb +1 -1
  76. data/lib/bandwidth-sdk/models/multi_channel_message_response_data.rb +1 -1
  77. data/lib/bandwidth-sdk/models/sync_lookup_request.rb +232 -0
  78. data/lib/bandwidth-sdk/version.rb +1 -1
  79. data/lib/bandwidth-sdk.rb +28 -8
  80. data/spec/smoke/multi_channel_api_spec.rb +125 -24
  81. data/spec/smoke/phone_number_lookup_api_spec.rb +65 -70
  82. data/spec/unit/api/multi_channel_api_spec.rb +13 -2
  83. data/spec/unit/api/phone_number_lookup_api_spec.rb +71 -56
  84. metadata +58 -18
  85. data/docs/LookupStatus.md +0 -24
  86. data/docs/TnLookupRequestError.md +0 -18
@@ -0,0 +1,275 @@
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.8.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Bandwidth
17
+ class MultiChannelChannelListObjectBase
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
+ class EnumAttributeValidator
27
+ attr_reader :datatype
28
+ attr_reader :allowable_values
29
+
30
+ def initialize(datatype, allowable_values)
31
+ @allowable_values = allowable_values.map do |value|
32
+ case datatype.to_s
33
+ when /Integer/i
34
+ value.to_i
35
+ when /Float/i
36
+ value.to_f
37
+ else
38
+ value
39
+ end
40
+ end
41
+ end
42
+
43
+ def valid?(value)
44
+ !value || allowable_values.include?(value)
45
+ end
46
+ end
47
+
48
+ # Attribute mapping from ruby-style variable name to JSON key.
49
+ def self.attribute_map
50
+ {
51
+ :'from' => :'from',
52
+ :'application_id' => :'applicationId',
53
+ :'channel' => :'channel'
54
+ }
55
+ end
56
+
57
+ # Returns all the JSON keys this model knows about
58
+ def self.acceptable_attributes
59
+ attribute_map.values
60
+ end
61
+
62
+ # Attribute type mapping.
63
+ def self.openapi_types
64
+ {
65
+ :'from' => :'String',
66
+ :'application_id' => :'String',
67
+ :'channel' => :'MultiChannelMessageChannelEnum'
68
+ }
69
+ end
70
+
71
+ # List of attributes with nullable: true
72
+ def self.openapi_nullable
73
+ Set.new([
74
+ ])
75
+ end
76
+
77
+ # Initializes the object
78
+ # @param [Hash] attributes Model attributes in the form of hash
79
+ def initialize(attributes = {})
80
+ if (!attributes.is_a?(Hash))
81
+ fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::MultiChannelChannelListObjectBase` initialize method'
82
+ end
83
+
84
+ # check to see if the attribute exists and convert string to symbol for hash key
85
+ attributes = attributes.each_with_object({}) { |(k, v), h|
86
+ if (!self.class.attribute_map.key?(k.to_sym))
87
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::MultiChannelChannelListObjectBase`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
88
+ end
89
+ h[k.to_sym] = v
90
+ }
91
+
92
+ if attributes.key?(:'from')
93
+ self.from = attributes[:'from']
94
+ else
95
+ self.from = nil
96
+ end
97
+
98
+ if attributes.key?(:'application_id')
99
+ self.application_id = attributes[:'application_id']
100
+ else
101
+ self.application_id = nil
102
+ end
103
+
104
+ if attributes.key?(:'channel')
105
+ self.channel = attributes[:'channel']
106
+ else
107
+ self.channel = nil
108
+ end
109
+ end
110
+
111
+ # Show invalid properties with the reasons. Usually used together with valid?
112
+ # @return Array for valid properties with the reasons
113
+ def list_invalid_properties
114
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
115
+ invalid_properties = Array.new
116
+ if @from.nil?
117
+ invalid_properties.push('invalid value for "from", from cannot be nil.')
118
+ end
119
+
120
+ if @application_id.nil?
121
+ invalid_properties.push('invalid value for "application_id", application_id cannot be nil.')
122
+ end
123
+
124
+ if @channel.nil?
125
+ invalid_properties.push('invalid value for "channel", channel cannot be nil.')
126
+ end
127
+
128
+ invalid_properties
129
+ end
130
+
131
+ # Check to see if the all the properties in the model are valid
132
+ # @return true if the model is valid
133
+ def valid?
134
+ warn '[DEPRECATED] the `valid?` method is obsolete'
135
+ return false if @from.nil?
136
+ return false if @application_id.nil?
137
+ return false if @channel.nil?
138
+ true
139
+ end
140
+
141
+ # Checks equality by comparing each attribute.
142
+ # @param [Object] Object to be compared
143
+ def ==(o)
144
+ return true if self.equal?(o)
145
+ self.class == o.class &&
146
+ from == o.from &&
147
+ application_id == o.application_id &&
148
+ channel == o.channel
149
+ end
150
+
151
+ # @see the `==` method
152
+ # @param [Object] Object to be compared
153
+ def eql?(o)
154
+ self == o
155
+ end
156
+
157
+ # Calculates hash code according to all attributes.
158
+ # @return [Integer] Hash code
159
+ def hash
160
+ [from, application_id, channel].hash
161
+ end
162
+
163
+ # Builds the object from hash
164
+ # @param [Hash] attributes Model attributes in the form of hash
165
+ # @return [Object] Returns the model itself
166
+ def self.build_from_hash(attributes)
167
+ return nil unless attributes.is_a?(Hash)
168
+ attributes = attributes.transform_keys(&:to_sym)
169
+ transformed_hash = {}
170
+ openapi_types.each_pair do |key, type|
171
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
172
+ transformed_hash["#{key}"] = nil
173
+ elsif type =~ /\AArray<(.*)>/i
174
+ # check to ensure the input is an array given that the attribute
175
+ # is documented as an array but the input is not
176
+ if attributes[attribute_map[key]].is_a?(Array)
177
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
178
+ end
179
+ elsif !attributes[attribute_map[key]].nil?
180
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
181
+ end
182
+ end
183
+ new(transformed_hash)
184
+ end
185
+
186
+ # Deserializes the data based on type
187
+ # @param string type Data type
188
+ # @param string value Value to be deserialized
189
+ # @return [Object] Deserialized data
190
+ def self._deserialize(type, value)
191
+ case type.to_sym
192
+ when :Time
193
+ Time.parse(value)
194
+ when :Date
195
+ Date.parse(value)
196
+ when :String
197
+ value.to_s
198
+ when :Integer
199
+ value.to_i
200
+ when :Float
201
+ value.to_f
202
+ when :Boolean
203
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
204
+ true
205
+ else
206
+ false
207
+ end
208
+ when :Object
209
+ # generic object (usually a Hash), return directly
210
+ value
211
+ when /\AArray<(?<inner_type>.+)>\z/
212
+ inner_type = Regexp.last_match[:inner_type]
213
+ value.map { |v| _deserialize(inner_type, v) }
214
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
215
+ k_type = Regexp.last_match[:k_type]
216
+ v_type = Regexp.last_match[:v_type]
217
+ {}.tap do |hash|
218
+ value.each do |k, v|
219
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
220
+ end
221
+ end
222
+ else # model
223
+ # models (e.g. Pet) or oneOf
224
+ klass = Bandwidth.const_get(type)
225
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
226
+ end
227
+ end
228
+
229
+ # Returns the string representation of the object
230
+ # @return [String] String presentation of the object
231
+ def to_s
232
+ to_hash.to_s
233
+ end
234
+
235
+ # to_body is an alias to to_hash (backward compatibility)
236
+ # @return [Hash] Returns the object in the form of hash
237
+ def to_body
238
+ to_hash
239
+ end
240
+
241
+ # Returns the object in the form of hash
242
+ # @return [Hash] Returns the object in the form of hash
243
+ def to_hash
244
+ hash = {}
245
+ self.class.attribute_map.each_pair do |attr, param|
246
+ value = self.send(attr)
247
+ if value.nil?
248
+ is_nullable = self.class.openapi_nullable.include?(attr)
249
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
250
+ end
251
+
252
+ hash[param] = _to_hash(value)
253
+ end
254
+ hash
255
+ end
256
+
257
+ # Outputs non-array value in the form of hash
258
+ # For object, use to_hash. Otherwise, just return the value
259
+ # @param [Object] value Any valid value
260
+ # @return [Hash] Returns the value in the form of hash
261
+ def _to_hash(value)
262
+ if value.is_a?(Array)
263
+ value.compact.map { |v| _to_hash(v) }
264
+ elsif value.is_a?(Hash)
265
+ {}.tap do |hash|
266
+ value.each { |k, v| hash[k] = _to_hash(v) }
267
+ end
268
+ elsif value.respond_to? :to_hash
269
+ value.to_hash
270
+ else
271
+ value
272
+ end
273
+ end
274
+ end
275
+ end
@@ -14,14 +14,14 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Bandwidth
17
- # Create phone number lookup request.
18
- class LookupRequest
19
- attr_accessor :tns
17
+ class MultiChannelChannelListOwnerObject
18
+ # The Bandwidth senderId associated with the message. Identical to 'from'.
19
+ attr_accessor :owner
20
20
 
21
21
  # Attribute mapping from ruby-style variable name to JSON key.
22
22
  def self.attribute_map
23
23
  {
24
- :'tns' => :'tns'
24
+ :'owner' => :'owner'
25
25
  }
26
26
  end
27
27
 
@@ -33,7 +33,7 @@ module Bandwidth
33
33
  # Attribute type mapping.
34
34
  def self.openapi_types
35
35
  {
36
- :'tns' => :'Array<String>'
36
+ :'owner' => :'String'
37
37
  }
38
38
  end
39
39
 
@@ -47,23 +47,21 @@ module Bandwidth
47
47
  # @param [Hash] attributes Model attributes in the form of hash
48
48
  def initialize(attributes = {})
49
49
  if (!attributes.is_a?(Hash))
50
- fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::LookupRequest` initialize method'
50
+ fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::MultiChannelChannelListOwnerObject` initialize method'
51
51
  end
52
52
 
53
53
  # check to see if the attribute exists and convert string to symbol for hash key
54
54
  attributes = attributes.each_with_object({}) { |(k, v), h|
55
55
  if (!self.class.attribute_map.key?(k.to_sym))
56
- fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::LookupRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
56
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::MultiChannelChannelListOwnerObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
57
57
  end
58
58
  h[k.to_sym] = v
59
59
  }
60
60
 
61
- if attributes.key?(:'tns')
62
- if (value = attributes[:'tns']).is_a?(Array)
63
- self.tns = value
64
- end
61
+ if attributes.key?(:'owner')
62
+ self.owner = attributes[:'owner']
65
63
  else
66
- self.tns = nil
64
+ self.owner = nil
67
65
  end
68
66
  end
69
67
 
@@ -72,8 +70,8 @@ module Bandwidth
72
70
  def list_invalid_properties
73
71
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
74
72
  invalid_properties = Array.new
75
- if @tns.nil?
76
- invalid_properties.push('invalid value for "tns", tns cannot be nil.')
73
+ if @owner.nil?
74
+ invalid_properties.push('invalid value for "owner", owner cannot be nil.')
77
75
  end
78
76
 
79
77
  invalid_properties
@@ -83,7 +81,7 @@ module Bandwidth
83
81
  # @return true if the model is valid
84
82
  def valid?
85
83
  warn '[DEPRECATED] the `valid?` method is obsolete'
86
- return false if @tns.nil?
84
+ return false if @owner.nil?
87
85
  true
88
86
  end
89
87
 
@@ -92,7 +90,7 @@ module Bandwidth
92
90
  def ==(o)
93
91
  return true if self.equal?(o)
94
92
  self.class == o.class &&
95
- tns == o.tns
93
+ owner == o.owner
96
94
  end
97
95
 
98
96
  # @see the `==` method
@@ -104,7 +102,7 @@ module Bandwidth
104
102
  # Calculates hash code according to all attributes.
105
103
  # @return [Integer] Hash code
106
104
  def hash
107
- [tns].hash
105
+ [owner].hash
108
106
  end
109
107
 
110
108
  # Builds the object from hash
@@ -0,0 +1,298 @@
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.8.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Bandwidth
17
+ class MultiChannelChannelListRBMObject
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
+ class EnumAttributeValidator
29
+ attr_reader :datatype
30
+ attr_reader :allowable_values
31
+
32
+ def initialize(datatype, allowable_values)
33
+ @allowable_values = allowable_values.map do |value|
34
+ case datatype.to_s
35
+ when /Integer/i
36
+ value.to_i
37
+ when /Float/i
38
+ value.to_f
39
+ else
40
+ value
41
+ end
42
+ end
43
+ end
44
+
45
+ def valid?(value)
46
+ !value || allowable_values.include?(value)
47
+ end
48
+ end
49
+
50
+ # Attribute mapping from ruby-style variable name to JSON key.
51
+ def self.attribute_map
52
+ {
53
+ :'from' => :'from',
54
+ :'application_id' => :'applicationId',
55
+ :'channel' => :'channel',
56
+ :'content' => :'content'
57
+ }
58
+ end
59
+
60
+ # Returns all the JSON keys this model knows about
61
+ def self.acceptable_attributes
62
+ attribute_map.values
63
+ end
64
+
65
+ # Attribute type mapping.
66
+ def self.openapi_types
67
+ {
68
+ :'from' => :'String',
69
+ :'application_id' => :'String',
70
+ :'channel' => :'MultiChannelMessageChannelEnum',
71
+ :'content' => :'MultiChannelChannelListRBMObjectAllOfContent'
72
+ }
73
+ end
74
+
75
+ # List of attributes with nullable: true
76
+ def self.openapi_nullable
77
+ Set.new([
78
+ ])
79
+ end
80
+
81
+ # List of class defined in allOf (OpenAPI v3)
82
+ def self.openapi_all_of
83
+ [
84
+ :'MultiChannelChannelListObjectBase'
85
+ ]
86
+ end
87
+
88
+ # Initializes the object
89
+ # @param [Hash] attributes Model attributes in the form of hash
90
+ def initialize(attributes = {})
91
+ if (!attributes.is_a?(Hash))
92
+ fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::MultiChannelChannelListRBMObject` initialize method'
93
+ end
94
+
95
+ # check to see if the attribute exists and convert string to symbol for hash key
96
+ attributes = attributes.each_with_object({}) { |(k, v), h|
97
+ if (!self.class.attribute_map.key?(k.to_sym))
98
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::MultiChannelChannelListRBMObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
99
+ end
100
+ h[k.to_sym] = v
101
+ }
102
+
103
+ if attributes.key?(:'from')
104
+ self.from = attributes[:'from']
105
+ else
106
+ self.from = nil
107
+ end
108
+
109
+ if attributes.key?(:'application_id')
110
+ self.application_id = attributes[:'application_id']
111
+ else
112
+ self.application_id = nil
113
+ end
114
+
115
+ if attributes.key?(:'channel')
116
+ self.channel = attributes[:'channel']
117
+ else
118
+ self.channel = nil
119
+ end
120
+
121
+ if attributes.key?(:'content')
122
+ self.content = attributes[:'content']
123
+ else
124
+ self.content = nil
125
+ end
126
+ end
127
+
128
+ # Show invalid properties with the reasons. Usually used together with valid?
129
+ # @return Array for valid properties with the reasons
130
+ def list_invalid_properties
131
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
132
+ invalid_properties = Array.new
133
+ if @from.nil?
134
+ invalid_properties.push('invalid value for "from", from cannot be nil.')
135
+ end
136
+
137
+ if @application_id.nil?
138
+ invalid_properties.push('invalid value for "application_id", application_id cannot be nil.')
139
+ end
140
+
141
+ if @channel.nil?
142
+ invalid_properties.push('invalid value for "channel", channel cannot be nil.')
143
+ end
144
+
145
+ if @content.nil?
146
+ invalid_properties.push('invalid value for "content", content cannot be nil.')
147
+ end
148
+
149
+ invalid_properties
150
+ end
151
+
152
+ # Check to see if the all the properties in the model are valid
153
+ # @return true if the model is valid
154
+ def valid?
155
+ warn '[DEPRECATED] the `valid?` method is obsolete'
156
+ return false if @from.nil?
157
+ return false if @application_id.nil?
158
+ return false if @channel.nil?
159
+ return false if @content.nil?
160
+ true
161
+ end
162
+
163
+ # Checks equality by comparing each attribute.
164
+ # @param [Object] Object to be compared
165
+ def ==(o)
166
+ return true if self.equal?(o)
167
+ self.class == o.class &&
168
+ from == o.from &&
169
+ application_id == o.application_id &&
170
+ channel == o.channel &&
171
+ content == o.content
172
+ end
173
+
174
+ # @see the `==` method
175
+ # @param [Object] Object to be compared
176
+ def eql?(o)
177
+ self == o
178
+ end
179
+
180
+ # Calculates hash code according to all attributes.
181
+ # @return [Integer] Hash code
182
+ def hash
183
+ [from, application_id, channel, content].hash
184
+ end
185
+
186
+ # Builds the object from hash
187
+ # @param [Hash] attributes Model attributes in the form of hash
188
+ # @return [Object] Returns the model itself
189
+ def self.build_from_hash(attributes)
190
+ return nil unless attributes.is_a?(Hash)
191
+ attributes = attributes.transform_keys(&:to_sym)
192
+ transformed_hash = {}
193
+ openapi_types.each_pair do |key, type|
194
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
195
+ transformed_hash["#{key}"] = nil
196
+ elsif type =~ /\AArray<(.*)>/i
197
+ # check to ensure the input is an array given that the attribute
198
+ # is documented as an array but the input is not
199
+ if attributes[attribute_map[key]].is_a?(Array)
200
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
201
+ end
202
+ elsif !attributes[attribute_map[key]].nil?
203
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
204
+ end
205
+ end
206
+ new(transformed_hash)
207
+ end
208
+
209
+ # Deserializes the data based on type
210
+ # @param string type Data type
211
+ # @param string value Value to be deserialized
212
+ # @return [Object] Deserialized data
213
+ def self._deserialize(type, value)
214
+ case type.to_sym
215
+ when :Time
216
+ Time.parse(value)
217
+ when :Date
218
+ Date.parse(value)
219
+ when :String
220
+ value.to_s
221
+ when :Integer
222
+ value.to_i
223
+ when :Float
224
+ value.to_f
225
+ when :Boolean
226
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
227
+ true
228
+ else
229
+ false
230
+ end
231
+ when :Object
232
+ # generic object (usually a Hash), return directly
233
+ value
234
+ when /\AArray<(?<inner_type>.+)>\z/
235
+ inner_type = Regexp.last_match[:inner_type]
236
+ value.map { |v| _deserialize(inner_type, v) }
237
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
238
+ k_type = Regexp.last_match[:k_type]
239
+ v_type = Regexp.last_match[:v_type]
240
+ {}.tap do |hash|
241
+ value.each do |k, v|
242
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
243
+ end
244
+ end
245
+ else # model
246
+ # models (e.g. Pet) or oneOf
247
+ klass = Bandwidth.const_get(type)
248
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
249
+ end
250
+ end
251
+
252
+ # Returns the string representation of the object
253
+ # @return [String] String presentation of the object
254
+ def to_s
255
+ to_hash.to_s
256
+ end
257
+
258
+ # to_body is an alias to to_hash (backward compatibility)
259
+ # @return [Hash] Returns the object in the form of hash
260
+ def to_body
261
+ to_hash
262
+ end
263
+
264
+ # Returns the object in the form of hash
265
+ # @return [Hash] Returns the object in the form of hash
266
+ def to_hash
267
+ hash = {}
268
+ self.class.attribute_map.each_pair do |attr, param|
269
+ value = self.send(attr)
270
+ if value.nil?
271
+ is_nullable = self.class.openapi_nullable.include?(attr)
272
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
273
+ end
274
+
275
+ hash[param] = _to_hash(value)
276
+ end
277
+ hash
278
+ end
279
+
280
+ # Outputs non-array value in the form of hash
281
+ # For object, use to_hash. Otherwise, just return the value
282
+ # @param [Object] value Any valid value
283
+ # @return [Hash] Returns the value in the form of hash
284
+ def _to_hash(value)
285
+ if value.is_a?(Array)
286
+ value.compact.map { |v| _to_hash(v) }
287
+ elsif value.is_a?(Hash)
288
+ {}.tap do |hash|
289
+ value.each { |k, v| hash[k] = _to_hash(v) }
290
+ end
291
+ elsif value.respond_to? :to_hash
292
+ value.to_hash
293
+ else
294
+ value
295
+ end
296
+ end
297
+ end
298
+ end
@@ -15,16 +15,14 @@ require 'time'
15
15
 
16
16
  module Bandwidth
17
17
  # The content of the message.
18
- module MultiChannelChannelListObjectContent
18
+ module MultiChannelChannelListRBMObjectAllOfContent
19
19
  class << self
20
20
  # List of class defined in oneOf (OpenAPI v3)
21
21
  def openapi_one_of
22
22
  [
23
- :'MmsMessageContent',
24
23
  :'RbmMessageContentRichCard',
25
24
  :'RbmMessageContentText',
26
- :'RbmMessageMedia',
27
- :'SmsMessageContent'
25
+ :'RbmMessageMedia'
28
26
  ]
29
27
  end
30
28