bandwidth-sdk 16.2.2 → 17.0.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 (56) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +8 -8
  3. data/README.md +20 -7
  4. data/bandwidth.yml +551 -277
  5. data/coverage/.last_run.json +1 -1
  6. data/coverage/.resultset.json +197 -94
  7. data/coverage/index.html +2425 -1307
  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/PhoneNumberLookupApi.md +111 -38
  26. data/docs/RbmActionBase.md +1 -1
  27. data/docs/RbmSuggestionResponse.md +1 -1
  28. data/docs/SyncLookupRequest.md +18 -0
  29. data/lib/bandwidth-sdk/api/phone_number_lookup_api.rb +117 -47
  30. data/lib/bandwidth-sdk/configuration.rb +10 -4
  31. data/lib/bandwidth-sdk/models/async_lookup_request.rb +232 -0
  32. data/lib/bandwidth-sdk/models/completed_lookup_status_enum.rb +41 -0
  33. data/lib/bandwidth-sdk/models/create_async_bulk_lookup_response.rb +235 -0
  34. data/lib/bandwidth-sdk/models/{create_lookup_response.rb → create_async_bulk_lookup_response_data.rb} +5 -5
  35. data/lib/bandwidth-sdk/models/create_sync_lookup_response.rb +234 -0
  36. data/lib/bandwidth-sdk/models/{lookup_status.rb → create_sync_lookup_response_data.rb} +15 -27
  37. data/lib/bandwidth-sdk/models/deactivation_event_enum.rb +39 -0
  38. data/lib/bandwidth-sdk/models/get_async_bulk_lookup_response.rb +234 -0
  39. data/lib/bandwidth-sdk/models/get_async_bulk_lookup_response_data.rb +257 -0
  40. data/lib/bandwidth-sdk/models/{lookup_status_enum.rb → in_progress_lookup_status_enum.rb} +3 -3
  41. data/lib/bandwidth-sdk/models/latest_message_delivery_status_enum.rb +41 -0
  42. data/lib/bandwidth-sdk/models/line_type_enum.rb +42 -0
  43. data/lib/bandwidth-sdk/models/{lookup_request.rb → link_schema.rb} +31 -20
  44. data/lib/bandwidth-sdk/models/lookup_error_response.rb +235 -0
  45. data/lib/bandwidth-sdk/models/lookup_error_schema.rb +242 -0
  46. data/lib/bandwidth-sdk/models/{tn_lookup_request_error.rb → lookup_error_schema_meta.rb} +29 -8
  47. data/lib/bandwidth-sdk/models/lookup_result.rb +102 -63
  48. data/lib/bandwidth-sdk/models/sync_lookup_request.rb +232 -0
  49. data/lib/bandwidth-sdk/version.rb +1 -1
  50. data/lib/bandwidth-sdk.rb +17 -5
  51. data/spec/smoke/multi_channel_api_spec.rb +1 -1
  52. data/spec/smoke/phone_number_lookup_api_spec.rb +65 -70
  53. data/spec/unit/api/phone_number_lookup_api_spec.rb +71 -56
  54. metadata +36 -12
  55. data/docs/LookupStatus.md +0 -24
  56. data/docs/TnLookupRequestError.md +0 -18
@@ -0,0 +1,235 @@
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 CreateAsyncBulkLookupResponse
18
+ # Links for pagination (if applicable)
19
+ attr_accessor :links
20
+
21
+ attr_accessor :data
22
+
23
+ attr_accessor :errors
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+ :'links' => :'links',
29
+ :'data' => :'data',
30
+ :'errors' => :'errors'
31
+ }
32
+ end
33
+
34
+ # Returns all the JSON keys this model knows about
35
+ def self.acceptable_attributes
36
+ attribute_map.values
37
+ end
38
+
39
+ # Attribute type mapping.
40
+ def self.openapi_types
41
+ {
42
+ :'links' => :'Array<LinkSchema>',
43
+ :'data' => :'CreateAsyncBulkLookupResponseData',
44
+ :'errors' => :'Array<LookupErrorSchema>'
45
+ }
46
+ end
47
+
48
+ # List of attributes with nullable: true
49
+ def self.openapi_nullable
50
+ Set.new([
51
+ ])
52
+ end
53
+
54
+ # Initializes the object
55
+ # @param [Hash] attributes Model attributes in the form of hash
56
+ def initialize(attributes = {})
57
+ if (!attributes.is_a?(Hash))
58
+ fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::CreateAsyncBulkLookupResponse` initialize method'
59
+ end
60
+
61
+ # check to see if the attribute exists and convert string to symbol for hash key
62
+ 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
65
+ end
66
+ h[k.to_sym] = v
67
+ }
68
+
69
+ if attributes.key?(:'links')
70
+ if (value = attributes[:'links']).is_a?(Array)
71
+ self.links = value
72
+ end
73
+ end
74
+
75
+ if attributes.key?(:'data')
76
+ self.data = attributes[:'data']
77
+ end
78
+
79
+ if attributes.key?(:'errors')
80
+ if (value = attributes[:'errors']).is_a?(Array)
81
+ self.errors = value
82
+ end
83
+ end
84
+ end
85
+
86
+ # Show invalid properties with the reasons. Usually used together with valid?
87
+ # @return Array for valid properties with the reasons
88
+ def list_invalid_properties
89
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
90
+ invalid_properties = Array.new
91
+ invalid_properties
92
+ end
93
+
94
+ # Check to see if the all the properties in the model are valid
95
+ # @return true if the model is valid
96
+ def valid?
97
+ warn '[DEPRECATED] the `valid?` method is obsolete'
98
+ true
99
+ end
100
+
101
+ # Checks equality by comparing each attribute.
102
+ # @param [Object] Object to be compared
103
+ def ==(o)
104
+ return true if self.equal?(o)
105
+ self.class == o.class &&
106
+ links == o.links &&
107
+ data == o.data &&
108
+ errors == o.errors
109
+ end
110
+
111
+ # @see the `==` method
112
+ # @param [Object] Object to be compared
113
+ def eql?(o)
114
+ self == o
115
+ end
116
+
117
+ # Calculates hash code according to all attributes.
118
+ # @return [Integer] Hash code
119
+ def hash
120
+ [links, data, errors].hash
121
+ end
122
+
123
+ # Builds the object from hash
124
+ # @param [Hash] attributes Model attributes in the form of hash
125
+ # @return [Object] Returns the model itself
126
+ def self.build_from_hash(attributes)
127
+ return nil unless attributes.is_a?(Hash)
128
+ attributes = attributes.transform_keys(&:to_sym)
129
+ transformed_hash = {}
130
+ openapi_types.each_pair do |key, type|
131
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
132
+ transformed_hash["#{key}"] = nil
133
+ elsif type =~ /\AArray<(.*)>/i
134
+ # check to ensure the input is an array given that the attribute
135
+ # is documented as an array but the input is not
136
+ if attributes[attribute_map[key]].is_a?(Array)
137
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
138
+ end
139
+ elsif !attributes[attribute_map[key]].nil?
140
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
141
+ end
142
+ end
143
+ new(transformed_hash)
144
+ end
145
+
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
+ # Returns the object in the form of hash
202
+ # @return [Hash] Returns the object in the form of hash
203
+ def to_hash
204
+ hash = {}
205
+ self.class.attribute_map.each_pair do |attr, param|
206
+ value = self.send(attr)
207
+ if value.nil?
208
+ is_nullable = self.class.openapi_nullable.include?(attr)
209
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
210
+ end
211
+
212
+ hash[param] = _to_hash(value)
213
+ end
214
+ hash
215
+ 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
+ end
235
+ end
@@ -14,8 +14,8 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Bandwidth
17
- # The request has been accepted for processing but not yet finished and in a terminal state (COMPLETE, PARTIAL_COMPLETE, or FAILED).
18
- class CreateLookupResponse
17
+ # The phone number lookup response data
18
+ class CreateAsyncBulkLookupResponseData
19
19
  # The phone number lookup request ID from Bandwidth.
20
20
  attr_accessor :request_id
21
21
 
@@ -60,7 +60,7 @@ module Bandwidth
60
60
  def self.openapi_types
61
61
  {
62
62
  :'request_id' => :'String',
63
- :'status' => :'LookupStatusEnum'
63
+ :'status' => :'InProgressLookupStatusEnum'
64
64
  }
65
65
  end
66
66
 
@@ -74,13 +74,13 @@ module Bandwidth
74
74
  # @param [Hash] attributes Model attributes in the form of hash
75
75
  def initialize(attributes = {})
76
76
  if (!attributes.is_a?(Hash))
77
- fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::CreateLookupResponse` initialize method'
77
+ fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::CreateAsyncBulkLookupResponseData` initialize method'
78
78
  end
79
79
 
80
80
  # check to see if the attribute exists and convert string to symbol for hash key
81
81
  attributes = attributes.each_with_object({}) { |(k, v), h|
82
82
  if (!self.class.attribute_map.key?(k.to_sym))
83
- fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::CreateLookupResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
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
84
84
  end
85
85
  h[k.to_sym] = v
86
86
  }
@@ -0,0 +1,234 @@
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 CreateSyncLookupResponse
18
+ attr_accessor :links
19
+
20
+ attr_accessor :data
21
+
22
+ attr_accessor :errors
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'links' => :'links',
28
+ :'data' => :'data',
29
+ :'errors' => :'errors'
30
+ }
31
+ end
32
+
33
+ # Returns all the JSON keys this model knows about
34
+ def self.acceptable_attributes
35
+ attribute_map.values
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.openapi_types
40
+ {
41
+ :'links' => :'Array<LinkSchema>',
42
+ :'data' => :'CreateSyncLookupResponseData',
43
+ :'errors' => :'Array<LookupErrorSchema>'
44
+ }
45
+ end
46
+
47
+ # List of attributes with nullable: true
48
+ def self.openapi_nullable
49
+ Set.new([
50
+ ])
51
+ end
52
+
53
+ # Initializes the object
54
+ # @param [Hash] attributes Model attributes in the form of hash
55
+ def initialize(attributes = {})
56
+ if (!attributes.is_a?(Hash))
57
+ fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::CreateSyncLookupResponse` initialize method'
58
+ end
59
+
60
+ # check to see if the attribute exists and convert string to symbol for hash key
61
+ attributes = attributes.each_with_object({}) { |(k, v), h|
62
+ if (!self.class.attribute_map.key?(k.to_sym))
63
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::CreateSyncLookupResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
64
+ end
65
+ h[k.to_sym] = v
66
+ }
67
+
68
+ if attributes.key?(:'links')
69
+ if (value = attributes[:'links']).is_a?(Array)
70
+ self.links = value
71
+ end
72
+ end
73
+
74
+ if attributes.key?(:'data')
75
+ self.data = attributes[:'data']
76
+ end
77
+
78
+ if attributes.key?(:'errors')
79
+ if (value = attributes[:'errors']).is_a?(Array)
80
+ self.errors = value
81
+ end
82
+ end
83
+ end
84
+
85
+ # Show invalid properties with the reasons. Usually used together with valid?
86
+ # @return Array for valid properties with the reasons
87
+ def list_invalid_properties
88
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
89
+ invalid_properties = Array.new
90
+ invalid_properties
91
+ end
92
+
93
+ # Check to see if the all the properties in the model are valid
94
+ # @return true if the model is valid
95
+ def valid?
96
+ warn '[DEPRECATED] the `valid?` method is obsolete'
97
+ true
98
+ end
99
+
100
+ # Checks equality by comparing each attribute.
101
+ # @param [Object] Object to be compared
102
+ def ==(o)
103
+ return true if self.equal?(o)
104
+ self.class == o.class &&
105
+ links == o.links &&
106
+ data == o.data &&
107
+ errors == o.errors
108
+ end
109
+
110
+ # @see the `==` method
111
+ # @param [Object] Object to be compared
112
+ def eql?(o)
113
+ self == o
114
+ end
115
+
116
+ # Calculates hash code according to all attributes.
117
+ # @return [Integer] Hash code
118
+ def hash
119
+ [links, data, errors].hash
120
+ end
121
+
122
+ # Builds the object from hash
123
+ # @param [Hash] attributes Model attributes in the form of hash
124
+ # @return [Object] Returns the model itself
125
+ def self.build_from_hash(attributes)
126
+ return nil unless attributes.is_a?(Hash)
127
+ attributes = attributes.transform_keys(&:to_sym)
128
+ transformed_hash = {}
129
+ openapi_types.each_pair do |key, type|
130
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
131
+ transformed_hash["#{key}"] = nil
132
+ elsif type =~ /\AArray<(.*)>/i
133
+ # check to ensure the input is an array given that the attribute
134
+ # is documented as an array but the input is not
135
+ if attributes[attribute_map[key]].is_a?(Array)
136
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
137
+ end
138
+ elsif !attributes[attribute_map[key]].nil?
139
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
140
+ end
141
+ end
142
+ new(transformed_hash)
143
+ end
144
+
145
+ # Deserializes the data based on type
146
+ # @param string type Data type
147
+ # @param string value Value to be deserialized
148
+ # @return [Object] Deserialized data
149
+ def self._deserialize(type, value)
150
+ case type.to_sym
151
+ when :Time
152
+ Time.parse(value)
153
+ when :Date
154
+ Date.parse(value)
155
+ when :String
156
+ value.to_s
157
+ when :Integer
158
+ value.to_i
159
+ when :Float
160
+ value.to_f
161
+ when :Boolean
162
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
163
+ true
164
+ else
165
+ false
166
+ end
167
+ when :Object
168
+ # generic object (usually a Hash), return directly
169
+ value
170
+ when /\AArray<(?<inner_type>.+)>\z/
171
+ inner_type = Regexp.last_match[:inner_type]
172
+ value.map { |v| _deserialize(inner_type, v) }
173
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
174
+ k_type = Regexp.last_match[:k_type]
175
+ v_type = Regexp.last_match[:v_type]
176
+ {}.tap do |hash|
177
+ value.each do |k, v|
178
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
179
+ end
180
+ end
181
+ else # model
182
+ # models (e.g. Pet) or oneOf
183
+ klass = Bandwidth.const_get(type)
184
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
185
+ end
186
+ end
187
+
188
+ # Returns the string representation of the object
189
+ # @return [String] String presentation of the object
190
+ def to_s
191
+ to_hash.to_s
192
+ end
193
+
194
+ # to_body is an alias to to_hash (backward compatibility)
195
+ # @return [Hash] Returns the object in the form of hash
196
+ def to_body
197
+ to_hash
198
+ end
199
+
200
+ # Returns the object in the form of hash
201
+ # @return [Hash] Returns the object in the form of hash
202
+ def to_hash
203
+ hash = {}
204
+ self.class.attribute_map.each_pair do |attr, param|
205
+ value = self.send(attr)
206
+ if value.nil?
207
+ is_nullable = self.class.openapi_nullable.include?(attr)
208
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
209
+ end
210
+
211
+ hash[param] = _to_hash(value)
212
+ end
213
+ hash
214
+ end
215
+
216
+ # Outputs non-array value in the form of hash
217
+ # For object, use to_hash. Otherwise, just return the value
218
+ # @param [Object] value Any valid value
219
+ # @return [Hash] Returns the value in the form of hash
220
+ def _to_hash(value)
221
+ if value.is_a?(Array)
222
+ value.compact.map { |v| _to_hash(v) }
223
+ elsif value.is_a?(Hash)
224
+ {}.tap do |hash|
225
+ value.each { |k, v| hash[k] = _to_hash(v) }
226
+ end
227
+ elsif value.respond_to? :to_hash
228
+ value.to_hash
229
+ else
230
+ value
231
+ end
232
+ end
233
+ end
234
+ end
@@ -14,18 +14,15 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Bandwidth
17
- # If requestId exists, the result for that request is returned. See the Examples for details on the various responses that you can receive. Generally, if you see a Response Code of 0 in a result for a TN, information will be available for it. Any other Response Code will indicate no information was available for the TN.
18
- class LookupStatus
19
- # The requestId.
17
+ # The phone number lookup response data
18
+ class CreateSyncLookupResponseData
19
+ # The phone number lookup request ID from Bandwidth.
20
20
  attr_accessor :request_id
21
21
 
22
22
  attr_accessor :status
23
23
 
24
- # The carrier information results for the specified telephone number.
25
- attr_accessor :result
26
-
27
- # The telephone numbers whose lookup failed.
28
- attr_accessor :failed_telephone_numbers
24
+ # The carrier information results for the specified telephone numbers.
25
+ attr_accessor :results
29
26
 
30
27
  class EnumAttributeValidator
31
28
  attr_reader :datatype
@@ -54,8 +51,7 @@ module Bandwidth
54
51
  {
55
52
  :'request_id' => :'requestId',
56
53
  :'status' => :'status',
57
- :'result' => :'result',
58
- :'failed_telephone_numbers' => :'failedTelephoneNumbers'
54
+ :'results' => :'results'
59
55
  }
60
56
  end
61
57
 
@@ -68,9 +64,8 @@ module Bandwidth
68
64
  def self.openapi_types
69
65
  {
70
66
  :'request_id' => :'String',
71
- :'status' => :'LookupStatusEnum',
72
- :'result' => :'Array<LookupResult>',
73
- :'failed_telephone_numbers' => :'Array<String>'
67
+ :'status' => :'CompletedLookupStatusEnum',
68
+ :'results' => :'Array<LookupResult>'
74
69
  }
75
70
  end
76
71
 
@@ -84,13 +79,13 @@ module Bandwidth
84
79
  # @param [Hash] attributes Model attributes in the form of hash
85
80
  def initialize(attributes = {})
86
81
  if (!attributes.is_a?(Hash))
87
- fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::LookupStatus` initialize method'
82
+ fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::CreateSyncLookupResponseData` initialize method'
88
83
  end
89
84
 
90
85
  # check to see if the attribute exists and convert string to symbol for hash key
91
86
  attributes = attributes.each_with_object({}) { |(k, v), h|
92
87
  if (!self.class.attribute_map.key?(k.to_sym))
93
- fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::LookupStatus`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
88
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::CreateSyncLookupResponseData`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
94
89
  end
95
90
  h[k.to_sym] = v
96
91
  }
@@ -103,15 +98,9 @@ module Bandwidth
103
98
  self.status = attributes[:'status']
104
99
  end
105
100
 
106
- if attributes.key?(:'result')
107
- if (value = attributes[:'result']).is_a?(Array)
108
- self.result = value
109
- end
110
- end
111
-
112
- if attributes.key?(:'failed_telephone_numbers')
113
- if (value = attributes[:'failed_telephone_numbers']).is_a?(Array)
114
- self.failed_telephone_numbers = value
101
+ if attributes.key?(:'results')
102
+ if (value = attributes[:'results']).is_a?(Array)
103
+ self.results = value
115
104
  end
116
105
  end
117
106
  end
@@ -138,8 +127,7 @@ module Bandwidth
138
127
  self.class == o.class &&
139
128
  request_id == o.request_id &&
140
129
  status == o.status &&
141
- result == o.result &&
142
- failed_telephone_numbers == o.failed_telephone_numbers
130
+ results == o.results
143
131
  end
144
132
 
145
133
  # @see the `==` method
@@ -151,7 +139,7 @@ module Bandwidth
151
139
  # Calculates hash code according to all attributes.
152
140
  # @return [Integer] Hash code
153
141
  def hash
154
- [request_id, status, result, failed_telephone_numbers].hash
142
+ [request_id, status, results].hash
155
143
  end
156
144
 
157
145
  # Builds the object from hash
@@ -0,0 +1,39 @@
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 DeactivationEventEnum
18
+ DEACTIVATED = 'DEACTIVATED'.freeze
19
+
20
+ def self.all_vars
21
+ @all_vars ||= [DEACTIVATED].freeze
22
+ end
23
+
24
+ # Builds the enum from string
25
+ # @param [String] The enum value in the form of the string
26
+ # @return [String] The enum value
27
+ def self.build_from_hash(value)
28
+ new.build_from_hash(value)
29
+ end
30
+
31
+ # Builds the enum from string
32
+ # @param [String] The enum value in the form of the string
33
+ # @return [String] The enum value
34
+ def build_from_hash(value)
35
+ return value if DeactivationEventEnum.all_vars.include?(value)
36
+ raise "Invalid ENUM value #{value} for class #DeactivationEventEnum"
37
+ end
38
+ end
39
+ end