pnap_bmc_api 2.2.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/README.md +2 -0
- data/VERSION +1 -1
- data/docs/IpBlocksConfiguration.md +1 -1
- data/docs/OsConfigurationCloudInit.md +1 -1
- data/docs/OsConfigurationWindows.md +3 -1
- data/docs/PrivateNetworkConfiguration.md +1 -1
- data/docs/PublicNetworkConfiguration.md +1 -1
- data/docs/ReservationTransferDetails.md +18 -0
- data/docs/Server.md +3 -3
- data/docs/ServerCreate.md +3 -3
- data/docs/ServerNetworkUpdate.md +1 -1
- data/docs/ServerPrivateNetwork.md +4 -2
- data/docs/ServerProvision.md +1 -1
- data/docs/ServerPublicNetwork.md +5 -3
- data/docs/ServersApi.md +72 -0
- data/lib/pnap_bmc_api/api/quotas_api.rb +4 -4
- data/lib/pnap_bmc_api/api/servers_api.rb +97 -23
- data/lib/pnap_bmc_api/api/ssh_keys_api.rb +6 -6
- data/lib/pnap_bmc_api/api_client.rb +17 -14
- data/lib/pnap_bmc_api/api_error.rb +1 -1
- data/lib/pnap_bmc_api/api_model_base.rb +88 -0
- data/lib/pnap_bmc_api/configuration.rb +11 -1
- data/lib/pnap_bmc_api/models/action_result.rb +21 -78
- data/lib/pnap_bmc_api/models/delete_result.rb +31 -78
- data/lib/pnap_bmc_api/models/delete_ssh_key_result.rb +31 -78
- data/lib/pnap_bmc_api/models/error.rb +21 -78
- data/lib/pnap_bmc_api/models/esxi_datastore_configuration.rb +13 -80
- data/lib/pnap_bmc_api/models/esxi_os_configuration.rb +11 -78
- data/lib/pnap_bmc_api/models/gpu_configuration.rb +11 -78
- data/lib/pnap_bmc_api/models/ip_blocks_configuration.rb +12 -79
- data/lib/pnap_bmc_api/models/network_configuration.rb +11 -78
- data/lib/pnap_bmc_api/models/os_configuration.rb +11 -78
- data/lib/pnap_bmc_api/models/os_configuration_cloud_init.rb +11 -78
- data/lib/pnap_bmc_api/models/os_configuration_map.rb +11 -78
- data/lib/pnap_bmc_api/models/os_configuration_map_esxi.rb +11 -78
- data/lib/pnap_bmc_api/models/os_configuration_map_proxmox.rb +11 -78
- data/lib/pnap_bmc_api/models/os_configuration_netris_controller.rb +11 -78
- data/lib/pnap_bmc_api/models/os_configuration_netris_softgate.rb +11 -78
- data/lib/pnap_bmc_api/models/os_configuration_windows.rb +27 -82
- data/lib/pnap_bmc_api/models/private_network_configuration.rb +12 -79
- data/lib/pnap_bmc_api/models/public_network_configuration.rb +12 -79
- data/lib/pnap_bmc_api/models/quota.rb +61 -78
- data/lib/pnap_bmc_api/models/quota_edit_limit_request.rb +11 -78
- data/lib/pnap_bmc_api/models/quota_edit_limit_request_details.rb +22 -79
- data/lib/pnap_bmc_api/models/relinquish_ip_block.rb +11 -78
- data/lib/pnap_bmc_api/models/reservation_transfer_details.rb +166 -0
- data/lib/pnap_bmc_api/models/reset_result.rb +21 -78
- data/lib/pnap_bmc_api/models/server.rb +116 -83
- data/lib/pnap_bmc_api/models/server_create.rb +46 -83
- data/lib/pnap_bmc_api/models/server_ip_block.rb +21 -78
- data/lib/pnap_bmc_api/models/server_network_update.rb +12 -79
- data/lib/pnap_bmc_api/models/server_patch.rb +13 -80
- data/lib/pnap_bmc_api/models/server_private_network.rb +36 -83
- data/lib/pnap_bmc_api/models/server_provision.rb +24 -81
- data/lib/pnap_bmc_api/models/server_public_network.rb +36 -83
- data/lib/pnap_bmc_api/models/server_reserve.rb +21 -78
- data/lib/pnap_bmc_api/models/server_reset.rb +11 -78
- data/lib/pnap_bmc_api/models/ssh_key.rb +81 -78
- data/lib/pnap_bmc_api/models/ssh_key_create.rb +23 -80
- data/lib/pnap_bmc_api/models/ssh_key_update.rb +23 -80
- data/lib/pnap_bmc_api/models/storage_configuration.rb +11 -78
- data/lib/pnap_bmc_api/models/storage_configuration_root_partition.rb +11 -78
- data/lib/pnap_bmc_api/models/tag_assignment.rb +41 -78
- data/lib/pnap_bmc_api/models/tag_assignment_request.rb +21 -78
- data/lib/pnap_bmc_api/version.rb +1 -2
- data/lib/pnap_bmc_api.rb +3 -1
- data/pnap_bmc_api.gemspec +6 -6
- data/spec/api/quotas_api_spec.rb +1 -1
- data/spec/api/servers_api_spec.rb +14 -1
- data/spec/api/ssh_keys_api_spec.rb +1 -1
- data/spec/models/action_result_spec.rb +2 -2
- data/spec/models/delete_result_spec.rb +2 -2
- data/spec/models/delete_ssh_key_result_spec.rb +2 -2
- data/spec/models/error_spec.rb +2 -2
- data/spec/models/esxi_datastore_configuration_spec.rb +2 -2
- data/spec/models/esxi_os_configuration_spec.rb +2 -2
- data/spec/models/gpu_configuration_spec.rb +2 -2
- data/spec/models/ip_blocks_configuration_spec.rb +2 -2
- data/spec/models/network_configuration_spec.rb +2 -2
- data/spec/models/os_configuration_cloud_init_spec.rb +2 -2
- data/spec/models/os_configuration_map_esxi_spec.rb +2 -2
- data/spec/models/os_configuration_map_proxmox_spec.rb +2 -2
- data/spec/models/os_configuration_map_spec.rb +2 -2
- data/spec/models/os_configuration_netris_controller_spec.rb +2 -2
- data/spec/models/os_configuration_netris_softgate_spec.rb +2 -2
- data/spec/models/os_configuration_spec.rb +2 -2
- data/spec/models/os_configuration_windows_spec.rb +8 -2
- data/spec/models/private_network_configuration_spec.rb +2 -2
- data/spec/models/public_network_configuration_spec.rb +2 -2
- data/spec/models/quota_edit_limit_request_details_spec.rb +2 -2
- data/spec/models/quota_edit_limit_request_spec.rb +2 -2
- data/spec/models/quota_spec.rb +2 -2
- data/spec/models/relinquish_ip_block_spec.rb +2 -2
- data/spec/models/reservation_transfer_details_spec.rb +36 -0
- data/spec/models/reset_result_spec.rb +2 -2
- data/spec/models/server_create_spec.rb +2 -2
- data/spec/models/server_ip_block_spec.rb +2 -2
- data/spec/models/server_network_update_spec.rb +2 -2
- data/spec/models/server_patch_spec.rb +2 -2
- data/spec/models/server_private_network_spec.rb +8 -2
- data/spec/models/server_provision_spec.rb +2 -2
- data/spec/models/server_public_network_spec.rb +8 -2
- data/spec/models/server_reserve_spec.rb +2 -2
- data/spec/models/server_reset_spec.rb +2 -2
- data/spec/models/server_spec.rb +2 -2
- data/spec/models/ssh_key_create_spec.rb +2 -2
- data/spec/models/ssh_key_spec.rb +2 -2
- data/spec/models/ssh_key_update_spec.rb +2 -2
- data/spec/models/storage_configuration_root_partition_spec.rb +2 -2
- data/spec/models/storage_configuration_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 +48 -39
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
The version of the OpenAPI document: 0.1
|
|
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 BmcApi
|
|
17
17
|
# Public network details of bare metal server.
|
|
18
|
-
class PublicNetworkConfiguration
|
|
19
|
-
# The list of public networks this server
|
|
18
|
+
class PublicNetworkConfiguration < ApiModelBase
|
|
19
|
+
# The list of public networks this server belongs to. If this field is part of a request body, it will be used for specifying the public networks to assign to this server on provision. Only IPv4 addresses can be specified.
|
|
20
20
|
attr_accessor :public_networks
|
|
21
21
|
|
|
22
22
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
@@ -26,9 +26,14 @@ module BmcApi
|
|
|
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 BmcApi
|
|
|
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 `BmcApi::PublicNetworkConfiguration`. 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 `BmcApi::PublicNetworkConfiguration`. 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
|
}
|
|
@@ -124,61 +130,6 @@ module BmcApi
|
|
|
124
130
|
new(transformed_hash)
|
|
125
131
|
end
|
|
126
132
|
|
|
127
|
-
# Deserializes the data based on type
|
|
128
|
-
# @param string type Data type
|
|
129
|
-
# @param string value Value to be deserialized
|
|
130
|
-
# @return [Object] Deserialized data
|
|
131
|
-
def self._deserialize(type, value)
|
|
132
|
-
case type.to_sym
|
|
133
|
-
when :Time
|
|
134
|
-
Time.parse(value)
|
|
135
|
-
when :Date
|
|
136
|
-
Date.parse(value)
|
|
137
|
-
when :String
|
|
138
|
-
value.to_s
|
|
139
|
-
when :Integer
|
|
140
|
-
value.to_i
|
|
141
|
-
when :Float
|
|
142
|
-
value.to_f
|
|
143
|
-
when :Boolean
|
|
144
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
145
|
-
true
|
|
146
|
-
else
|
|
147
|
-
false
|
|
148
|
-
end
|
|
149
|
-
when :Object
|
|
150
|
-
# generic object (usually a Hash), return directly
|
|
151
|
-
value
|
|
152
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
153
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
154
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
155
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
156
|
-
k_type = Regexp.last_match[:k_type]
|
|
157
|
-
v_type = Regexp.last_match[:v_type]
|
|
158
|
-
{}.tap do |hash|
|
|
159
|
-
value.each do |k, v|
|
|
160
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
161
|
-
end
|
|
162
|
-
end
|
|
163
|
-
else # model
|
|
164
|
-
# models (e.g. Pet) or oneOf
|
|
165
|
-
klass = BmcApi.const_get(type)
|
|
166
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
167
|
-
end
|
|
168
|
-
end
|
|
169
|
-
|
|
170
|
-
# Returns the string representation of the object
|
|
171
|
-
# @return [String] String presentation of the object
|
|
172
|
-
def to_s
|
|
173
|
-
to_hash.to_s
|
|
174
|
-
end
|
|
175
|
-
|
|
176
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
177
|
-
# @return [Hash] Returns the object in the form of hash
|
|
178
|
-
def to_body
|
|
179
|
-
to_hash
|
|
180
|
-
end
|
|
181
|
-
|
|
182
133
|
# Returns the object in the form of hash
|
|
183
134
|
# @return [Hash] Returns the object in the form of hash
|
|
184
135
|
def to_hash
|
|
@@ -195,24 +146,6 @@ module BmcApi
|
|
|
195
146
|
hash
|
|
196
147
|
end
|
|
197
148
|
|
|
198
|
-
# Outputs non-array value in the form of hash
|
|
199
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
200
|
-
# @param [Object] value Any valid value
|
|
201
|
-
# @return [Hash] Returns the value in the form of hash
|
|
202
|
-
def _to_hash(value)
|
|
203
|
-
if value.is_a?(Array)
|
|
204
|
-
value.compact.map { |v| _to_hash(v) }
|
|
205
|
-
elsif value.is_a?(Hash)
|
|
206
|
-
{}.tap do |hash|
|
|
207
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
208
|
-
end
|
|
209
|
-
elsif value.respond_to? :to_hash
|
|
210
|
-
value.to_hash
|
|
211
|
-
else
|
|
212
|
-
value
|
|
213
|
-
end
|
|
214
|
-
end
|
|
215
|
-
|
|
216
149
|
end
|
|
217
150
|
|
|
218
151
|
end
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
The version of the OpenAPI document: 0.1
|
|
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 BmcApi
|
|
17
17
|
# Quota.
|
|
18
|
-
class Quota
|
|
18
|
+
class Quota < ApiModelBase
|
|
19
19
|
# The ID of the Quota.
|
|
20
20
|
attr_accessor :id
|
|
21
21
|
|
|
@@ -75,9 +75,14 @@ module BmcApi
|
|
|
75
75
|
}
|
|
76
76
|
end
|
|
77
77
|
|
|
78
|
+
# Returns attribute mapping this model knows about
|
|
79
|
+
def self.acceptable_attribute_map
|
|
80
|
+
attribute_map
|
|
81
|
+
end
|
|
82
|
+
|
|
78
83
|
# Returns all the JSON keys this model knows about
|
|
79
84
|
def self.acceptable_attributes
|
|
80
|
-
|
|
85
|
+
acceptable_attribute_map.values
|
|
81
86
|
end
|
|
82
87
|
|
|
83
88
|
# Attribute type mapping.
|
|
@@ -108,9 +113,10 @@ module BmcApi
|
|
|
108
113
|
end
|
|
109
114
|
|
|
110
115
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
116
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
111
117
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
112
|
-
if (!
|
|
113
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::Quota`. Please check the name to make sure it's valid. List of attributes: " +
|
|
118
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
119
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::Quota`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
114
120
|
end
|
|
115
121
|
h[k.to_sym] = v
|
|
116
122
|
}
|
|
@@ -233,6 +239,36 @@ module BmcApi
|
|
|
233
239
|
true
|
|
234
240
|
end
|
|
235
241
|
|
|
242
|
+
# Custom attribute writer method with validation
|
|
243
|
+
# @param [Object] id Value to be assigned
|
|
244
|
+
def id=(id)
|
|
245
|
+
if id.nil?
|
|
246
|
+
fail ArgumentError, 'id cannot be nil'
|
|
247
|
+
end
|
|
248
|
+
|
|
249
|
+
@id = id
|
|
250
|
+
end
|
|
251
|
+
|
|
252
|
+
# Custom attribute writer method with validation
|
|
253
|
+
# @param [Object] name Value to be assigned
|
|
254
|
+
def name=(name)
|
|
255
|
+
if name.nil?
|
|
256
|
+
fail ArgumentError, 'name cannot be nil'
|
|
257
|
+
end
|
|
258
|
+
|
|
259
|
+
@name = name
|
|
260
|
+
end
|
|
261
|
+
|
|
262
|
+
# Custom attribute writer method with validation
|
|
263
|
+
# @param [Object] description Value to be assigned
|
|
264
|
+
def description=(description)
|
|
265
|
+
if description.nil?
|
|
266
|
+
fail ArgumentError, 'description cannot be nil'
|
|
267
|
+
end
|
|
268
|
+
|
|
269
|
+
@description = description
|
|
270
|
+
end
|
|
271
|
+
|
|
236
272
|
# Custom attribute writer method checking allowed values (enum).
|
|
237
273
|
# @param [Object] status Object to be assigned
|
|
238
274
|
def status=(status)
|
|
@@ -257,6 +293,16 @@ module BmcApi
|
|
|
257
293
|
@limit = limit
|
|
258
294
|
end
|
|
259
295
|
|
|
296
|
+
# Custom attribute writer method with validation
|
|
297
|
+
# @param [Object] unit Value to be assigned
|
|
298
|
+
def unit=(unit)
|
|
299
|
+
if unit.nil?
|
|
300
|
+
fail ArgumentError, 'unit cannot be nil'
|
|
301
|
+
end
|
|
302
|
+
|
|
303
|
+
@unit = unit
|
|
304
|
+
end
|
|
305
|
+
|
|
260
306
|
# Custom attribute writer method with validation
|
|
261
307
|
# @param [Object] used Value to be assigned
|
|
262
308
|
def used=(used)
|
|
@@ -271,6 +317,16 @@ module BmcApi
|
|
|
271
317
|
@used = used
|
|
272
318
|
end
|
|
273
319
|
|
|
320
|
+
# Custom attribute writer method with validation
|
|
321
|
+
# @param [Object] quota_edit_limit_request_details Value to be assigned
|
|
322
|
+
def quota_edit_limit_request_details=(quota_edit_limit_request_details)
|
|
323
|
+
if quota_edit_limit_request_details.nil?
|
|
324
|
+
fail ArgumentError, 'quota_edit_limit_request_details cannot be nil'
|
|
325
|
+
end
|
|
326
|
+
|
|
327
|
+
@quota_edit_limit_request_details = quota_edit_limit_request_details
|
|
328
|
+
end
|
|
329
|
+
|
|
274
330
|
# Checks equality by comparing each attribute.
|
|
275
331
|
# @param [Object] Object to be compared
|
|
276
332
|
def ==(o)
|
|
@@ -321,61 +377,6 @@ module BmcApi
|
|
|
321
377
|
new(transformed_hash)
|
|
322
378
|
end
|
|
323
379
|
|
|
324
|
-
# Deserializes the data based on type
|
|
325
|
-
# @param string type Data type
|
|
326
|
-
# @param string value Value to be deserialized
|
|
327
|
-
# @return [Object] Deserialized data
|
|
328
|
-
def self._deserialize(type, value)
|
|
329
|
-
case type.to_sym
|
|
330
|
-
when :Time
|
|
331
|
-
Time.parse(value)
|
|
332
|
-
when :Date
|
|
333
|
-
Date.parse(value)
|
|
334
|
-
when :String
|
|
335
|
-
value.to_s
|
|
336
|
-
when :Integer
|
|
337
|
-
value.to_i
|
|
338
|
-
when :Float
|
|
339
|
-
value.to_f
|
|
340
|
-
when :Boolean
|
|
341
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
342
|
-
true
|
|
343
|
-
else
|
|
344
|
-
false
|
|
345
|
-
end
|
|
346
|
-
when :Object
|
|
347
|
-
# generic object (usually a Hash), return directly
|
|
348
|
-
value
|
|
349
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
350
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
351
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
352
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
353
|
-
k_type = Regexp.last_match[:k_type]
|
|
354
|
-
v_type = Regexp.last_match[:v_type]
|
|
355
|
-
{}.tap do |hash|
|
|
356
|
-
value.each do |k, v|
|
|
357
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
358
|
-
end
|
|
359
|
-
end
|
|
360
|
-
else # model
|
|
361
|
-
# models (e.g. Pet) or oneOf
|
|
362
|
-
klass = BmcApi.const_get(type)
|
|
363
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
364
|
-
end
|
|
365
|
-
end
|
|
366
|
-
|
|
367
|
-
# Returns the string representation of the object
|
|
368
|
-
# @return [String] String presentation of the object
|
|
369
|
-
def to_s
|
|
370
|
-
to_hash.to_s
|
|
371
|
-
end
|
|
372
|
-
|
|
373
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
374
|
-
# @return [Hash] Returns the object in the form of hash
|
|
375
|
-
def to_body
|
|
376
|
-
to_hash
|
|
377
|
-
end
|
|
378
|
-
|
|
379
380
|
# Returns the object in the form of hash
|
|
380
381
|
# @return [Hash] Returns the object in the form of hash
|
|
381
382
|
def to_hash
|
|
@@ -392,24 +393,6 @@ module BmcApi
|
|
|
392
393
|
hash
|
|
393
394
|
end
|
|
394
395
|
|
|
395
|
-
# Outputs non-array value in the form of hash
|
|
396
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
397
|
-
# @param [Object] value Any valid value
|
|
398
|
-
# @return [Hash] Returns the value in the form of hash
|
|
399
|
-
def _to_hash(value)
|
|
400
|
-
if value.is_a?(Array)
|
|
401
|
-
value.compact.map { |v| _to_hash(v) }
|
|
402
|
-
elsif value.is_a?(Hash)
|
|
403
|
-
{}.tap do |hash|
|
|
404
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
405
|
-
end
|
|
406
|
-
elsif value.respond_to? :to_hash
|
|
407
|
-
value.to_hash
|
|
408
|
-
else
|
|
409
|
-
value
|
|
410
|
-
end
|
|
411
|
-
end
|
|
412
|
-
|
|
413
396
|
end
|
|
414
397
|
|
|
415
398
|
end
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
The version of the OpenAPI document: 0.1
|
|
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 BmcApi
|
|
17
17
|
# A request to change the limit on a quota.
|
|
18
|
-
class QuotaEditLimitRequest
|
|
18
|
+
class QuotaEditLimitRequest < ApiModelBase
|
|
19
19
|
# The new limit that is requested. Minimum allowed limit values: - 0 (Server, IPs) - 1000 (Network Storage)
|
|
20
20
|
attr_accessor :limit
|
|
21
21
|
|
|
@@ -30,9 +30,14 @@ module BmcApi
|
|
|
30
30
|
}
|
|
31
31
|
end
|
|
32
32
|
|
|
33
|
+
# Returns attribute mapping this model knows about
|
|
34
|
+
def self.acceptable_attribute_map
|
|
35
|
+
attribute_map
|
|
36
|
+
end
|
|
37
|
+
|
|
33
38
|
# Returns all the JSON keys this model knows about
|
|
34
39
|
def self.acceptable_attributes
|
|
35
|
-
|
|
40
|
+
acceptable_attribute_map.values
|
|
36
41
|
end
|
|
37
42
|
|
|
38
43
|
# Attribute type mapping.
|
|
@@ -57,9 +62,10 @@ module BmcApi
|
|
|
57
62
|
end
|
|
58
63
|
|
|
59
64
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
65
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
60
66
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
61
|
-
if (!
|
|
62
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::QuotaEditLimitRequest`. Please check the name to make sure it's valid. List of attributes: " +
|
|
67
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
68
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::QuotaEditLimitRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
63
69
|
end
|
|
64
70
|
h[k.to_sym] = v
|
|
65
71
|
}
|
|
@@ -186,61 +192,6 @@ module BmcApi
|
|
|
186
192
|
new(transformed_hash)
|
|
187
193
|
end
|
|
188
194
|
|
|
189
|
-
# Deserializes the data based on type
|
|
190
|
-
# @param string type Data type
|
|
191
|
-
# @param string value Value to be deserialized
|
|
192
|
-
# @return [Object] Deserialized data
|
|
193
|
-
def self._deserialize(type, value)
|
|
194
|
-
case type.to_sym
|
|
195
|
-
when :Time
|
|
196
|
-
Time.parse(value)
|
|
197
|
-
when :Date
|
|
198
|
-
Date.parse(value)
|
|
199
|
-
when :String
|
|
200
|
-
value.to_s
|
|
201
|
-
when :Integer
|
|
202
|
-
value.to_i
|
|
203
|
-
when :Float
|
|
204
|
-
value.to_f
|
|
205
|
-
when :Boolean
|
|
206
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
207
|
-
true
|
|
208
|
-
else
|
|
209
|
-
false
|
|
210
|
-
end
|
|
211
|
-
when :Object
|
|
212
|
-
# generic object (usually a Hash), return directly
|
|
213
|
-
value
|
|
214
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
215
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
216
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
217
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
218
|
-
k_type = Regexp.last_match[:k_type]
|
|
219
|
-
v_type = Regexp.last_match[:v_type]
|
|
220
|
-
{}.tap do |hash|
|
|
221
|
-
value.each do |k, v|
|
|
222
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
223
|
-
end
|
|
224
|
-
end
|
|
225
|
-
else # model
|
|
226
|
-
# models (e.g. Pet) or oneOf
|
|
227
|
-
klass = BmcApi.const_get(type)
|
|
228
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
229
|
-
end
|
|
230
|
-
end
|
|
231
|
-
|
|
232
|
-
# Returns the string representation of the object
|
|
233
|
-
# @return [String] String presentation of the object
|
|
234
|
-
def to_s
|
|
235
|
-
to_hash.to_s
|
|
236
|
-
end
|
|
237
|
-
|
|
238
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
239
|
-
# @return [Hash] Returns the object in the form of hash
|
|
240
|
-
def to_body
|
|
241
|
-
to_hash
|
|
242
|
-
end
|
|
243
|
-
|
|
244
195
|
# Returns the object in the form of hash
|
|
245
196
|
# @return [Hash] Returns the object in the form of hash
|
|
246
197
|
def to_hash
|
|
@@ -257,24 +208,6 @@ module BmcApi
|
|
|
257
208
|
hash
|
|
258
209
|
end
|
|
259
210
|
|
|
260
|
-
# Outputs non-array value in the form of hash
|
|
261
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
262
|
-
# @param [Object] value Any valid value
|
|
263
|
-
# @return [Hash] Returns the value in the form of hash
|
|
264
|
-
def _to_hash(value)
|
|
265
|
-
if value.is_a?(Array)
|
|
266
|
-
value.compact.map { |v| _to_hash(v) }
|
|
267
|
-
elsif value.is_a?(Hash)
|
|
268
|
-
{}.tap do |hash|
|
|
269
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
270
|
-
end
|
|
271
|
-
elsif value.respond_to? :to_hash
|
|
272
|
-
value.to_hash
|
|
273
|
-
else
|
|
274
|
-
value
|
|
275
|
-
end
|
|
276
|
-
end
|
|
277
|
-
|
|
278
211
|
end
|
|
279
212
|
|
|
280
213
|
end
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
The version of the OpenAPI document: 0.1
|
|
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
|
|
|
@@ -14,7 +14,7 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module BmcApi
|
|
17
|
-
class QuotaEditLimitRequestDetails
|
|
17
|
+
class QuotaEditLimitRequestDetails < ApiModelBase
|
|
18
18
|
# The new limit that is requested. Minimum allowed limit values: - 0 (Server, IPs) - 1000 (Network Storage)
|
|
19
19
|
attr_accessor :limit
|
|
20
20
|
|
|
@@ -33,9 +33,14 @@ module BmcApi
|
|
|
33
33
|
}
|
|
34
34
|
end
|
|
35
35
|
|
|
36
|
+
# Returns attribute mapping this model knows about
|
|
37
|
+
def self.acceptable_attribute_map
|
|
38
|
+
attribute_map
|
|
39
|
+
end
|
|
40
|
+
|
|
36
41
|
# Returns all the JSON keys this model knows about
|
|
37
42
|
def self.acceptable_attributes
|
|
38
|
-
|
|
43
|
+
acceptable_attribute_map.values
|
|
39
44
|
end
|
|
40
45
|
|
|
41
46
|
# Attribute type mapping.
|
|
@@ -68,9 +73,10 @@ module BmcApi
|
|
|
68
73
|
end
|
|
69
74
|
|
|
70
75
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
76
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
71
77
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
72
|
-
if (!
|
|
73
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::QuotaEditLimitRequestDetails`. Please check the name to make sure it's valid. List of attributes: " +
|
|
78
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
79
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::QuotaEditLimitRequestDetails`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
74
80
|
end
|
|
75
81
|
h[k.to_sym] = v
|
|
76
82
|
}
|
|
@@ -94,7 +100,7 @@ module BmcApi
|
|
|
94
100
|
end
|
|
95
101
|
end
|
|
96
102
|
|
|
97
|
-
# Show invalid properties with the reasons. Usually used together with valid?
|
|
103
|
+
1 # Show invalid properties with the reasons. Usually used together with valid?
|
|
98
104
|
# @return Array for valid properties with the reasons
|
|
99
105
|
def list_invalid_properties
|
|
100
106
|
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
@@ -168,6 +174,16 @@ module BmcApi
|
|
|
168
174
|
@reason = reason
|
|
169
175
|
end
|
|
170
176
|
|
|
177
|
+
# Custom attribute writer method with validation
|
|
178
|
+
# @param [Object] requested_on Value to be assigned
|
|
179
|
+
def requested_on=(requested_on)
|
|
180
|
+
if requested_on.nil?
|
|
181
|
+
fail ArgumentError, 'requested_on cannot be nil'
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
@requested_on = requested_on
|
|
185
|
+
end
|
|
186
|
+
|
|
171
187
|
# Checks equality by comparing each attribute.
|
|
172
188
|
# @param [Object] Object to be compared
|
|
173
189
|
def ==(o)
|
|
@@ -213,61 +229,6 @@ module BmcApi
|
|
|
213
229
|
new(transformed_hash)
|
|
214
230
|
end
|
|
215
231
|
|
|
216
|
-
# Deserializes the data based on type
|
|
217
|
-
# @param string type Data type
|
|
218
|
-
# @param string value Value to be deserialized
|
|
219
|
-
# @return [Object] Deserialized data
|
|
220
|
-
def self._deserialize(type, value)
|
|
221
|
-
case type.to_sym
|
|
222
|
-
when :Time
|
|
223
|
-
Time.parse(value)
|
|
224
|
-
when :Date
|
|
225
|
-
Date.parse(value)
|
|
226
|
-
when :String
|
|
227
|
-
value.to_s
|
|
228
|
-
when :Integer
|
|
229
|
-
value.to_i
|
|
230
|
-
when :Float
|
|
231
|
-
value.to_f
|
|
232
|
-
when :Boolean
|
|
233
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
234
|
-
true
|
|
235
|
-
else
|
|
236
|
-
false
|
|
237
|
-
end
|
|
238
|
-
when :Object
|
|
239
|
-
# generic object (usually a Hash), return directly
|
|
240
|
-
value
|
|
241
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
242
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
243
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
244
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
245
|
-
k_type = Regexp.last_match[:k_type]
|
|
246
|
-
v_type = Regexp.last_match[:v_type]
|
|
247
|
-
{}.tap do |hash|
|
|
248
|
-
value.each do |k, v|
|
|
249
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
250
|
-
end
|
|
251
|
-
end
|
|
252
|
-
else # model
|
|
253
|
-
# models (e.g. Pet) or oneOf
|
|
254
|
-
klass = BmcApi.const_get(type)
|
|
255
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
256
|
-
end
|
|
257
|
-
end
|
|
258
|
-
|
|
259
|
-
# Returns the string representation of the object
|
|
260
|
-
# @return [String] String presentation of the object
|
|
261
|
-
def to_s
|
|
262
|
-
to_hash.to_s
|
|
263
|
-
end
|
|
264
|
-
|
|
265
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
266
|
-
# @return [Hash] Returns the object in the form of hash
|
|
267
|
-
def to_body
|
|
268
|
-
to_hash
|
|
269
|
-
end
|
|
270
|
-
|
|
271
232
|
# Returns the object in the form of hash
|
|
272
233
|
# @return [Hash] Returns the object in the form of hash
|
|
273
234
|
def to_hash
|
|
@@ -284,24 +245,6 @@ module BmcApi
|
|
|
284
245
|
hash
|
|
285
246
|
end
|
|
286
247
|
|
|
287
|
-
# Outputs non-array value in the form of hash
|
|
288
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
289
|
-
# @param [Object] value Any valid value
|
|
290
|
-
# @return [Hash] Returns the value in the form of hash
|
|
291
|
-
def _to_hash(value)
|
|
292
|
-
if value.is_a?(Array)
|
|
293
|
-
value.compact.map { |v| _to_hash(v) }
|
|
294
|
-
elsif value.is_a?(Hash)
|
|
295
|
-
{}.tap do |hash|
|
|
296
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
297
|
-
end
|
|
298
|
-
elsif value.respond_to? :to_hash
|
|
299
|
-
value.to_hash
|
|
300
|
-
else
|
|
301
|
-
value
|
|
302
|
-
end
|
|
303
|
-
end
|
|
304
|
-
|
|
305
248
|
end
|
|
306
249
|
|
|
307
250
|
end
|