pnap_ip_api 2.2.0 → 2.3.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.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/docs/IpBlock.md +1 -1
- data/docs/IpBlockCreate.md +1 -1
- data/lib/pnap_ip_api/api/ip_blocks_api.rb +7 -7
- data/lib/pnap_ip_api/api_client.rb +17 -14
- data/lib/pnap_ip_api/api_error.rb +1 -1
- data/lib/pnap_ip_api/api_model_base.rb +88 -0
- data/lib/pnap_ip_api/configuration.rb +11 -1
- data/lib/pnap_ip_api/models/delete_ip_block_result.rb +11 -78
- data/lib/pnap_ip_api/models/error.rb +21 -78
- data/lib/pnap_ip_api/models/ip_block.rb +12 -79
- data/lib/pnap_ip_api/models/ip_block_create.rb +32 -79
- data/lib/pnap_ip_api/models/ip_block_patch.rb +11 -78
- data/lib/pnap_ip_api/models/tag_assignment.rb +41 -78
- data/lib/pnap_ip_api/models/tag_assignment_request.rb +21 -78
- data/lib/pnap_ip_api/version.rb +1 -2
- data/lib/pnap_ip_api.rb +2 -1
- data/pnap_ip_api.gemspec +6 -6
- data/spec/api/ip_blocks_api_spec.rb +1 -1
- data/spec/models/delete_ip_block_result_spec.rb +2 -2
- data/spec/models/error_spec.rb +2 -2
- data/spec/models/ip_block_create_spec.rb +2 -2
- data/spec/models/ip_block_patch_spec.rb +2 -2
- data/spec/models/ip_block_spec.rb +2 -2
- data/spec/models/tag_assignment_request_spec.rb +2 -2
- data/spec/models/tag_assignment_spec.rb +2 -2
- data/spec/spec_helper.rb +1 -1
- metadata +13 -9
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
The version of the OpenAPI document: 1.0
|
|
7
7
|
Contact: support@phoenixnap.com
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
|
-
|
|
9
|
+
Generator version: 7.20.0
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
@@ -15,11 +15,11 @@ require 'time'
|
|
|
15
15
|
|
|
16
16
|
module IpApi
|
|
17
17
|
# IP Block Details.
|
|
18
|
-
class IpBlock
|
|
18
|
+
class IpBlock < ApiModelBase
|
|
19
19
|
# IP Block identifier.
|
|
20
20
|
attr_accessor :id
|
|
21
21
|
|
|
22
|
-
# IP Block location ID. Currently this field should be set to `PHX`, `ASH`, `SGP`, `NLD`, `CHI
|
|
22
|
+
# IP Block location ID. Currently this field should be set to `PHX`, `ASH`, `SGP`, `NLD`, `CHI` or `SEA`.
|
|
23
23
|
attr_accessor :location
|
|
24
24
|
|
|
25
25
|
# CIDR IP Block Size. Currently this field should be set to either `/31`, `/30`, `/29`, `/28`, `/27`, `/26`, `/25`, `/24`, `/23` or `/22`.
|
|
@@ -78,9 +78,14 @@ module IpApi
|
|
|
78
78
|
}
|
|
79
79
|
end
|
|
80
80
|
|
|
81
|
+
# Returns attribute mapping this model knows about
|
|
82
|
+
def self.acceptable_attribute_map
|
|
83
|
+
attribute_map
|
|
84
|
+
end
|
|
85
|
+
|
|
81
86
|
# Returns all the JSON keys this model knows about
|
|
82
87
|
def self.acceptable_attributes
|
|
83
|
-
|
|
88
|
+
acceptable_attribute_map.values
|
|
84
89
|
end
|
|
85
90
|
|
|
86
91
|
# Attribute type mapping.
|
|
@@ -117,9 +122,10 @@ module IpApi
|
|
|
117
122
|
end
|
|
118
123
|
|
|
119
124
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
125
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
120
126
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
121
|
-
if (!
|
|
122
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `IpApi::IpBlock`. Please check the name to make sure it's valid. List of attributes: " +
|
|
127
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
128
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `IpApi::IpBlock`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
123
129
|
end
|
|
124
130
|
h[k.to_sym] = v
|
|
125
131
|
}
|
|
@@ -273,61 +279,6 @@ module IpApi
|
|
|
273
279
|
new(transformed_hash)
|
|
274
280
|
end
|
|
275
281
|
|
|
276
|
-
# Deserializes the data based on type
|
|
277
|
-
# @param string type Data type
|
|
278
|
-
# @param string value Value to be deserialized
|
|
279
|
-
# @return [Object] Deserialized data
|
|
280
|
-
def self._deserialize(type, value)
|
|
281
|
-
case type.to_sym
|
|
282
|
-
when :Time
|
|
283
|
-
Time.parse(value)
|
|
284
|
-
when :Date
|
|
285
|
-
Date.parse(value)
|
|
286
|
-
when :String
|
|
287
|
-
value.to_s
|
|
288
|
-
when :Integer
|
|
289
|
-
value.to_i
|
|
290
|
-
when :Float
|
|
291
|
-
value.to_f
|
|
292
|
-
when :Boolean
|
|
293
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
294
|
-
true
|
|
295
|
-
else
|
|
296
|
-
false
|
|
297
|
-
end
|
|
298
|
-
when :Object
|
|
299
|
-
# generic object (usually a Hash), return directly
|
|
300
|
-
value
|
|
301
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
302
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
303
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
304
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
305
|
-
k_type = Regexp.last_match[:k_type]
|
|
306
|
-
v_type = Regexp.last_match[:v_type]
|
|
307
|
-
{}.tap do |hash|
|
|
308
|
-
value.each do |k, v|
|
|
309
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
310
|
-
end
|
|
311
|
-
end
|
|
312
|
-
else # model
|
|
313
|
-
# models (e.g. Pet) or oneOf
|
|
314
|
-
klass = IpApi.const_get(type)
|
|
315
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
316
|
-
end
|
|
317
|
-
end
|
|
318
|
-
|
|
319
|
-
# Returns the string representation of the object
|
|
320
|
-
# @return [String] String presentation of the object
|
|
321
|
-
def to_s
|
|
322
|
-
to_hash.to_s
|
|
323
|
-
end
|
|
324
|
-
|
|
325
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
326
|
-
# @return [Hash] Returns the object in the form of hash
|
|
327
|
-
def to_body
|
|
328
|
-
to_hash
|
|
329
|
-
end
|
|
330
|
-
|
|
331
282
|
# Returns the object in the form of hash
|
|
332
283
|
# @return [Hash] Returns the object in the form of hash
|
|
333
284
|
def to_hash
|
|
@@ -344,24 +295,6 @@ module IpApi
|
|
|
344
295
|
hash
|
|
345
296
|
end
|
|
346
297
|
|
|
347
|
-
# Outputs non-array value in the form of hash
|
|
348
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
349
|
-
# @param [Object] value Any valid value
|
|
350
|
-
# @return [Hash] Returns the value in the form of hash
|
|
351
|
-
def _to_hash(value)
|
|
352
|
-
if value.is_a?(Array)
|
|
353
|
-
value.compact.map { |v| _to_hash(v) }
|
|
354
|
-
elsif value.is_a?(Hash)
|
|
355
|
-
{}.tap do |hash|
|
|
356
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
357
|
-
end
|
|
358
|
-
elsif value.respond_to? :to_hash
|
|
359
|
-
value.to_hash
|
|
360
|
-
else
|
|
361
|
-
value
|
|
362
|
-
end
|
|
363
|
-
end
|
|
364
|
-
|
|
365
298
|
end
|
|
366
299
|
|
|
367
300
|
end
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
The version of the OpenAPI document: 1.0
|
|
7
7
|
Contact: support@phoenixnap.com
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
|
-
|
|
9
|
+
Generator version: 7.20.0
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
@@ -15,8 +15,8 @@ require 'time'
|
|
|
15
15
|
|
|
16
16
|
module IpApi
|
|
17
17
|
# IP Block Request.
|
|
18
|
-
class IpBlockCreate
|
|
19
|
-
# IP Block location ID. Currently this field should be set to `PHX`, `ASH`, `SGP`, `NLD`, `CHI
|
|
18
|
+
class IpBlockCreate < ApiModelBase
|
|
19
|
+
# IP Block location ID. Currently this field should be set to `PHX`, `ASH`, `SGP`, `NLD`, `CHI` or `SEA`.
|
|
20
20
|
attr_accessor :location
|
|
21
21
|
|
|
22
22
|
# CIDR IP Block Size. V4 supported sizes: [`/31`, `/30`, `/29` or `/28`]. V6 supported sizes: [`/64`]. For a larger Block Size contact support.
|
|
@@ -42,9 +42,14 @@ module IpApi
|
|
|
42
42
|
}
|
|
43
43
|
end
|
|
44
44
|
|
|
45
|
+
# Returns attribute mapping this model knows about
|
|
46
|
+
def self.acceptable_attribute_map
|
|
47
|
+
attribute_map
|
|
48
|
+
end
|
|
49
|
+
|
|
45
50
|
# Returns all the JSON keys this model knows about
|
|
46
51
|
def self.acceptable_attributes
|
|
47
|
-
|
|
52
|
+
acceptable_attribute_map.values
|
|
48
53
|
end
|
|
49
54
|
|
|
50
55
|
# Attribute type mapping.
|
|
@@ -72,9 +77,10 @@ module IpApi
|
|
|
72
77
|
end
|
|
73
78
|
|
|
74
79
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
80
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
75
81
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
76
|
-
if (!
|
|
77
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `IpApi::IpBlockCreate`. Please check the name to make sure it's valid. List of attributes: " +
|
|
82
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
83
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `IpApi::IpBlockCreate`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
78
84
|
end
|
|
79
85
|
h[k.to_sym] = v
|
|
80
86
|
}
|
|
@@ -138,6 +144,26 @@ module IpApi
|
|
|
138
144
|
true
|
|
139
145
|
end
|
|
140
146
|
|
|
147
|
+
# Custom attribute writer method with validation
|
|
148
|
+
# @param [Object] location Value to be assigned
|
|
149
|
+
def location=(location)
|
|
150
|
+
if location.nil?
|
|
151
|
+
fail ArgumentError, 'location cannot be nil'
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
@location = location
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
# Custom attribute writer method with validation
|
|
158
|
+
# @param [Object] cidr_block_size Value to be assigned
|
|
159
|
+
def cidr_block_size=(cidr_block_size)
|
|
160
|
+
if cidr_block_size.nil?
|
|
161
|
+
fail ArgumentError, 'cidr_block_size cannot be nil'
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
@cidr_block_size = cidr_block_size
|
|
165
|
+
end
|
|
166
|
+
|
|
141
167
|
# Custom attribute writer method with validation
|
|
142
168
|
# @param [Object] description Value to be assigned
|
|
143
169
|
def description=(description)
|
|
@@ -199,61 +225,6 @@ module IpApi
|
|
|
199
225
|
new(transformed_hash)
|
|
200
226
|
end
|
|
201
227
|
|
|
202
|
-
# Deserializes the data based on type
|
|
203
|
-
# @param string type Data type
|
|
204
|
-
# @param string value Value to be deserialized
|
|
205
|
-
# @return [Object] Deserialized data
|
|
206
|
-
def self._deserialize(type, value)
|
|
207
|
-
case type.to_sym
|
|
208
|
-
when :Time
|
|
209
|
-
Time.parse(value)
|
|
210
|
-
when :Date
|
|
211
|
-
Date.parse(value)
|
|
212
|
-
when :String
|
|
213
|
-
value.to_s
|
|
214
|
-
when :Integer
|
|
215
|
-
value.to_i
|
|
216
|
-
when :Float
|
|
217
|
-
value.to_f
|
|
218
|
-
when :Boolean
|
|
219
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
220
|
-
true
|
|
221
|
-
else
|
|
222
|
-
false
|
|
223
|
-
end
|
|
224
|
-
when :Object
|
|
225
|
-
# generic object (usually a Hash), return directly
|
|
226
|
-
value
|
|
227
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
228
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
229
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
230
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
231
|
-
k_type = Regexp.last_match[:k_type]
|
|
232
|
-
v_type = Regexp.last_match[:v_type]
|
|
233
|
-
{}.tap do |hash|
|
|
234
|
-
value.each do |k, v|
|
|
235
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
236
|
-
end
|
|
237
|
-
end
|
|
238
|
-
else # model
|
|
239
|
-
# models (e.g. Pet) or oneOf
|
|
240
|
-
klass = IpApi.const_get(type)
|
|
241
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
242
|
-
end
|
|
243
|
-
end
|
|
244
|
-
|
|
245
|
-
# Returns the string representation of the object
|
|
246
|
-
# @return [String] String presentation of the object
|
|
247
|
-
def to_s
|
|
248
|
-
to_hash.to_s
|
|
249
|
-
end
|
|
250
|
-
|
|
251
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
252
|
-
# @return [Hash] Returns the object in the form of hash
|
|
253
|
-
def to_body
|
|
254
|
-
to_hash
|
|
255
|
-
end
|
|
256
|
-
|
|
257
228
|
# Returns the object in the form of hash
|
|
258
229
|
# @return [Hash] Returns the object in the form of hash
|
|
259
230
|
def to_hash
|
|
@@ -270,24 +241,6 @@ module IpApi
|
|
|
270
241
|
hash
|
|
271
242
|
end
|
|
272
243
|
|
|
273
|
-
# Outputs non-array value in the form of hash
|
|
274
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
275
|
-
# @param [Object] value Any valid value
|
|
276
|
-
# @return [Hash] Returns the value in the form of hash
|
|
277
|
-
def _to_hash(value)
|
|
278
|
-
if value.is_a?(Array)
|
|
279
|
-
value.compact.map { |v| _to_hash(v) }
|
|
280
|
-
elsif value.is_a?(Hash)
|
|
281
|
-
{}.tap do |hash|
|
|
282
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
283
|
-
end
|
|
284
|
-
elsif value.respond_to? :to_hash
|
|
285
|
-
value.to_hash
|
|
286
|
-
else
|
|
287
|
-
value
|
|
288
|
-
end
|
|
289
|
-
end
|
|
290
|
-
|
|
291
244
|
end
|
|
292
245
|
|
|
293
246
|
end
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
The version of the OpenAPI document: 1.0
|
|
7
7
|
Contact: support@phoenixnap.com
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
|
-
|
|
9
|
+
Generator version: 7.20.0
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
@@ -15,7 +15,7 @@ require 'time'
|
|
|
15
15
|
|
|
16
16
|
module IpApi
|
|
17
17
|
# IP Block patch.
|
|
18
|
-
class IpBlockPatch
|
|
18
|
+
class IpBlockPatch < ApiModelBase
|
|
19
19
|
# The description of the Ip Block.
|
|
20
20
|
attr_accessor :description
|
|
21
21
|
|
|
@@ -26,9 +26,14 @@ module IpApi
|
|
|
26
26
|
}
|
|
27
27
|
end
|
|
28
28
|
|
|
29
|
+
# Returns attribute mapping this model knows about
|
|
30
|
+
def self.acceptable_attribute_map
|
|
31
|
+
attribute_map
|
|
32
|
+
end
|
|
33
|
+
|
|
29
34
|
# Returns all the JSON keys this model knows about
|
|
30
35
|
def self.acceptable_attributes
|
|
31
|
-
|
|
36
|
+
acceptable_attribute_map.values
|
|
32
37
|
end
|
|
33
38
|
|
|
34
39
|
# Attribute type mapping.
|
|
@@ -52,9 +57,10 @@ module IpApi
|
|
|
52
57
|
end
|
|
53
58
|
|
|
54
59
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
60
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
55
61
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
56
|
-
if (!
|
|
57
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `IpApi::IpBlockPatch`. Please check the name to make sure it's valid. List of attributes: " +
|
|
62
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
63
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `IpApi::IpBlockPatch`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
58
64
|
end
|
|
59
65
|
h[k.to_sym] = v
|
|
60
66
|
}
|
|
@@ -141,61 +147,6 @@ module IpApi
|
|
|
141
147
|
new(transformed_hash)
|
|
142
148
|
end
|
|
143
149
|
|
|
144
|
-
# Deserializes the data based on type
|
|
145
|
-
# @param string type Data type
|
|
146
|
-
# @param string value Value to be deserialized
|
|
147
|
-
# @return [Object] Deserialized data
|
|
148
|
-
def self._deserialize(type, value)
|
|
149
|
-
case type.to_sym
|
|
150
|
-
when :Time
|
|
151
|
-
Time.parse(value)
|
|
152
|
-
when :Date
|
|
153
|
-
Date.parse(value)
|
|
154
|
-
when :String
|
|
155
|
-
value.to_s
|
|
156
|
-
when :Integer
|
|
157
|
-
value.to_i
|
|
158
|
-
when :Float
|
|
159
|
-
value.to_f
|
|
160
|
-
when :Boolean
|
|
161
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
162
|
-
true
|
|
163
|
-
else
|
|
164
|
-
false
|
|
165
|
-
end
|
|
166
|
-
when :Object
|
|
167
|
-
# generic object (usually a Hash), return directly
|
|
168
|
-
value
|
|
169
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
170
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
171
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
172
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
173
|
-
k_type = Regexp.last_match[:k_type]
|
|
174
|
-
v_type = Regexp.last_match[:v_type]
|
|
175
|
-
{}.tap do |hash|
|
|
176
|
-
value.each do |k, v|
|
|
177
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
178
|
-
end
|
|
179
|
-
end
|
|
180
|
-
else # model
|
|
181
|
-
# models (e.g. Pet) or oneOf
|
|
182
|
-
klass = IpApi.const_get(type)
|
|
183
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
184
|
-
end
|
|
185
|
-
end
|
|
186
|
-
|
|
187
|
-
# Returns the string representation of the object
|
|
188
|
-
# @return [String] String presentation of the object
|
|
189
|
-
def to_s
|
|
190
|
-
to_hash.to_s
|
|
191
|
-
end
|
|
192
|
-
|
|
193
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
194
|
-
# @return [Hash] Returns the object in the form of hash
|
|
195
|
-
def to_body
|
|
196
|
-
to_hash
|
|
197
|
-
end
|
|
198
|
-
|
|
199
150
|
# Returns the object in the form of hash
|
|
200
151
|
# @return [Hash] Returns the object in the form of hash
|
|
201
152
|
def to_hash
|
|
@@ -212,24 +163,6 @@ module IpApi
|
|
|
212
163
|
hash
|
|
213
164
|
end
|
|
214
165
|
|
|
215
|
-
# Outputs non-array value in the form of hash
|
|
216
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
217
|
-
# @param [Object] value Any valid value
|
|
218
|
-
# @return [Hash] Returns the value in the form of hash
|
|
219
|
-
def _to_hash(value)
|
|
220
|
-
if value.is_a?(Array)
|
|
221
|
-
value.compact.map { |v| _to_hash(v) }
|
|
222
|
-
elsif value.is_a?(Hash)
|
|
223
|
-
{}.tap do |hash|
|
|
224
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
225
|
-
end
|
|
226
|
-
elsif value.respond_to? :to_hash
|
|
227
|
-
value.to_hash
|
|
228
|
-
else
|
|
229
|
-
value
|
|
230
|
-
end
|
|
231
|
-
end
|
|
232
|
-
|
|
233
166
|
end
|
|
234
167
|
|
|
235
168
|
end
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
The version of the OpenAPI document: 1.0
|
|
7
7
|
Contact: support@phoenixnap.com
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
|
-
|
|
9
|
+
Generator version: 7.20.0
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
@@ -15,7 +15,7 @@ require 'time'
|
|
|
15
15
|
|
|
16
16
|
module IpApi
|
|
17
17
|
# Tag assigned to resource.
|
|
18
|
-
class TagAssignment
|
|
18
|
+
class TagAssignment < ApiModelBase
|
|
19
19
|
# The unique id of the tag.
|
|
20
20
|
attr_accessor :id
|
|
21
21
|
|
|
@@ -64,9 +64,14 @@ module IpApi
|
|
|
64
64
|
}
|
|
65
65
|
end
|
|
66
66
|
|
|
67
|
+
# Returns attribute mapping this model knows about
|
|
68
|
+
def self.acceptable_attribute_map
|
|
69
|
+
attribute_map
|
|
70
|
+
end
|
|
71
|
+
|
|
67
72
|
# Returns all the JSON keys this model knows about
|
|
68
73
|
def self.acceptable_attributes
|
|
69
|
-
|
|
74
|
+
acceptable_attribute_map.values
|
|
70
75
|
end
|
|
71
76
|
|
|
72
77
|
# Attribute type mapping.
|
|
@@ -94,9 +99,10 @@ module IpApi
|
|
|
94
99
|
end
|
|
95
100
|
|
|
96
101
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
102
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
97
103
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
98
|
-
if (!
|
|
99
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `IpApi::TagAssignment`. Please check the name to make sure it's valid. List of attributes: " +
|
|
104
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
105
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `IpApi::TagAssignment`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
100
106
|
end
|
|
101
107
|
h[k.to_sym] = v
|
|
102
108
|
}
|
|
@@ -160,6 +166,36 @@ module IpApi
|
|
|
160
166
|
true
|
|
161
167
|
end
|
|
162
168
|
|
|
169
|
+
# Custom attribute writer method with validation
|
|
170
|
+
# @param [Object] id Value to be assigned
|
|
171
|
+
def id=(id)
|
|
172
|
+
if id.nil?
|
|
173
|
+
fail ArgumentError, 'id cannot be nil'
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
@id = id
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
# Custom attribute writer method with validation
|
|
180
|
+
# @param [Object] name Value to be assigned
|
|
181
|
+
def name=(name)
|
|
182
|
+
if name.nil?
|
|
183
|
+
fail ArgumentError, 'name cannot be nil'
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
@name = name
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
# Custom attribute writer method with validation
|
|
190
|
+
# @param [Object] is_billing_tag Value to be assigned
|
|
191
|
+
def is_billing_tag=(is_billing_tag)
|
|
192
|
+
if is_billing_tag.nil?
|
|
193
|
+
fail ArgumentError, 'is_billing_tag cannot be nil'
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
@is_billing_tag = is_billing_tag
|
|
197
|
+
end
|
|
198
|
+
|
|
163
199
|
# Custom attribute writer method checking allowed values (enum).
|
|
164
200
|
# @param [Object] created_by Object to be assigned
|
|
165
201
|
def created_by=(created_by)
|
|
@@ -217,61 +253,6 @@ module IpApi
|
|
|
217
253
|
new(transformed_hash)
|
|
218
254
|
end
|
|
219
255
|
|
|
220
|
-
# Deserializes the data based on type
|
|
221
|
-
# @param string type Data type
|
|
222
|
-
# @param string value Value to be deserialized
|
|
223
|
-
# @return [Object] Deserialized data
|
|
224
|
-
def self._deserialize(type, value)
|
|
225
|
-
case type.to_sym
|
|
226
|
-
when :Time
|
|
227
|
-
Time.parse(value)
|
|
228
|
-
when :Date
|
|
229
|
-
Date.parse(value)
|
|
230
|
-
when :String
|
|
231
|
-
value.to_s
|
|
232
|
-
when :Integer
|
|
233
|
-
value.to_i
|
|
234
|
-
when :Float
|
|
235
|
-
value.to_f
|
|
236
|
-
when :Boolean
|
|
237
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
238
|
-
true
|
|
239
|
-
else
|
|
240
|
-
false
|
|
241
|
-
end
|
|
242
|
-
when :Object
|
|
243
|
-
# generic object (usually a Hash), return directly
|
|
244
|
-
value
|
|
245
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
246
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
247
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
248
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
249
|
-
k_type = Regexp.last_match[:k_type]
|
|
250
|
-
v_type = Regexp.last_match[:v_type]
|
|
251
|
-
{}.tap do |hash|
|
|
252
|
-
value.each do |k, v|
|
|
253
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
254
|
-
end
|
|
255
|
-
end
|
|
256
|
-
else # model
|
|
257
|
-
# models (e.g. Pet) or oneOf
|
|
258
|
-
klass = IpApi.const_get(type)
|
|
259
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
260
|
-
end
|
|
261
|
-
end
|
|
262
|
-
|
|
263
|
-
# Returns the string representation of the object
|
|
264
|
-
# @return [String] String presentation of the object
|
|
265
|
-
def to_s
|
|
266
|
-
to_hash.to_s
|
|
267
|
-
end
|
|
268
|
-
|
|
269
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
270
|
-
# @return [Hash] Returns the object in the form of hash
|
|
271
|
-
def to_body
|
|
272
|
-
to_hash
|
|
273
|
-
end
|
|
274
|
-
|
|
275
256
|
# Returns the object in the form of hash
|
|
276
257
|
# @return [Hash] Returns the object in the form of hash
|
|
277
258
|
def to_hash
|
|
@@ -288,24 +269,6 @@ module IpApi
|
|
|
288
269
|
hash
|
|
289
270
|
end
|
|
290
271
|
|
|
291
|
-
# Outputs non-array value in the form of hash
|
|
292
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
293
|
-
# @param [Object] value Any valid value
|
|
294
|
-
# @return [Hash] Returns the value in the form of hash
|
|
295
|
-
def _to_hash(value)
|
|
296
|
-
if value.is_a?(Array)
|
|
297
|
-
value.compact.map { |v| _to_hash(v) }
|
|
298
|
-
elsif value.is_a?(Hash)
|
|
299
|
-
{}.tap do |hash|
|
|
300
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
301
|
-
end
|
|
302
|
-
elsif value.respond_to? :to_hash
|
|
303
|
-
value.to_hash
|
|
304
|
-
else
|
|
305
|
-
value
|
|
306
|
-
end
|
|
307
|
-
end
|
|
308
|
-
|
|
309
272
|
end
|
|
310
273
|
|
|
311
274
|
end
|