bandwidth-sdk 17.3.2 → 18.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 (95) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +6 -6
  3. data/README.md +28 -2
  4. data/bandwidth.yml +979 -60
  5. data/coverage/.last_run.json +1 -1
  6. data/coverage/.resultset.json +783 -152
  7. data/coverage/index.html +21642 -14804
  8. data/docs/BrtcError.md +26 -0
  9. data/docs/BrtcErrorResponse.md +22 -0
  10. data/docs/BrtcErrorSource.md +24 -0
  11. data/docs/BrtcLink.md +22 -0
  12. data/docs/CreateCall.md +2 -2
  13. data/docs/CreateEndpointRequestBase.md +26 -0
  14. data/docs/CreateEndpointResponse.md +22 -0
  15. data/docs/CreateEndpointResponseData.md +32 -0
  16. data/docs/CreateWebRtcConnectionRequest.md +28 -0
  17. data/docs/Device.md +24 -0
  18. data/docs/{BusinessRegistrationIssuingCountryEnum.md → DeviceStatusEnum.md} +2 -2
  19. data/docs/Endpoint.md +30 -0
  20. data/docs/EndpointDirectionEnum.md +15 -0
  21. data/docs/EndpointEvent.md +34 -0
  22. data/docs/EndpointEventTypeEnum.md +15 -0
  23. data/docs/EndpointResponse.md +22 -0
  24. data/docs/EndpointStatusEnum.md +15 -0
  25. data/docs/EndpointTypeEnum.md +15 -0
  26. data/docs/Endpoints.md +28 -0
  27. data/docs/EndpointsApi.md +395 -0
  28. data/docs/InboundCallback.md +2 -2
  29. data/docs/ListEndpointsResponse.md +24 -0
  30. data/docs/LookupResult.md +1 -1
  31. data/docs/MachineDetectionConfiguration.md +1 -1
  32. data/docs/MediaApi.md +1 -1
  33. data/docs/MessageRequest.md +1 -1
  34. data/docs/MmsMessageContentFile.md +1 -1
  35. data/docs/Page.md +24 -0
  36. data/docs/RbmActionBase.md +1 -1
  37. data/docs/RbmSuggestionResponse.md +1 -1
  38. data/docs/SipConnectionMetadata.md +24 -0
  39. data/docs/SipCredentials.md +20 -0
  40. data/docs/StatusCallback.md +1 -1
  41. data/docs/SyncLookupRequest.md +3 -1
  42. data/docs/TfvSubmissionInfo.md +3 -3
  43. data/docs/UpdateCall.md +1 -1
  44. data/docs/VerificationRequest.md +3 -3
  45. data/docs/VerificationUpdateRequest.md +3 -3
  46. data/docs/WebhookSubscriptionError.md +22 -0
  47. data/docs/WebhookSubscriptionsListBody.md +1 -1
  48. data/lib/bandwidth-sdk/api/endpoints_api.rb +397 -0
  49. data/lib/bandwidth-sdk/api/media_api.rb +2 -2
  50. data/lib/bandwidth-sdk/configuration.rb +30 -0
  51. data/lib/bandwidth-sdk/models/brtc_error.rb +219 -0
  52. data/lib/bandwidth-sdk/models/brtc_error_response.rb +204 -0
  53. data/lib/bandwidth-sdk/models/brtc_error_source.rb +176 -0
  54. data/lib/bandwidth-sdk/models/brtc_link.rb +166 -0
  55. data/lib/bandwidth-sdk/models/create_call.rb +7 -7
  56. data/lib/bandwidth-sdk/models/create_endpoint_request_base.rb +250 -0
  57. data/lib/bandwidth-sdk/models/create_endpoint_response.rb +218 -0
  58. data/lib/bandwidth-sdk/models/create_endpoint_response_data.rb +356 -0
  59. data/lib/bandwidth-sdk/models/create_web_rtc_connection_request.rb +266 -0
  60. data/lib/bandwidth-sdk/models/device.rb +258 -0
  61. data/lib/bandwidth-sdk/models/device_status_enum.rb +40 -0
  62. data/lib/bandwidth-sdk/models/endpoint.rb +329 -0
  63. data/lib/bandwidth-sdk/models/endpoint_direction_enum.rb +41 -0
  64. data/lib/bandwidth-sdk/models/endpoint_event.rb +381 -0
  65. data/lib/bandwidth-sdk/models/endpoint_event_type_enum.rb +40 -0
  66. data/lib/bandwidth-sdk/models/endpoint_response.rb +218 -0
  67. data/lib/bandwidth-sdk/models/endpoint_status_enum.rb +40 -0
  68. data/lib/bandwidth-sdk/models/endpoint_type_enum.rb +39 -0
  69. data/lib/bandwidth-sdk/models/endpoints.rb +311 -0
  70. data/lib/bandwidth-sdk/models/inbound_callback.rb +2 -2
  71. data/lib/bandwidth-sdk/models/list_endpoints_response.rb +229 -0
  72. data/lib/bandwidth-sdk/models/lookup_result.rb +1 -1
  73. data/lib/bandwidth-sdk/models/machine_detection_configuration.rb +1 -1
  74. data/lib/bandwidth-sdk/models/message_request.rb +1 -1
  75. data/lib/bandwidth-sdk/models/mms_message_content_file.rb +1 -1
  76. data/lib/bandwidth-sdk/models/page.rb +259 -0
  77. data/lib/bandwidth-sdk/models/sip_connection_metadata.rb +175 -0
  78. data/lib/bandwidth-sdk/models/sip_credentials.rb +156 -0
  79. data/lib/bandwidth-sdk/models/status_callback.rb +1 -1
  80. data/lib/bandwidth-sdk/models/sync_lookup_request.rb +35 -4
  81. data/lib/bandwidth-sdk/models/tfv_submission_info.rb +4 -2
  82. data/lib/bandwidth-sdk/models/update_call.rb +6 -6
  83. data/lib/bandwidth-sdk/models/verification_request.rb +4 -2
  84. data/lib/bandwidth-sdk/models/verification_update_request.rb +4 -2
  85. data/lib/bandwidth-sdk/models/webhook_subscription_error.rb +165 -0
  86. data/lib/bandwidth-sdk/models/webhook_subscriptions_list_body.rb +1 -1
  87. data/lib/bandwidth-sdk/version.rb +1 -1
  88. data/lib/bandwidth-sdk.rb +24 -2
  89. data/spec/smoke/endpoints_api_spec.rb +148 -0
  90. data/spec/smoke/phone_number_lookup_api_spec.rb +1 -9
  91. data/spec/unit/api/endpoints_api_spec.rb +172 -0
  92. data/spec/unit/api/phone_number_lookup_api_spec.rb +2 -0
  93. data/spec/unit/api/toll_free_verification_api_spec.rb +1 -1
  94. metadata +104 -54
  95. data/lib/bandwidth-sdk/models/business_registration_issuing_country_enum.rb +0 -55
@@ -0,0 +1,219 @@
1
+ =begin
2
+ #Bandwidth
3
+
4
+ #Bandwidth's Communication APIs
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ Contact: letstalk@bandwidth.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.17.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Bandwidth
17
+ class BrtcError < ApiModelBase
18
+ # A unique identifier for the error.
19
+ attr_accessor :id
20
+
21
+ # The type of error.
22
+ attr_accessor :type
23
+
24
+ # A description of the error.
25
+ attr_accessor :description
26
+
27
+ # A code that uniquely identifies the error.
28
+ attr_accessor :code
29
+
30
+ attr_accessor :source
31
+
32
+ # Attribute mapping from ruby-style variable name to JSON key.
33
+ def self.attribute_map
34
+ {
35
+ :'id' => :'id',
36
+ :'type' => :'type',
37
+ :'description' => :'description',
38
+ :'code' => :'code',
39
+ :'source' => :'source'
40
+ }
41
+ end
42
+
43
+ # Returns attribute mapping this model knows about
44
+ def self.acceptable_attribute_map
45
+ attribute_map
46
+ end
47
+
48
+ # Returns all the JSON keys this model knows about
49
+ def self.acceptable_attributes
50
+ acceptable_attribute_map.values
51
+ end
52
+
53
+ # Attribute type mapping.
54
+ def self.openapi_types
55
+ {
56
+ :'id' => :'String',
57
+ :'type' => :'String',
58
+ :'description' => :'String',
59
+ :'code' => :'String',
60
+ :'source' => :'BrtcErrorSource'
61
+ }
62
+ end
63
+
64
+ # List of attributes with nullable: true
65
+ def self.openapi_nullable
66
+ Set.new([
67
+ ])
68
+ end
69
+
70
+ # Initializes the object
71
+ # @param [Hash] attributes Model attributes in the form of hash
72
+ def initialize(attributes = {})
73
+ if (!attributes.is_a?(Hash))
74
+ fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::BrtcError` initialize method'
75
+ end
76
+
77
+ # check to see if the attribute exists and convert string to symbol for hash key
78
+ acceptable_attribute_map = self.class.acceptable_attribute_map
79
+ attributes = attributes.each_with_object({}) { |(k, v), h|
80
+ if (!acceptable_attribute_map.key?(k.to_sym))
81
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::BrtcError`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
82
+ end
83
+ h[k.to_sym] = v
84
+ }
85
+
86
+ if attributes.key?(:'id')
87
+ self.id = attributes[:'id']
88
+ end
89
+
90
+ if attributes.key?(:'type')
91
+ self.type = attributes[:'type']
92
+ else
93
+ self.type = nil
94
+ end
95
+
96
+ if attributes.key?(:'description')
97
+ self.description = attributes[:'description']
98
+ else
99
+ self.description = nil
100
+ end
101
+
102
+ if attributes.key?(:'code')
103
+ self.code = attributes[:'code']
104
+ end
105
+
106
+ if attributes.key?(:'source')
107
+ self.source = attributes[:'source']
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 @type.nil?
117
+ invalid_properties.push('invalid value for "type", type cannot be nil.')
118
+ end
119
+
120
+ if @description.nil?
121
+ invalid_properties.push('invalid value for "description", description cannot be nil.')
122
+ end
123
+
124
+ invalid_properties
125
+ end
126
+
127
+ # Check to see if the all the properties in the model are valid
128
+ # @return true if the model is valid
129
+ def valid?
130
+ warn '[DEPRECATED] the `valid?` method is obsolete'
131
+ return false if @type.nil?
132
+ return false if @description.nil?
133
+ true
134
+ end
135
+
136
+ # Custom attribute writer method with validation
137
+ # @param [Object] type Value to be assigned
138
+ def type=(type)
139
+ if type.nil?
140
+ fail ArgumentError, 'type cannot be nil'
141
+ end
142
+
143
+ @type = type
144
+ end
145
+
146
+ # Custom attribute writer method with validation
147
+ # @param [Object] description Value to be assigned
148
+ def description=(description)
149
+ if description.nil?
150
+ fail ArgumentError, 'description cannot be nil'
151
+ end
152
+
153
+ @description = description
154
+ end
155
+
156
+ # Checks equality by comparing each attribute.
157
+ # @param [Object] Object to be compared
158
+ def ==(o)
159
+ return true if self.equal?(o)
160
+ self.class == o.class &&
161
+ id == o.id &&
162
+ type == o.type &&
163
+ description == o.description &&
164
+ code == o.code &&
165
+ source == o.source
166
+ end
167
+
168
+ # @see the `==` method
169
+ # @param [Object] Object to be compared
170
+ def eql?(o)
171
+ self == o
172
+ end
173
+
174
+ # Calculates hash code according to all attributes.
175
+ # @return [Integer] Hash code
176
+ def hash
177
+ [id, type, description, code, source].hash
178
+ end
179
+
180
+ # Builds the object from hash
181
+ # @param [Hash] attributes Model attributes in the form of hash
182
+ # @return [Object] Returns the model itself
183
+ def self.build_from_hash(attributes)
184
+ return nil unless attributes.is_a?(Hash)
185
+ attributes = attributes.transform_keys(&:to_sym)
186
+ transformed_hash = {}
187
+ openapi_types.each_pair do |key, type|
188
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
189
+ transformed_hash["#{key}"] = nil
190
+ elsif type =~ /\AArray<(.*)>/i
191
+ # check to ensure the input is an array given that the attribute
192
+ # is documented as an array but the input is not
193
+ if attributes[attribute_map[key]].is_a?(Array)
194
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
195
+ end
196
+ elsif !attributes[attribute_map[key]].nil?
197
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
198
+ end
199
+ end
200
+ new(transformed_hash)
201
+ end
202
+
203
+ # Returns the object in the form of hash
204
+ # @return [Hash] Returns the object in the form of hash
205
+ def to_hash
206
+ hash = {}
207
+ self.class.attribute_map.each_pair do |attr, param|
208
+ value = self.send(attr)
209
+ if value.nil?
210
+ is_nullable = self.class.openapi_nullable.include?(attr)
211
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
212
+ end
213
+
214
+ hash[param] = _to_hash(value)
215
+ end
216
+ hash
217
+ end
218
+ end
219
+ end
@@ -0,0 +1,204 @@
1
+ =begin
2
+ #Bandwidth
3
+
4
+ #Bandwidth's Communication APIs
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ Contact: letstalk@bandwidth.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.17.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Bandwidth
17
+ class BrtcErrorResponse < ApiModelBase
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 attribute mapping this model knows about
34
+ def self.acceptable_attribute_map
35
+ attribute_map
36
+ end
37
+
38
+ # Returns all the JSON keys this model knows about
39
+ def self.acceptable_attributes
40
+ acceptable_attribute_map.values
41
+ end
42
+
43
+ # Attribute type mapping.
44
+ def self.openapi_types
45
+ {
46
+ :'links' => :'Array<BrtcLink>',
47
+ :'data' => :'Object',
48
+ :'errors' => :'Array<BrtcError>'
49
+ }
50
+ end
51
+
52
+ # List of attributes with nullable: true
53
+ def self.openapi_nullable
54
+ Set.new([
55
+ :'data',
56
+ ])
57
+ end
58
+
59
+ # Initializes the object
60
+ # @param [Hash] attributes Model attributes in the form of hash
61
+ def initialize(attributes = {})
62
+ if (!attributes.is_a?(Hash))
63
+ fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::BrtcErrorResponse` initialize method'
64
+ end
65
+
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
68
+ attributes = attributes.each_with_object({}) { |(k, v), h|
69
+ if (!acceptable_attribute_map.key?(k.to_sym))
70
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::BrtcErrorResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
71
+ end
72
+ h[k.to_sym] = v
73
+ }
74
+
75
+ if attributes.key?(:'links')
76
+ if (value = attributes[:'links']).is_a?(Array)
77
+ self.links = value
78
+ end
79
+ else
80
+ self.links = nil
81
+ end
82
+
83
+ if attributes.key?(:'data')
84
+ self.data = attributes[:'data']
85
+ else
86
+ self.data = nil
87
+ end
88
+
89
+ if attributes.key?(:'errors')
90
+ if (value = attributes[:'errors']).is_a?(Array)
91
+ self.errors = value
92
+ end
93
+ else
94
+ self.errors = nil
95
+ end
96
+ end
97
+
98
+ # Show invalid properties with the reasons. Usually used together with valid?
99
+ # @return Array for valid properties with the reasons
100
+ def list_invalid_properties
101
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
102
+ invalid_properties = Array.new
103
+ if @links.nil?
104
+ invalid_properties.push('invalid value for "links", links cannot be nil.')
105
+ end
106
+
107
+ if @errors.nil?
108
+ invalid_properties.push('invalid value for "errors", errors cannot be nil.')
109
+ end
110
+
111
+ invalid_properties
112
+ end
113
+
114
+ # Check to see if the all the properties in the model are valid
115
+ # @return true if the model is valid
116
+ def valid?
117
+ warn '[DEPRECATED] the `valid?` method is obsolete'
118
+ return false if @links.nil?
119
+ return false if @errors.nil?
120
+ true
121
+ end
122
+
123
+ # Custom attribute writer method with validation
124
+ # @param [Object] links Value to be assigned
125
+ def links=(links)
126
+ if links.nil?
127
+ fail ArgumentError, 'links cannot be nil'
128
+ end
129
+
130
+ @links = links
131
+ end
132
+
133
+ # Custom attribute writer method with validation
134
+ # @param [Object] errors Value to be assigned
135
+ def errors=(errors)
136
+ if errors.nil?
137
+ fail ArgumentError, 'errors cannot be nil'
138
+ end
139
+
140
+ @errors = errors
141
+ end
142
+
143
+ # Checks equality by comparing each attribute.
144
+ # @param [Object] Object to be compared
145
+ def ==(o)
146
+ return true if self.equal?(o)
147
+ self.class == o.class &&
148
+ links == o.links &&
149
+ data == o.data &&
150
+ errors == o.errors
151
+ end
152
+
153
+ # @see the `==` method
154
+ # @param [Object] Object to be compared
155
+ def eql?(o)
156
+ self == o
157
+ end
158
+
159
+ # Calculates hash code according to all attributes.
160
+ # @return [Integer] Hash code
161
+ def hash
162
+ [links, data, errors].hash
163
+ end
164
+
165
+ # Builds the object from hash
166
+ # @param [Hash] attributes Model attributes in the form of hash
167
+ # @return [Object] Returns the model itself
168
+ def self.build_from_hash(attributes)
169
+ return nil unless attributes.is_a?(Hash)
170
+ attributes = attributes.transform_keys(&:to_sym)
171
+ transformed_hash = {}
172
+ openapi_types.each_pair do |key, type|
173
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
174
+ transformed_hash["#{key}"] = nil
175
+ elsif type =~ /\AArray<(.*)>/i
176
+ # check to ensure the input is an array given that the attribute
177
+ # is documented as an array but the input is not
178
+ if attributes[attribute_map[key]].is_a?(Array)
179
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
180
+ end
181
+ elsif !attributes[attribute_map[key]].nil?
182
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
183
+ end
184
+ end
185
+ new(transformed_hash)
186
+ end
187
+
188
+ # Returns the object in the form of hash
189
+ # @return [Hash] Returns the object in the form of hash
190
+ def to_hash
191
+ hash = {}
192
+ self.class.attribute_map.each_pair do |attr, param|
193
+ value = self.send(attr)
194
+ if value.nil?
195
+ is_nullable = self.class.openapi_nullable.include?(attr)
196
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
197
+ end
198
+
199
+ hash[param] = _to_hash(value)
200
+ end
201
+ hash
202
+ end
203
+ end
204
+ end
@@ -0,0 +1,176 @@
1
+ =begin
2
+ #Bandwidth
3
+
4
+ #Bandwidth's Communication APIs
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ Contact: letstalk@bandwidth.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.17.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Bandwidth
17
+ class BrtcErrorSource < ApiModelBase
18
+ # The URI parameter that caused the error.
19
+ attr_accessor :parameter
20
+
21
+ # The request body field that caused the error.
22
+ attr_accessor :field
23
+
24
+ # The header that caused the error.
25
+ attr_accessor :header
26
+
27
+ # The resource ID or path to the resource (or non-existent resource) causing the error.
28
+ attr_accessor :reference
29
+
30
+ # Attribute mapping from ruby-style variable name to JSON key.
31
+ def self.attribute_map
32
+ {
33
+ :'parameter' => :'parameter',
34
+ :'field' => :'field',
35
+ :'header' => :'header',
36
+ :'reference' => :'reference'
37
+ }
38
+ end
39
+
40
+ # Returns attribute mapping this model knows about
41
+ def self.acceptable_attribute_map
42
+ attribute_map
43
+ end
44
+
45
+ # Returns all the JSON keys this model knows about
46
+ def self.acceptable_attributes
47
+ acceptable_attribute_map.values
48
+ end
49
+
50
+ # Attribute type mapping.
51
+ def self.openapi_types
52
+ {
53
+ :'parameter' => :'String',
54
+ :'field' => :'String',
55
+ :'header' => :'String',
56
+ :'reference' => :'String'
57
+ }
58
+ end
59
+
60
+ # List of attributes with nullable: true
61
+ def self.openapi_nullable
62
+ Set.new([
63
+ ])
64
+ end
65
+
66
+ # Initializes the object
67
+ # @param [Hash] attributes Model attributes in the form of hash
68
+ def initialize(attributes = {})
69
+ if (!attributes.is_a?(Hash))
70
+ fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::BrtcErrorSource` initialize method'
71
+ end
72
+
73
+ # check to see if the attribute exists and convert string to symbol for hash key
74
+ acceptable_attribute_map = self.class.acceptable_attribute_map
75
+ attributes = attributes.each_with_object({}) { |(k, v), h|
76
+ if (!acceptable_attribute_map.key?(k.to_sym))
77
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::BrtcErrorSource`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
78
+ end
79
+ h[k.to_sym] = v
80
+ }
81
+
82
+ if attributes.key?(:'parameter')
83
+ self.parameter = attributes[:'parameter']
84
+ end
85
+
86
+ if attributes.key?(:'field')
87
+ self.field = attributes[:'field']
88
+ end
89
+
90
+ if attributes.key?(:'header')
91
+ self.header = attributes[:'header']
92
+ end
93
+
94
+ if attributes.key?(:'reference')
95
+ self.reference = attributes[:'reference']
96
+ end
97
+ end
98
+
99
+ # Show invalid properties with the reasons. Usually used together with valid?
100
+ # @return Array for valid properties with the reasons
101
+ def list_invalid_properties
102
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
103
+ invalid_properties = Array.new
104
+ invalid_properties
105
+ end
106
+
107
+ # Check to see if the all the properties in the model are valid
108
+ # @return true if the model is valid
109
+ def valid?
110
+ warn '[DEPRECATED] the `valid?` method is obsolete'
111
+ true
112
+ end
113
+
114
+ # Checks equality by comparing each attribute.
115
+ # @param [Object] Object to be compared
116
+ def ==(o)
117
+ return true if self.equal?(o)
118
+ self.class == o.class &&
119
+ parameter == o.parameter &&
120
+ field == o.field &&
121
+ header == o.header &&
122
+ reference == o.reference
123
+ end
124
+
125
+ # @see the `==` method
126
+ # @param [Object] Object to be compared
127
+ def eql?(o)
128
+ self == o
129
+ end
130
+
131
+ # Calculates hash code according to all attributes.
132
+ # @return [Integer] Hash code
133
+ def hash
134
+ [parameter, field, header, reference].hash
135
+ end
136
+
137
+ # Builds the object from hash
138
+ # @param [Hash] attributes Model attributes in the form of hash
139
+ # @return [Object] Returns the model itself
140
+ def self.build_from_hash(attributes)
141
+ return nil unless attributes.is_a?(Hash)
142
+ attributes = attributes.transform_keys(&:to_sym)
143
+ transformed_hash = {}
144
+ openapi_types.each_pair do |key, type|
145
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
146
+ transformed_hash["#{key}"] = nil
147
+ elsif type =~ /\AArray<(.*)>/i
148
+ # check to ensure the input is an array given that the attribute
149
+ # is documented as an array but the input is not
150
+ if attributes[attribute_map[key]].is_a?(Array)
151
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
152
+ end
153
+ elsif !attributes[attribute_map[key]].nil?
154
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
155
+ end
156
+ end
157
+ new(transformed_hash)
158
+ end
159
+
160
+ # Returns the object in the form of hash
161
+ # @return [Hash] Returns the object in the form of hash
162
+ def to_hash
163
+ hash = {}
164
+ self.class.attribute_map.each_pair do |attr, param|
165
+ value = self.send(attr)
166
+ if value.nil?
167
+ is_nullable = self.class.openapi_nullable.include?(attr)
168
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
169
+ end
170
+
171
+ hash[param] = _to_hash(value)
172
+ end
173
+ hash
174
+ end
175
+ end
176
+ end