bandwidth-sdk 17.0.0 → 17.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +3 -3
  3. data/README.md +11 -3
  4. data/bandwidth.yml +78 -22
  5. data/coverage/.last_run.json +1 -1
  6. data/coverage/.resultset.json +115 -96
  7. data/coverage/index.html +660 -390
  8. data/docs/MultiChannelAction.md +32 -81
  9. data/docs/MultiChannelApi.md +1 -1
  10. data/docs/{MultiChannelChannelListObject.md → MultiChannelChannelListMMSObject.md} +3 -3
  11. data/docs/{MultiChannelMessageResponseDataChannelListInner.md → MultiChannelChannelListMMSResponseObject.md} +3 -3
  12. data/docs/MultiChannelChannelListObjectBase.md +22 -0
  13. data/docs/MultiChannelChannelListOwnerObject.md +18 -0
  14. data/docs/MultiChannelChannelListRBMObject.md +24 -0
  15. data/docs/{MultiChannelChannelListObjectContent.md → MultiChannelChannelListRBMObjectAllOfContent.md} +6 -10
  16. data/docs/MultiChannelChannelListRBMResponseObject.md +26 -0
  17. data/docs/MultiChannelChannelListRequestObject.md +24 -0
  18. data/docs/MultiChannelChannelListResponseObject.md +26 -0
  19. data/docs/MultiChannelChannelListSMSObject.md +24 -0
  20. data/docs/MultiChannelChannelListSMSResponseObject.md +26 -0
  21. data/docs/MultiChannelMessageRequest.md +1 -1
  22. data/docs/MultiChannelMessageResponseData.md +1 -1
  23. data/docs/RbmActionBase.md +1 -1
  24. data/docs/RbmSuggestionResponse.md +1 -1
  25. data/lib/bandwidth-sdk/models/multi_channel_action.rb +71 -26
  26. data/lib/bandwidth-sdk/models/{multi_channel_channel_list_object.rb → multi_channel_channel_list_mms_object.rb} +11 -4
  27. data/lib/bandwidth-sdk/models/{multi_channel_message_response_data_channel_list_inner.rb → multi_channel_channel_list_mms_response_object.rb} +6 -5
  28. data/lib/bandwidth-sdk/models/multi_channel_channel_list_object_base.rb +275 -0
  29. data/lib/bandwidth-sdk/models/multi_channel_channel_list_owner_object.rb +220 -0
  30. data/lib/bandwidth-sdk/models/multi_channel_channel_list_rbm_object.rb +298 -0
  31. data/lib/bandwidth-sdk/models/{multi_channel_channel_list_object_content.rb → multi_channel_channel_list_rbm_object_all_of_content.rb} +2 -4
  32. data/lib/bandwidth-sdk/models/multi_channel_channel_list_rbm_response_object.rb +316 -0
  33. data/lib/bandwidth-sdk/models/multi_channel_channel_list_request_object.rb +104 -0
  34. data/lib/bandwidth-sdk/models/multi_channel_channel_list_response_object.rb +104 -0
  35. data/lib/bandwidth-sdk/models/multi_channel_channel_list_sms_object.rb +298 -0
  36. data/lib/bandwidth-sdk/models/multi_channel_channel_list_sms_response_object.rb +316 -0
  37. data/lib/bandwidth-sdk/models/multi_channel_message_request.rb +1 -1
  38. data/lib/bandwidth-sdk/models/multi_channel_message_response_data.rb +1 -1
  39. data/lib/bandwidth-sdk/version.rb +1 -1
  40. data/lib/bandwidth-sdk.rb +11 -3
  41. data/spec/smoke/multi_channel_api_spec.rb +124 -23
  42. data/spec/smoke/phone_number_lookup_api_spec.rb +1 -1
  43. data/spec/unit/api/multi_channel_api_spec.rb +13 -2
  44. metadata +24 -8
@@ -14,7 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Bandwidth
17
- class MultiChannelMessageResponseDataChannelListInner
17
+ class MultiChannelChannelListMMSResponseObject
18
18
  # The sender ID of the message. This could be an alphanumeric sender ID.
19
19
  attr_accessor :from
20
20
 
@@ -72,7 +72,7 @@ module Bandwidth
72
72
  :'from' => :'String',
73
73
  :'application_id' => :'String',
74
74
  :'channel' => :'MultiChannelMessageChannelEnum',
75
- :'content' => :'MultiChannelChannelListObjectContent',
75
+ :'content' => :'MmsMessageContent',
76
76
  :'owner' => :'String'
77
77
  }
78
78
  end
@@ -86,7 +86,8 @@ module Bandwidth
86
86
  # List of class defined in allOf (OpenAPI v3)
87
87
  def self.openapi_all_of
88
88
  [
89
- :'MultiChannelChannelListObject'
89
+ :'MultiChannelChannelListMMSObject',
90
+ :'MultiChannelChannelListOwnerObject'
90
91
  ]
91
92
  end
92
93
 
@@ -94,13 +95,13 @@ module Bandwidth
94
95
  # @param [Hash] attributes Model attributes in the form of hash
95
96
  def initialize(attributes = {})
96
97
  if (!attributes.is_a?(Hash))
97
- fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::MultiChannelMessageResponseDataChannelListInner` initialize method'
98
+ fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::MultiChannelChannelListMMSResponseObject` initialize method'
98
99
  end
99
100
 
100
101
  # check to see if the attribute exists and convert string to symbol for hash key
101
102
  attributes = attributes.each_with_object({}) { |(k, v), h|
102
103
  if (!self.class.attribute_map.key?(k.to_sym))
103
- fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::MultiChannelMessageResponseDataChannelListInner`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
104
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::MultiChannelChannelListMMSResponseObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
104
105
  end
105
106
  h[k.to_sym] = v
106
107
  }
@@ -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
@@ -0,0 +1,220 @@
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 MultiChannelChannelListOwnerObject
18
+ # The Bandwidth senderId associated with the message. Identical to 'from'.
19
+ attr_accessor :owner
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'owner' => :'owner'
25
+ }
26
+ end
27
+
28
+ # Returns all the JSON keys this model knows about
29
+ def self.acceptable_attributes
30
+ attribute_map.values
31
+ end
32
+
33
+ # Attribute type mapping.
34
+ def self.openapi_types
35
+ {
36
+ :'owner' => :'String'
37
+ }
38
+ end
39
+
40
+ # List of attributes with nullable: true
41
+ def self.openapi_nullable
42
+ Set.new([
43
+ ])
44
+ end
45
+
46
+ # Initializes the object
47
+ # @param [Hash] attributes Model attributes in the form of hash
48
+ def initialize(attributes = {})
49
+ if (!attributes.is_a?(Hash))
50
+ fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::MultiChannelChannelListOwnerObject` initialize method'
51
+ end
52
+
53
+ # check to see if the attribute exists and convert string to symbol for hash key
54
+ attributes = attributes.each_with_object({}) { |(k, v), h|
55
+ if (!self.class.attribute_map.key?(k.to_sym))
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
+ end
58
+ h[k.to_sym] = v
59
+ }
60
+
61
+ if attributes.key?(:'owner')
62
+ self.owner = attributes[:'owner']
63
+ else
64
+ self.owner = nil
65
+ end
66
+ end
67
+
68
+ # Show invalid properties with the reasons. Usually used together with valid?
69
+ # @return Array for valid properties with the reasons
70
+ def list_invalid_properties
71
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
72
+ invalid_properties = Array.new
73
+ if @owner.nil?
74
+ invalid_properties.push('invalid value for "owner", owner cannot be nil.')
75
+ end
76
+
77
+ invalid_properties
78
+ end
79
+
80
+ # Check to see if the all the properties in the model are valid
81
+ # @return true if the model is valid
82
+ def valid?
83
+ warn '[DEPRECATED] the `valid?` method is obsolete'
84
+ return false if @owner.nil?
85
+ true
86
+ end
87
+
88
+ # Checks equality by comparing each attribute.
89
+ # @param [Object] Object to be compared
90
+ def ==(o)
91
+ return true if self.equal?(o)
92
+ self.class == o.class &&
93
+ owner == o.owner
94
+ end
95
+
96
+ # @see the `==` method
97
+ # @param [Object] Object to be compared
98
+ def eql?(o)
99
+ self == o
100
+ end
101
+
102
+ # Calculates hash code according to all attributes.
103
+ # @return [Integer] Hash code
104
+ def hash
105
+ [owner].hash
106
+ end
107
+
108
+ # Builds the object from hash
109
+ # @param [Hash] attributes Model attributes in the form of hash
110
+ # @return [Object] Returns the model itself
111
+ def self.build_from_hash(attributes)
112
+ return nil unless attributes.is_a?(Hash)
113
+ attributes = attributes.transform_keys(&:to_sym)
114
+ transformed_hash = {}
115
+ openapi_types.each_pair do |key, type|
116
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
117
+ transformed_hash["#{key}"] = nil
118
+ elsif type =~ /\AArray<(.*)>/i
119
+ # check to ensure the input is an array given that the attribute
120
+ # is documented as an array but the input is not
121
+ if attributes[attribute_map[key]].is_a?(Array)
122
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
123
+ end
124
+ elsif !attributes[attribute_map[key]].nil?
125
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
126
+ end
127
+ end
128
+ new(transformed_hash)
129
+ end
130
+
131
+ # Deserializes the data based on type
132
+ # @param string type Data type
133
+ # @param string value Value to be deserialized
134
+ # @return [Object] Deserialized data
135
+ def self._deserialize(type, value)
136
+ case type.to_sym
137
+ when :Time
138
+ Time.parse(value)
139
+ when :Date
140
+ Date.parse(value)
141
+ when :String
142
+ value.to_s
143
+ when :Integer
144
+ value.to_i
145
+ when :Float
146
+ value.to_f
147
+ when :Boolean
148
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
149
+ true
150
+ else
151
+ false
152
+ end
153
+ when :Object
154
+ # generic object (usually a Hash), return directly
155
+ value
156
+ when /\AArray<(?<inner_type>.+)>\z/
157
+ inner_type = Regexp.last_match[:inner_type]
158
+ value.map { |v| _deserialize(inner_type, v) }
159
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
160
+ k_type = Regexp.last_match[:k_type]
161
+ v_type = Regexp.last_match[:v_type]
162
+ {}.tap do |hash|
163
+ value.each do |k, v|
164
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
165
+ end
166
+ end
167
+ else # model
168
+ # models (e.g. Pet) or oneOf
169
+ klass = Bandwidth.const_get(type)
170
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
171
+ end
172
+ end
173
+
174
+ # Returns the string representation of the object
175
+ # @return [String] String presentation of the object
176
+ def to_s
177
+ to_hash.to_s
178
+ end
179
+
180
+ # to_body is an alias to to_hash (backward compatibility)
181
+ # @return [Hash] Returns the object in the form of hash
182
+ def to_body
183
+ to_hash
184
+ end
185
+
186
+ # Returns the object in the form of hash
187
+ # @return [Hash] Returns the object in the form of hash
188
+ def to_hash
189
+ hash = {}
190
+ self.class.attribute_map.each_pair do |attr, param|
191
+ value = self.send(attr)
192
+ if value.nil?
193
+ is_nullable = self.class.openapi_nullable.include?(attr)
194
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
195
+ end
196
+
197
+ hash[param] = _to_hash(value)
198
+ end
199
+ hash
200
+ end
201
+
202
+ # Outputs non-array value in the form of hash
203
+ # For object, use to_hash. Otherwise, just return the value
204
+ # @param [Object] value Any valid value
205
+ # @return [Hash] Returns the value in the form of hash
206
+ def _to_hash(value)
207
+ if value.is_a?(Array)
208
+ value.compact.map { |v| _to_hash(v) }
209
+ elsif value.is_a?(Hash)
210
+ {}.tap do |hash|
211
+ value.each { |k, v| hash[k] = _to_hash(v) }
212
+ end
213
+ elsif value.respond_to? :to_hash
214
+ value.to_hash
215
+ else
216
+ value
217
+ end
218
+ end
219
+ end
220
+ end