vpndetection 4.0.1 → 5.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 (59) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +24 -4
  3. data/lib/vpndetection/api/account_wire_api.rb +16 -16
  4. data/lib/vpndetection/api/api_keys_wire_api.rb +336 -0
  5. data/lib/vpndetection/api/authorization_wire_api.rb +421 -0
  6. data/lib/vpndetection/api/database_wire_api.rb +1 -1
  7. data/lib/vpndetection/api/entitlement_wire_api.rb +79 -0
  8. data/lib/vpndetection/api/lookup_wire_api.rb +71 -3
  9. data/lib/vpndetection/api/organization_wire_api.rb +136 -0
  10. data/lib/vpndetection/api_client.rb +1 -1
  11. data/lib/vpndetection/api_error.rb +1 -1
  12. data/lib/vpndetection/api_model_base.rb +1 -1
  13. data/lib/vpndetection/client.rb +57 -26
  14. data/lib/vpndetection/configuration.rb +1 -1
  15. data/lib/vpndetection/errors.rb +7 -0
  16. data/lib/vpndetection/models/account_create_apikey_request.rb +177 -0
  17. data/lib/vpndetection/models/account_created_apikey.rb +257 -0
  18. data/lib/vpndetection/models/account_org.rb +183 -0
  19. data/lib/vpndetection/models/account_org_ref.rb +164 -0
  20. data/lib/vpndetection/models/account_org_wrap.rb +190 -0
  21. data/lib/vpndetection/models/account_rc.rb +165 -0
  22. data/lib/vpndetection/models/account_revealed_apikey.rb +191 -0
  23. data/lib/vpndetection/models/account_user.rb +182 -0
  24. data/lib/vpndetection/models/apikey_detail.rb +307 -0
  25. data/lib/vpndetection/models/apikey_list.rb +192 -0
  26. data/lib/vpndetection/models/batch_lookup_error.rb +193 -0
  27. data/lib/vpndetection/models/batch_lookup_request.rb +185 -0
  28. data/lib/vpndetection/models/batch_lookup_response.rb +196 -0
  29. data/lib/vpndetection/models/class_detail.rb +1 -1
  30. data/lib/vpndetection/models/database.rb +1 -1
  31. data/lib/vpndetection/models/database_checksums_response.rb +1 -1
  32. data/lib/vpndetection/models/database_format.rb +1 -1
  33. data/lib/vpndetection/models/database_format_size.rb +2 -2
  34. data/lib/vpndetection/models/database_list.rb +1 -1
  35. data/lib/vpndetection/models/database_metadata.rb +1 -1
  36. data/lib/vpndetection/models/database_metadata_column.rb +1 -1
  37. data/lib/vpndetection/models/database_version.rb +1 -1
  38. data/lib/vpndetection/models/db_checksums.rb +1 -1
  39. data/lib/vpndetection/models/device_authorization.rb +281 -0
  40. data/lib/vpndetection/models/download.rb +2 -2
  41. data/lib/vpndetection/models/download_list.rb +1 -1
  42. data/lib/vpndetection/models/{account_me.rb → entitlement.rb} +7 -7
  43. data/lib/vpndetection/models/{account_apikey.rb → entitlement_apikey.rb} +4 -4
  44. data/lib/vpndetection/models/{account_error.rb → entitlement_error.rb} +4 -4
  45. data/lib/vpndetection/models/{account_plan.rb → entitlement_plan.rb} +4 -4
  46. data/lib/vpndetection/models/{account_usage.rb → entitlement_usage.rb} +4 -4
  47. data/lib/vpndetection/models/error_envelope.rb +1 -1
  48. data/lib/vpndetection/models/identity.rb +245 -0
  49. data/lib/vpndetection/models/lookup_error.rb +1 -1
  50. data/lib/vpndetection/models/lookup_response.rb +1 -1
  51. data/lib/vpndetection/models/oauth_error.rb +173 -0
  52. data/lib/vpndetection/models/oauth_metadata.rb +288 -0
  53. data/lib/vpndetection/models/proxy_detail.rb +1 -1
  54. data/lib/vpndetection/models/standing.rb +1 -1
  55. data/lib/vpndetection/models/token_response.rb +235 -0
  56. data/lib/vpndetection/models/vpn_detail.rb +1 -1
  57. data/lib/vpndetection/transport.rb +28 -5
  58. data/lib/vpndetection/version.rb +1 -1
  59. metadata +28 -6
@@ -0,0 +1,257 @@
1
+ =begin
2
+ #VPNDetection API
3
+
4
+ #The VPNDetection API: classify any IP address, and download the databases behind the answers. See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
5
+
6
+ The version of the OpenAPI document: 2026.09.15
7
+ Contact: support@vpndetection.io
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.25.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module VPNDetection
17
+ class AccountCreatedApikey < ApiModelBase
18
+ attr_accessor :rc
19
+
20
+ attr_accessor :id
21
+
22
+ attr_accessor :name
23
+
24
+ # The secret. Returned once, here, and never again.
25
+ attr_accessor :key
26
+
27
+ attr_accessor :key_prefix
28
+
29
+ attr_accessor :allowed_cidrs
30
+
31
+ attr_accessor :allowed_scopes
32
+
33
+ # Attribute mapping from ruby-style variable name to JSON key.
34
+ def self.attribute_map
35
+ {
36
+ :'rc' => :'rc',
37
+ :'id' => :'id',
38
+ :'name' => :'name',
39
+ :'key' => :'key',
40
+ :'key_prefix' => :'key_prefix',
41
+ :'allowed_cidrs' => :'allowed_cidrs',
42
+ :'allowed_scopes' => :'allowed_scopes'
43
+ }
44
+ end
45
+
46
+ # Returns attribute mapping this model knows about
47
+ def self.acceptable_attribute_map
48
+ attribute_map
49
+ end
50
+
51
+ # Returns all the JSON keys this model knows about
52
+ def self.acceptable_attributes
53
+ acceptable_attribute_map.values
54
+ end
55
+
56
+ # Attribute type mapping.
57
+ def self.openapi_types
58
+ {
59
+ :'rc' => :'String',
60
+ :'id' => :'String',
61
+ :'name' => :'String',
62
+ :'key' => :'String',
63
+ :'key_prefix' => :'String',
64
+ :'allowed_cidrs' => :'Array<String>',
65
+ :'allowed_scopes' => :'Array<String>'
66
+ }
67
+ end
68
+
69
+ # List of attributes with nullable: true
70
+ def self.openapi_nullable
71
+ Set.new([
72
+ ])
73
+ end
74
+
75
+ # Initializes the object
76
+ # @param [Hash] attributes Model attributes in the form of hash
77
+ def initialize(attributes = {})
78
+ if (!attributes.is_a?(Hash))
79
+ fail ArgumentError, "The input argument (attributes) must be a hash in `VPNDetection::AccountCreatedApikey` initialize method"
80
+ end
81
+
82
+ # check to see if the attribute exists and convert string to symbol for hash key
83
+ acceptable_attribute_map = self.class.acceptable_attribute_map
84
+ attributes = attributes.each_with_object({}) { |(k, v), h|
85
+ if (!acceptable_attribute_map.key?(k.to_sym))
86
+ fail ArgumentError, "`#{k}` is not a valid attribute in `VPNDetection::AccountCreatedApikey`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
87
+ end
88
+ h[k.to_sym] = v
89
+ }
90
+
91
+ if attributes.key?(:'rc')
92
+ self.rc = attributes[:'rc']
93
+ else
94
+ self.rc = nil
95
+ end
96
+
97
+ if attributes.key?(:'id')
98
+ self.id = attributes[:'id']
99
+ else
100
+ self.id = nil
101
+ end
102
+
103
+ if attributes.key?(:'name')
104
+ self.name = attributes[:'name']
105
+ end
106
+
107
+ if attributes.key?(:'key')
108
+ self.key = attributes[:'key']
109
+ else
110
+ self.key = nil
111
+ end
112
+
113
+ if attributes.key?(:'key_prefix')
114
+ self.key_prefix = attributes[:'key_prefix']
115
+ end
116
+
117
+ if attributes.key?(:'allowed_cidrs')
118
+ if (value = attributes[:'allowed_cidrs']).is_a?(Array)
119
+ self.allowed_cidrs = value
120
+ end
121
+ end
122
+
123
+ if attributes.key?(:'allowed_scopes')
124
+ if (value = attributes[:'allowed_scopes']).is_a?(Array)
125
+ self.allowed_scopes = value
126
+ end
127
+ end
128
+ end
129
+
130
+ # Show invalid properties with the reasons. Usually used together with valid?
131
+ # @return Array for valid properties with the reasons
132
+ def list_invalid_properties
133
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
134
+ invalid_properties = Array.new
135
+ if @rc.nil?
136
+ invalid_properties.push('invalid value for "rc", rc cannot be nil.')
137
+ end
138
+
139
+ if @id.nil?
140
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
141
+ end
142
+
143
+ if @key.nil?
144
+ invalid_properties.push('invalid value for "key", key cannot be nil.')
145
+ end
146
+
147
+ invalid_properties
148
+ end
149
+
150
+ # Check to see if the all the properties in the model are valid
151
+ # @return true if the model is valid
152
+ def valid?
153
+ warn '[DEPRECATED] the `valid?` method is obsolete'
154
+ return false if @rc.nil?
155
+ return false if @id.nil?
156
+ return false if @key.nil?
157
+ true
158
+ end
159
+
160
+ # Custom attribute writer method with validation
161
+ # @param [Object] rc Value to be assigned
162
+ def rc=(rc)
163
+ if rc.nil?
164
+ fail ArgumentError, 'rc cannot be nil'
165
+ end
166
+
167
+ @rc = rc
168
+ end
169
+
170
+ # Custom attribute writer method with validation
171
+ # @param [Object] id Value to be assigned
172
+ def id=(id)
173
+ if id.nil?
174
+ fail ArgumentError, 'id cannot be nil'
175
+ end
176
+
177
+ @id = id
178
+ end
179
+
180
+ # Custom attribute writer method with validation
181
+ # @param [Object] key Value to be assigned
182
+ def key=(key)
183
+ if key.nil?
184
+ fail ArgumentError, 'key cannot be nil'
185
+ end
186
+
187
+ @key = key
188
+ end
189
+
190
+ # Checks equality by comparing each attribute.
191
+ # @param [Object] Object to be compared
192
+ def ==(o)
193
+ return true if self.equal?(o)
194
+ self.class == o.class &&
195
+ rc == o.rc &&
196
+ id == o.id &&
197
+ name == o.name &&
198
+ key == o.key &&
199
+ key_prefix == o.key_prefix &&
200
+ allowed_cidrs == o.allowed_cidrs &&
201
+ allowed_scopes == o.allowed_scopes
202
+ end
203
+
204
+ # @see the `==` method
205
+ # @param [Object] Object to be compared
206
+ def eql?(o)
207
+ self == o
208
+ end
209
+
210
+ # Calculates hash code according to all attributes.
211
+ # @return [Integer] Hash code
212
+ def hash
213
+ [rc, id, name, key, key_prefix, allowed_cidrs, allowed_scopes].hash
214
+ end
215
+
216
+ # Builds the object from hash
217
+ # @param [Hash] attributes Model attributes in the form of hash
218
+ # @return [Object] Returns the model itself
219
+ def self.build_from_hash(attributes)
220
+ return nil unless attributes.is_a?(Hash)
221
+ attributes = attributes.transform_keys(&:to_sym)
222
+ transformed_hash = {}
223
+ openapi_types.each_pair do |key, type|
224
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
225
+ transformed_hash["#{key}"] = nil
226
+ elsif type =~ /\AArray<(.*)>/i
227
+ # check to ensure the input is an array given that the attribute
228
+ # is documented as an array but the input is not
229
+ if attributes[attribute_map[key]].is_a?(Array)
230
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
231
+ end
232
+ elsif !attributes[attribute_map[key]].nil?
233
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
234
+ end
235
+ end
236
+ new(transformed_hash)
237
+ end
238
+
239
+ # Returns the object in the form of hash
240
+ # @return [Hash] Returns the object in the form of hash
241
+ def to_hash
242
+ hash = {}
243
+ self.class.attribute_map.each_pair do |attr, param|
244
+ value = self.send(attr)
245
+ if value.nil?
246
+ is_nullable = self.class.openapi_nullable.include?(attr)
247
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
248
+ end
249
+
250
+ hash[param] = _to_hash(value)
251
+ end
252
+ hash
253
+ end
254
+
255
+ end
256
+
257
+ end
@@ -0,0 +1,183 @@
1
+ =begin
2
+ #VPNDetection API
3
+
4
+ #The VPNDetection API: classify any IP address, and download the databases behind the answers. See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
5
+
6
+ The version of the OpenAPI document: 2026.09.15
7
+ Contact: support@vpndetection.io
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.25.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module VPNDetection
17
+ class AccountOrg < ApiModelBase
18
+ attr_accessor :id
19
+
20
+ attr_accessor :name
21
+
22
+ attr_accessor :created
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'id' => :'id',
28
+ :'name' => :'name',
29
+ :'created' => :'created'
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
+ :'id' => :'String',
47
+ :'name' => :'String',
48
+ :'created' => :'Time'
49
+ }
50
+ end
51
+
52
+ # List of attributes with nullable: true
53
+ def self.openapi_nullable
54
+ Set.new([
55
+ :'created'
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 `VPNDetection::AccountOrg` 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 `VPNDetection::AccountOrg`. 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?(:'id')
76
+ self.id = attributes[:'id']
77
+ else
78
+ self.id = nil
79
+ end
80
+
81
+ if attributes.key?(:'name')
82
+ self.name = attributes[:'name']
83
+ end
84
+
85
+ if attributes.key?(:'created')
86
+ self.created = attributes[:'created']
87
+ end
88
+ end
89
+
90
+ # Show invalid properties with the reasons. Usually used together with valid?
91
+ # @return Array for valid properties with the reasons
92
+ def list_invalid_properties
93
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
94
+ invalid_properties = Array.new
95
+ if @id.nil?
96
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
97
+ end
98
+
99
+ invalid_properties
100
+ end
101
+
102
+ # Check to see if the all the properties in the model are valid
103
+ # @return true if the model is valid
104
+ def valid?
105
+ warn '[DEPRECATED] the `valid?` method is obsolete'
106
+ return false if @id.nil?
107
+ true
108
+ end
109
+
110
+ # Custom attribute writer method with validation
111
+ # @param [Object] id Value to be assigned
112
+ def id=(id)
113
+ if id.nil?
114
+ fail ArgumentError, 'id cannot be nil'
115
+ end
116
+
117
+ @id = id
118
+ end
119
+
120
+ # Checks equality by comparing each attribute.
121
+ # @param [Object] Object to be compared
122
+ def ==(o)
123
+ return true if self.equal?(o)
124
+ self.class == o.class &&
125
+ id == o.id &&
126
+ name == o.name &&
127
+ created == o.created
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
+ [id, name, created].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,164 @@
1
+ =begin
2
+ #VPNDetection API
3
+
4
+ #The VPNDetection API: classify any IP address, and download the databases behind the answers. See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
5
+
6
+ The version of the OpenAPI document: 2026.09.15
7
+ Contact: support@vpndetection.io
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.25.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module VPNDetection
17
+ class AccountOrgRef < ApiModelBase
18
+ attr_accessor :id
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'id' => :'id'
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
+ :'id' => :'String'
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 `VPNDetection::AccountOrgRef` 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 `VPNDetection::AccountOrgRef`. 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?(:'id')
67
+ self.id = attributes[:'id']
68
+ else
69
+ self.id = nil
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
+ if @id.nil?
79
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
80
+ end
81
+
82
+ invalid_properties
83
+ end
84
+
85
+ # Check to see if the all the properties in the model are valid
86
+ # @return true if the model is valid
87
+ def valid?
88
+ warn '[DEPRECATED] the `valid?` method is obsolete'
89
+ return false if @id.nil?
90
+ true
91
+ end
92
+
93
+ # Custom attribute writer method with validation
94
+ # @param [Object] id Value to be assigned
95
+ def id=(id)
96
+ if id.nil?
97
+ fail ArgumentError, 'id cannot be nil'
98
+ end
99
+
100
+ @id = id
101
+ end
102
+
103
+ # Checks equality by comparing each attribute.
104
+ # @param [Object] Object to be compared
105
+ def ==(o)
106
+ return true if self.equal?(o)
107
+ self.class == o.class &&
108
+ id == o.id
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
+ [id].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
+ # Returns the object in the form of hash
147
+ # @return [Hash] Returns the object in the form of hash
148
+ def to_hash
149
+ hash = {}
150
+ self.class.attribute_map.each_pair do |attr, param|
151
+ value = self.send(attr)
152
+ if value.nil?
153
+ is_nullable = self.class.openapi_nullable.include?(attr)
154
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
155
+ end
156
+
157
+ hash[param] = _to_hash(value)
158
+ end
159
+ hash
160
+ end
161
+
162
+ end
163
+
164
+ end