pnap_ip_api 2.1.1 → 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 +6 -2
- 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 +34 -81
- 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 +14 -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 +14 -10
|
@@ -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`.
|
|
@@ -31,9 +31,12 @@ module IpApi
|
|
|
31
31
|
# The IP Version of the block.
|
|
32
32
|
attr_accessor :ip_version
|
|
33
33
|
|
|
34
|
-
# The status of the IP Block. Can have one of the following values: `creating`
|
|
34
|
+
# The status of the IP Block. Can have one of the following values: `creating`, `subnetted`, `assigning` , `error assigning` , `assigned` , `unassigning` , `error unassigning` or `unassigned`.
|
|
35
35
|
attr_accessor :status
|
|
36
36
|
|
|
37
|
+
# IP Block parent identifier. If present, this block is subnetted from the parent IP Block.
|
|
38
|
+
attr_accessor :parent_ip_block_allocation_id
|
|
39
|
+
|
|
37
40
|
# ID of the resource assigned to the IP Block.
|
|
38
41
|
attr_accessor :assigned_resource_id
|
|
39
42
|
|
|
@@ -46,6 +49,9 @@ module IpApi
|
|
|
46
49
|
# The tags assigned if any.
|
|
47
50
|
attr_accessor :tags
|
|
48
51
|
|
|
52
|
+
# True if the IP block is a `system managed` block.
|
|
53
|
+
attr_accessor :is_system_managed
|
|
54
|
+
|
|
49
55
|
# True if the IP block is a `bring your own` block.
|
|
50
56
|
attr_accessor :is_bring_your_own
|
|
51
57
|
|
|
@@ -61,18 +67,25 @@ module IpApi
|
|
|
61
67
|
:'cidr' => :'cidr',
|
|
62
68
|
:'ip_version' => :'ipVersion',
|
|
63
69
|
:'status' => :'status',
|
|
70
|
+
:'parent_ip_block_allocation_id' => :'parentIpBlockAllocationId',
|
|
64
71
|
:'assigned_resource_id' => :'assignedResourceId',
|
|
65
72
|
:'assigned_resource_type' => :'assignedResourceType',
|
|
66
73
|
:'description' => :'description',
|
|
67
74
|
:'tags' => :'tags',
|
|
75
|
+
:'is_system_managed' => :'isSystemManaged',
|
|
68
76
|
:'is_bring_your_own' => :'isBringYourOwn',
|
|
69
77
|
:'created_on' => :'createdOn'
|
|
70
78
|
}
|
|
71
79
|
end
|
|
72
80
|
|
|
81
|
+
# Returns attribute mapping this model knows about
|
|
82
|
+
def self.acceptable_attribute_map
|
|
83
|
+
attribute_map
|
|
84
|
+
end
|
|
85
|
+
|
|
73
86
|
# Returns all the JSON keys this model knows about
|
|
74
87
|
def self.acceptable_attributes
|
|
75
|
-
|
|
88
|
+
acceptable_attribute_map.values
|
|
76
89
|
end
|
|
77
90
|
|
|
78
91
|
# Attribute type mapping.
|
|
@@ -84,10 +97,12 @@ module IpApi
|
|
|
84
97
|
:'cidr' => :'String',
|
|
85
98
|
:'ip_version' => :'String',
|
|
86
99
|
:'status' => :'String',
|
|
100
|
+
:'parent_ip_block_allocation_id' => :'String',
|
|
87
101
|
:'assigned_resource_id' => :'String',
|
|
88
102
|
:'assigned_resource_type' => :'String',
|
|
89
103
|
:'description' => :'String',
|
|
90
104
|
:'tags' => :'Array<TagAssignment>',
|
|
105
|
+
:'is_system_managed' => :'Boolean',
|
|
91
106
|
:'is_bring_your_own' => :'Boolean',
|
|
92
107
|
:'created_on' => :'Time'
|
|
93
108
|
}
|
|
@@ -107,9 +122,10 @@ module IpApi
|
|
|
107
122
|
end
|
|
108
123
|
|
|
109
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
|
|
110
126
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
111
|
-
if (!
|
|
112
|
-
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
|
|
113
129
|
end
|
|
114
130
|
h[k.to_sym] = v
|
|
115
131
|
}
|
|
@@ -138,6 +154,10 @@ module IpApi
|
|
|
138
154
|
self.status = attributes[:'status']
|
|
139
155
|
end
|
|
140
156
|
|
|
157
|
+
if attributes.key?(:'parent_ip_block_allocation_id')
|
|
158
|
+
self.parent_ip_block_allocation_id = attributes[:'parent_ip_block_allocation_id']
|
|
159
|
+
end
|
|
160
|
+
|
|
141
161
|
if attributes.key?(:'assigned_resource_id')
|
|
142
162
|
self.assigned_resource_id = attributes[:'assigned_resource_id']
|
|
143
163
|
end
|
|
@@ -156,6 +176,10 @@ module IpApi
|
|
|
156
176
|
end
|
|
157
177
|
end
|
|
158
178
|
|
|
179
|
+
if attributes.key?(:'is_system_managed')
|
|
180
|
+
self.is_system_managed = attributes[:'is_system_managed']
|
|
181
|
+
end
|
|
182
|
+
|
|
159
183
|
if attributes.key?(:'is_bring_your_own')
|
|
160
184
|
self.is_bring_your_own = attributes[:'is_bring_your_own']
|
|
161
185
|
end
|
|
@@ -210,10 +234,12 @@ module IpApi
|
|
|
210
234
|
cidr == o.cidr &&
|
|
211
235
|
ip_version == o.ip_version &&
|
|
212
236
|
status == o.status &&
|
|
237
|
+
parent_ip_block_allocation_id == o.parent_ip_block_allocation_id &&
|
|
213
238
|
assigned_resource_id == o.assigned_resource_id &&
|
|
214
239
|
assigned_resource_type == o.assigned_resource_type &&
|
|
215
240
|
description == o.description &&
|
|
216
241
|
tags == o.tags &&
|
|
242
|
+
is_system_managed == o.is_system_managed &&
|
|
217
243
|
is_bring_your_own == o.is_bring_your_own &&
|
|
218
244
|
created_on == o.created_on
|
|
219
245
|
end
|
|
@@ -227,7 +253,7 @@ module IpApi
|
|
|
227
253
|
# Calculates hash code according to all attributes.
|
|
228
254
|
# @return [Integer] Hash code
|
|
229
255
|
def hash
|
|
230
|
-
[id, location, cidr_block_size, cidr, ip_version, status, assigned_resource_id, assigned_resource_type, description, tags, is_bring_your_own, created_on].hash
|
|
256
|
+
[id, location, cidr_block_size, cidr, ip_version, status, parent_ip_block_allocation_id, assigned_resource_id, assigned_resource_type, description, tags, is_system_managed, is_bring_your_own, created_on].hash
|
|
231
257
|
end
|
|
232
258
|
|
|
233
259
|
# Builds the object from hash
|
|
@@ -253,61 +279,6 @@ module IpApi
|
|
|
253
279
|
new(transformed_hash)
|
|
254
280
|
end
|
|
255
281
|
|
|
256
|
-
# Deserializes the data based on type
|
|
257
|
-
# @param string type Data type
|
|
258
|
-
# @param string value Value to be deserialized
|
|
259
|
-
# @return [Object] Deserialized data
|
|
260
|
-
def self._deserialize(type, value)
|
|
261
|
-
case type.to_sym
|
|
262
|
-
when :Time
|
|
263
|
-
Time.parse(value)
|
|
264
|
-
when :Date
|
|
265
|
-
Date.parse(value)
|
|
266
|
-
when :String
|
|
267
|
-
value.to_s
|
|
268
|
-
when :Integer
|
|
269
|
-
value.to_i
|
|
270
|
-
when :Float
|
|
271
|
-
value.to_f
|
|
272
|
-
when :Boolean
|
|
273
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
274
|
-
true
|
|
275
|
-
else
|
|
276
|
-
false
|
|
277
|
-
end
|
|
278
|
-
when :Object
|
|
279
|
-
# generic object (usually a Hash), return directly
|
|
280
|
-
value
|
|
281
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
282
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
283
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
284
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
285
|
-
k_type = Regexp.last_match[:k_type]
|
|
286
|
-
v_type = Regexp.last_match[:v_type]
|
|
287
|
-
{}.tap do |hash|
|
|
288
|
-
value.each do |k, v|
|
|
289
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
290
|
-
end
|
|
291
|
-
end
|
|
292
|
-
else # model
|
|
293
|
-
# models (e.g. Pet) or oneOf
|
|
294
|
-
klass = IpApi.const_get(type)
|
|
295
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
296
|
-
end
|
|
297
|
-
end
|
|
298
|
-
|
|
299
|
-
# Returns the string representation of the object
|
|
300
|
-
# @return [String] String presentation of the object
|
|
301
|
-
def to_s
|
|
302
|
-
to_hash.to_s
|
|
303
|
-
end
|
|
304
|
-
|
|
305
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
306
|
-
# @return [Hash] Returns the object in the form of hash
|
|
307
|
-
def to_body
|
|
308
|
-
to_hash
|
|
309
|
-
end
|
|
310
|
-
|
|
311
282
|
# Returns the object in the form of hash
|
|
312
283
|
# @return [Hash] Returns the object in the form of hash
|
|
313
284
|
def to_hash
|
|
@@ -324,24 +295,6 @@ module IpApi
|
|
|
324
295
|
hash
|
|
325
296
|
end
|
|
326
297
|
|
|
327
|
-
# Outputs non-array value in the form of hash
|
|
328
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
329
|
-
# @param [Object] value Any valid value
|
|
330
|
-
# @return [Hash] Returns the value in the form of hash
|
|
331
|
-
def _to_hash(value)
|
|
332
|
-
if value.is_a?(Array)
|
|
333
|
-
value.compact.map { |v| _to_hash(v) }
|
|
334
|
-
elsif value.is_a?(Hash)
|
|
335
|
-
{}.tap do |hash|
|
|
336
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
337
|
-
end
|
|
338
|
-
elsif value.respond_to? :to_hash
|
|
339
|
-
value.to_hash
|
|
340
|
-
else
|
|
341
|
-
value
|
|
342
|
-
end
|
|
343
|
-
end
|
|
344
|
-
|
|
345
298
|
end
|
|
346
299
|
|
|
347
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
|