late-sdk 0.0.782 → 0.0.784

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 (60) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +15 -0
  3. data/docs/CreatePhoneNumberStockWatchRequest.md +18 -0
  4. data/docs/ListPhoneNumberStockWatches200Response.md +18 -0
  5. data/docs/PhoneNumberStockWatch.md +24 -0
  6. data/docs/PhoneNumbersApi.md +203 -0
  7. data/docs/UsageApi.md +8 -2
  8. data/docs/UsageAttributionGroup.md +22 -0
  9. data/docs/UsageAttributionSlice.md +20 -0
  10. data/docs/UsageAttributionSliceByProduct.md +34 -0
  11. data/docs/UsageMetering.md +5 -1
  12. data/docs/UsageMeteringAttribution.md +26 -0
  13. data/docs/UsageMeteringScope.md +49 -0
  14. data/docs/UsageMeteringScopeOneOf.md +18 -0
  15. data/docs/WebhookEventsApi.md +69 -0
  16. data/docs/WebhookPayloadPhoneNumberStockAvailable.md +24 -0
  17. data/docs/WebhookPayloadPhoneNumberStockAvailableStock.md +20 -0
  18. data/docs/WebhookPayloadPhoneNumberStockAvailableStockTypesInner.md +20 -0
  19. data/lib/zernio-sdk/api/phone_numbers_api.rb +184 -0
  20. data/lib/zernio-sdk/api/usage_api.rb +15 -2
  21. data/lib/zernio-sdk/api/webhook_events_api.rb +66 -0
  22. data/lib/zernio-sdk/models/create_phone_number_stock_watch_request.rb +183 -0
  23. data/lib/zernio-sdk/models/list_phone_number_stock_watches200_response.rb +149 -0
  24. data/lib/zernio-sdk/models/phone_number_stock_watch.rb +243 -0
  25. data/lib/zernio-sdk/models/usage_attribution_group.rb +190 -0
  26. data/lib/zernio-sdk/models/usage_attribution_slice.rb +156 -0
  27. data/lib/zernio-sdk/models/usage_attribution_slice_by_product.rb +220 -0
  28. data/lib/zernio-sdk/models/usage_metering.rb +22 -4
  29. data/lib/zernio-sdk/models/usage_metering_attribution.rb +223 -0
  30. data/lib/zernio-sdk/models/usage_metering_call_usage.rb +1 -1
  31. data/lib/zernio-sdk/models/usage_metering_peaks.rb +1 -1
  32. data/lib/zernio-sdk/models/usage_metering_scope.rb +105 -0
  33. data/lib/zernio-sdk/models/usage_metering_scope_one_of.rb +164 -0
  34. data/lib/zernio-sdk/models/webhook_payload_phone_number_stock_available.rb +269 -0
  35. data/lib/zernio-sdk/models/webhook_payload_phone_number_stock_available_stock.rb +194 -0
  36. data/lib/zernio-sdk/models/webhook_payload_phone_number_stock_available_stock_types_inner.rb +192 -0
  37. data/lib/zernio-sdk/version.rb +1 -1
  38. data/lib/zernio-sdk.rb +12 -0
  39. data/openapi.yaml +236 -8
  40. data/spec/api/phone_numbers_api_spec.rb +33 -0
  41. data/spec/api/usage_api_spec.rb +4 -1
  42. data/spec/models/create_phone_number_stock_watch_request_spec.rb +36 -0
  43. data/spec/models/create_webhook_settings_request_spec.rb +1 -1
  44. data/spec/models/list_phone_number_stock_watches200_response_spec.rb +36 -0
  45. data/spec/models/phone_number_stock_watch_spec.rb +54 -0
  46. data/spec/models/update_webhook_settings_request_spec.rb +1 -1
  47. data/spec/models/usage_attribution_group_spec.rb +48 -0
  48. data/spec/models/usage_attribution_slice_by_product_spec.rb +84 -0
  49. data/spec/models/usage_attribution_slice_spec.rb +42 -0
  50. data/spec/models/usage_metering_attribution_spec.rb +64 -0
  51. data/spec/models/usage_metering_scope_one_of_spec.rb +36 -0
  52. data/spec/models/usage_metering_scope_spec.rb +32 -0
  53. data/spec/models/usage_metering_spec.rb +12 -0
  54. data/spec/models/webhook_payload_phone_number_stock_available_spec.rb +58 -0
  55. data/spec/models/webhook_payload_phone_number_stock_available_stock_spec.rb +42 -0
  56. data/spec/models/webhook_payload_phone_number_stock_available_stock_types_inner_spec.rb +42 -0
  57. data/spec/models/webhook_spec.rb +1 -1
  58. data/zernio-sdk-0.0.784.gem +0 -0
  59. metadata +50 -2
  60. data/zernio-sdk-0.0.782.gem +0 -0
@@ -0,0 +1,183 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal. Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema).
5
+
6
+ The version of the OpenAPI document: 1.0.4
7
+ Contact: support@zernio.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.19.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Zernio
17
+ class CreatePhoneNumberStockWatchRequest < ApiModelBase
18
+ # ISO 3166-1 alpha-2 code of a country listed by GET /v1/phone-numbers/countries.
19
+ attr_accessor :country
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'country' => :'country'
25
+ }
26
+ end
27
+
28
+ # Returns attribute mapping this model knows about
29
+ def self.acceptable_attribute_map
30
+ attribute_map
31
+ end
32
+
33
+ # Returns all the JSON keys this model knows about
34
+ def self.acceptable_attributes
35
+ acceptable_attribute_map.values
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.openapi_types
40
+ {
41
+ :'country' => :'String'
42
+ }
43
+ end
44
+
45
+ # List of attributes with nullable: true
46
+ def self.openapi_nullable
47
+ Set.new([
48
+ ])
49
+ end
50
+
51
+ # Initializes the object
52
+ # @param [Hash] attributes Model attributes in the form of hash
53
+ def initialize(attributes = {})
54
+ if (!attributes.is_a?(Hash))
55
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::CreatePhoneNumberStockWatchRequest` initialize method"
56
+ end
57
+
58
+ # check to see if the attribute exists and convert string to symbol for hash key
59
+ acceptable_attribute_map = self.class.acceptable_attribute_map
60
+ attributes = attributes.each_with_object({}) { |(k, v), h|
61
+ if (!acceptable_attribute_map.key?(k.to_sym))
62
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::CreatePhoneNumberStockWatchRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
63
+ end
64
+ h[k.to_sym] = v
65
+ }
66
+
67
+ if attributes.key?(:'country')
68
+ self.country = attributes[:'country']
69
+ else
70
+ self.country = nil
71
+ end
72
+ end
73
+
74
+ # Show invalid properties with the reasons. Usually used together with valid?
75
+ # @return Array for valid properties with the reasons
76
+ def list_invalid_properties
77
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
78
+ invalid_properties = Array.new
79
+ if @country.nil?
80
+ invalid_properties.push('invalid value for "country", country cannot be nil.')
81
+ end
82
+
83
+ if @country.to_s.length > 2
84
+ invalid_properties.push('invalid value for "country", the character length must be smaller than or equal to 2.')
85
+ end
86
+
87
+ if @country.to_s.length < 2
88
+ invalid_properties.push('invalid value for "country", the character length must be greater than or equal to 2.')
89
+ end
90
+
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
+ return false if @country.nil?
99
+ return false if @country.to_s.length > 2
100
+ return false if @country.to_s.length < 2
101
+ true
102
+ end
103
+
104
+ # Custom attribute writer method with validation
105
+ # @param [Object] country Value to be assigned
106
+ def country=(country)
107
+ if country.nil?
108
+ fail ArgumentError, 'country cannot be nil'
109
+ end
110
+
111
+ if country.to_s.length > 2
112
+ fail ArgumentError, 'invalid value for "country", the character length must be smaller than or equal to 2.'
113
+ end
114
+
115
+ if country.to_s.length < 2
116
+ fail ArgumentError, 'invalid value for "country", the character length must be greater than or equal to 2.'
117
+ end
118
+
119
+ @country = country
120
+ end
121
+
122
+ # Checks equality by comparing each attribute.
123
+ # @param [Object] Object to be compared
124
+ def ==(o)
125
+ return true if self.equal?(o)
126
+ self.class == o.class &&
127
+ country == o.country
128
+ end
129
+
130
+ # @see the `==` method
131
+ # @param [Object] Object to be compared
132
+ def eql?(o)
133
+ self == o
134
+ end
135
+
136
+ # Calculates hash code according to all attributes.
137
+ # @return [Integer] Hash code
138
+ def hash
139
+ [country].hash
140
+ end
141
+
142
+ # Builds the object from hash
143
+ # @param [Hash] attributes Model attributes in the form of hash
144
+ # @return [Object] Returns the model itself
145
+ def self.build_from_hash(attributes)
146
+ return nil unless attributes.is_a?(Hash)
147
+ attributes = attributes.transform_keys(&:to_sym)
148
+ transformed_hash = {}
149
+ openapi_types.each_pair do |key, type|
150
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
151
+ transformed_hash["#{key}"] = nil
152
+ elsif type =~ /\AArray<(.*)>/i
153
+ # check to ensure the input is an array given that the attribute
154
+ # is documented as an array but the input is not
155
+ if attributes[attribute_map[key]].is_a?(Array)
156
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
157
+ end
158
+ elsif !attributes[attribute_map[key]].nil?
159
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
160
+ end
161
+ end
162
+ new(transformed_hash)
163
+ end
164
+
165
+ # Returns the object in the form of hash
166
+ # @return [Hash] Returns the object in the form of hash
167
+ def to_hash
168
+ hash = {}
169
+ self.class.attribute_map.each_pair do |attr, param|
170
+ value = self.send(attr)
171
+ if value.nil?
172
+ is_nullable = self.class.openapi_nullable.include?(attr)
173
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
174
+ end
175
+
176
+ hash[param] = _to_hash(value)
177
+ end
178
+ hash
179
+ end
180
+
181
+ end
182
+
183
+ end
@@ -0,0 +1,149 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal. Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema).
5
+
6
+ The version of the OpenAPI document: 1.0.4
7
+ Contact: support@zernio.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.19.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Zernio
17
+ class ListPhoneNumberStockWatches200Response < ApiModelBase
18
+ attr_accessor :watches
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'watches' => :'watches'
24
+ }
25
+ end
26
+
27
+ # Returns attribute mapping this model knows about
28
+ def self.acceptable_attribute_map
29
+ attribute_map
30
+ end
31
+
32
+ # Returns all the JSON keys this model knows about
33
+ def self.acceptable_attributes
34
+ acceptable_attribute_map.values
35
+ end
36
+
37
+ # Attribute type mapping.
38
+ def self.openapi_types
39
+ {
40
+ :'watches' => :'Array<PhoneNumberStockWatch>'
41
+ }
42
+ end
43
+
44
+ # List of attributes with nullable: true
45
+ def self.openapi_nullable
46
+ Set.new([
47
+ ])
48
+ end
49
+
50
+ # Initializes the object
51
+ # @param [Hash] attributes Model attributes in the form of hash
52
+ def initialize(attributes = {})
53
+ if (!attributes.is_a?(Hash))
54
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::ListPhoneNumberStockWatches200Response` initialize method"
55
+ end
56
+
57
+ # check to see if the attribute exists and convert string to symbol for hash key
58
+ acceptable_attribute_map = self.class.acceptable_attribute_map
59
+ attributes = attributes.each_with_object({}) { |(k, v), h|
60
+ if (!acceptable_attribute_map.key?(k.to_sym))
61
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::ListPhoneNumberStockWatches200Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
62
+ end
63
+ h[k.to_sym] = v
64
+ }
65
+
66
+ if attributes.key?(:'watches')
67
+ if (value = attributes[:'watches']).is_a?(Array)
68
+ self.watches = value
69
+ end
70
+ end
71
+ end
72
+
73
+ # Show invalid properties with the reasons. Usually used together with valid?
74
+ # @return Array for valid properties with the reasons
75
+ def list_invalid_properties
76
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
77
+ invalid_properties = Array.new
78
+ invalid_properties
79
+ end
80
+
81
+ # Check to see if the all the properties in the model are valid
82
+ # @return true if the model is valid
83
+ def valid?
84
+ warn '[DEPRECATED] the `valid?` method is obsolete'
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
+ watches == o.watches
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
+ [watches].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
+ # Returns the object in the form of hash
132
+ # @return [Hash] Returns the object in the form of hash
133
+ def to_hash
134
+ hash = {}
135
+ self.class.attribute_map.each_pair do |attr, param|
136
+ value = self.send(attr)
137
+ if value.nil?
138
+ is_nullable = self.class.openapi_nullable.include?(attr)
139
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
140
+ end
141
+
142
+ hash[param] = _to_hash(value)
143
+ end
144
+ hash
145
+ end
146
+
147
+ end
148
+
149
+ end
@@ -0,0 +1,243 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal. Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema).
5
+
6
+ The version of the OpenAPI document: 1.0.4
7
+ Contact: support@zernio.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.19.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Zernio
17
+ class PhoneNumberStockWatch < ApiModelBase
18
+ attr_accessor :id
19
+
20
+ # ISO 3166-1 alpha-2.
21
+ attr_accessor :country
22
+
23
+ attr_accessor :country_name
24
+
25
+ attr_accessor :created_at
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'id' => :'id',
31
+ :'country' => :'country',
32
+ :'country_name' => :'countryName',
33
+ :'created_at' => :'createdAt'
34
+ }
35
+ end
36
+
37
+ # Returns attribute mapping this model knows about
38
+ def self.acceptable_attribute_map
39
+ attribute_map
40
+ end
41
+
42
+ # Returns all the JSON keys this model knows about
43
+ def self.acceptable_attributes
44
+ acceptable_attribute_map.values
45
+ end
46
+
47
+ # Attribute type mapping.
48
+ def self.openapi_types
49
+ {
50
+ :'id' => :'String',
51
+ :'country' => :'String',
52
+ :'country_name' => :'String',
53
+ :'created_at' => :'Time'
54
+ }
55
+ end
56
+
57
+ # List of attributes with nullable: true
58
+ def self.openapi_nullable
59
+ Set.new([
60
+ ])
61
+ end
62
+
63
+ # Initializes the object
64
+ # @param [Hash] attributes Model attributes in the form of hash
65
+ def initialize(attributes = {})
66
+ if (!attributes.is_a?(Hash))
67
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::PhoneNumberStockWatch` initialize method"
68
+ end
69
+
70
+ # check to see if the attribute exists and convert string to symbol for hash key
71
+ acceptable_attribute_map = self.class.acceptable_attribute_map
72
+ attributes = attributes.each_with_object({}) { |(k, v), h|
73
+ if (!acceptable_attribute_map.key?(k.to_sym))
74
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::PhoneNumberStockWatch`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
75
+ end
76
+ h[k.to_sym] = v
77
+ }
78
+
79
+ if attributes.key?(:'id')
80
+ self.id = attributes[:'id']
81
+ else
82
+ self.id = nil
83
+ end
84
+
85
+ if attributes.key?(:'country')
86
+ self.country = attributes[:'country']
87
+ else
88
+ self.country = nil
89
+ end
90
+
91
+ if attributes.key?(:'country_name')
92
+ self.country_name = attributes[:'country_name']
93
+ else
94
+ self.country_name = nil
95
+ end
96
+
97
+ if attributes.key?(:'created_at')
98
+ self.created_at = attributes[:'created_at']
99
+ else
100
+ self.created_at = nil
101
+ end
102
+ end
103
+
104
+ # Show invalid properties with the reasons. Usually used together with valid?
105
+ # @return Array for valid properties with the reasons
106
+ def list_invalid_properties
107
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
108
+ invalid_properties = Array.new
109
+ if @id.nil?
110
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
111
+ end
112
+
113
+ if @country.nil?
114
+ invalid_properties.push('invalid value for "country", country cannot be nil.')
115
+ end
116
+
117
+ if @country_name.nil?
118
+ invalid_properties.push('invalid value for "country_name", country_name cannot be nil.')
119
+ end
120
+
121
+ if @created_at.nil?
122
+ invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
123
+ end
124
+
125
+ invalid_properties
126
+ end
127
+
128
+ # Check to see if the all the properties in the model are valid
129
+ # @return true if the model is valid
130
+ def valid?
131
+ warn '[DEPRECATED] the `valid?` method is obsolete'
132
+ return false if @id.nil?
133
+ return false if @country.nil?
134
+ return false if @country_name.nil?
135
+ return false if @created_at.nil?
136
+ true
137
+ end
138
+
139
+ # Custom attribute writer method with validation
140
+ # @param [Object] id Value to be assigned
141
+ def id=(id)
142
+ if id.nil?
143
+ fail ArgumentError, 'id cannot be nil'
144
+ end
145
+
146
+ @id = id
147
+ end
148
+
149
+ # Custom attribute writer method with validation
150
+ # @param [Object] country Value to be assigned
151
+ def country=(country)
152
+ if country.nil?
153
+ fail ArgumentError, 'country cannot be nil'
154
+ end
155
+
156
+ @country = country
157
+ end
158
+
159
+ # Custom attribute writer method with validation
160
+ # @param [Object] country_name Value to be assigned
161
+ def country_name=(country_name)
162
+ if country_name.nil?
163
+ fail ArgumentError, 'country_name cannot be nil'
164
+ end
165
+
166
+ @country_name = country_name
167
+ end
168
+
169
+ # Custom attribute writer method with validation
170
+ # @param [Object] created_at Value to be assigned
171
+ def created_at=(created_at)
172
+ if created_at.nil?
173
+ fail ArgumentError, 'created_at cannot be nil'
174
+ end
175
+
176
+ @created_at = created_at
177
+ end
178
+
179
+ # Checks equality by comparing each attribute.
180
+ # @param [Object] Object to be compared
181
+ def ==(o)
182
+ return true if self.equal?(o)
183
+ self.class == o.class &&
184
+ id == o.id &&
185
+ country == o.country &&
186
+ country_name == o.country_name &&
187
+ created_at == o.created_at
188
+ end
189
+
190
+ # @see the `==` method
191
+ # @param [Object] Object to be compared
192
+ def eql?(o)
193
+ self == o
194
+ end
195
+
196
+ # Calculates hash code according to all attributes.
197
+ # @return [Integer] Hash code
198
+ def hash
199
+ [id, country, country_name, created_at].hash
200
+ end
201
+
202
+ # Builds the object from hash
203
+ # @param [Hash] attributes Model attributes in the form of hash
204
+ # @return [Object] Returns the model itself
205
+ def self.build_from_hash(attributes)
206
+ return nil unless attributes.is_a?(Hash)
207
+ attributes = attributes.transform_keys(&:to_sym)
208
+ transformed_hash = {}
209
+ openapi_types.each_pair do |key, type|
210
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
211
+ transformed_hash["#{key}"] = nil
212
+ elsif type =~ /\AArray<(.*)>/i
213
+ # check to ensure the input is an array given that the attribute
214
+ # is documented as an array but the input is not
215
+ if attributes[attribute_map[key]].is_a?(Array)
216
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
217
+ end
218
+ elsif !attributes[attribute_map[key]].nil?
219
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
220
+ end
221
+ end
222
+ new(transformed_hash)
223
+ end
224
+
225
+ # Returns the object in the form of hash
226
+ # @return [Hash] Returns the object in the form of hash
227
+ def to_hash
228
+ hash = {}
229
+ self.class.attribute_map.each_pair do |attr, param|
230
+ value = self.send(attr)
231
+ if value.nil?
232
+ is_nullable = self.class.openapi_nullable.include?(attr)
233
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
234
+ end
235
+
236
+ hash[param] = _to_hash(value)
237
+ end
238
+ hash
239
+ end
240
+
241
+ end
242
+
243
+ end