pnap_bmc_api 2.2.2 → 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 +3 -1
- 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 +21 -78
- 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 +35 -82
- 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 +45 -36
|
@@ -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
|
# SSH key creation model.
|
|
18
|
-
class SshKeyCreate
|
|
18
|
+
class SshKeyCreate < ApiModelBase
|
|
19
19
|
# Keys marked as default are always included on server creation and reset unless toggled off in creation/reset request.
|
|
20
20
|
attr_accessor :default
|
|
21
21
|
|
|
@@ -34,9 +34,14 @@ module BmcApi
|
|
|
34
34
|
}
|
|
35
35
|
end
|
|
36
36
|
|
|
37
|
+
# Returns attribute mapping this model knows about
|
|
38
|
+
def self.acceptable_attribute_map
|
|
39
|
+
attribute_map
|
|
40
|
+
end
|
|
41
|
+
|
|
37
42
|
# Returns all the JSON keys this model knows about
|
|
38
43
|
def self.acceptable_attributes
|
|
39
|
-
|
|
44
|
+
acceptable_attribute_map.values
|
|
40
45
|
end
|
|
41
46
|
|
|
42
47
|
# Attribute type mapping.
|
|
@@ -62,9 +67,10 @@ module BmcApi
|
|
|
62
67
|
end
|
|
63
68
|
|
|
64
69
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
70
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
65
71
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
66
|
-
if (!
|
|
67
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::SshKeyCreate`. Please check the name to make sure it's valid. List of attributes: " +
|
|
72
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
73
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::SshKeyCreate`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
68
74
|
end
|
|
69
75
|
h[k.to_sym] = v
|
|
70
76
|
}
|
|
@@ -106,7 +112,7 @@ module BmcApi
|
|
|
106
112
|
end
|
|
107
113
|
|
|
108
114
|
if @name.to_s.length < 1
|
|
109
|
-
invalid_properties.push('invalid value for "name", the character length must be
|
|
115
|
+
invalid_properties.push('invalid value for "name", the character length must be greater than or equal to 1.')
|
|
110
116
|
end
|
|
111
117
|
|
|
112
118
|
pattern = Regexp.new(/^(?!\s*$).+/)
|
|
@@ -140,6 +146,16 @@ module BmcApi
|
|
|
140
146
|
true
|
|
141
147
|
end
|
|
142
148
|
|
|
149
|
+
# Custom attribute writer method with validation
|
|
150
|
+
# @param [Object] default Value to be assigned
|
|
151
|
+
def default=(default)
|
|
152
|
+
if default.nil?
|
|
153
|
+
fail ArgumentError, 'default cannot be nil'
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
@default = default
|
|
157
|
+
end
|
|
158
|
+
|
|
143
159
|
# Custom attribute writer method with validation
|
|
144
160
|
# @param [Object] name Value to be assigned
|
|
145
161
|
def name=(name)
|
|
@@ -152,7 +168,7 @@ module BmcApi
|
|
|
152
168
|
end
|
|
153
169
|
|
|
154
170
|
if name.to_s.length < 1
|
|
155
|
-
fail ArgumentError, 'invalid value for "name", the character length must be
|
|
171
|
+
fail ArgumentError, 'invalid value for "name", the character length must be greater than or equal to 1.'
|
|
156
172
|
end
|
|
157
173
|
|
|
158
174
|
pattern = Regexp.new(/^(?!\s*$).+/)
|
|
@@ -223,61 +239,6 @@ module BmcApi
|
|
|
223
239
|
new(transformed_hash)
|
|
224
240
|
end
|
|
225
241
|
|
|
226
|
-
# Deserializes the data based on type
|
|
227
|
-
# @param string type Data type
|
|
228
|
-
# @param string value Value to be deserialized
|
|
229
|
-
# @return [Object] Deserialized data
|
|
230
|
-
def self._deserialize(type, value)
|
|
231
|
-
case type.to_sym
|
|
232
|
-
when :Time
|
|
233
|
-
Time.parse(value)
|
|
234
|
-
when :Date
|
|
235
|
-
Date.parse(value)
|
|
236
|
-
when :String
|
|
237
|
-
value.to_s
|
|
238
|
-
when :Integer
|
|
239
|
-
value.to_i
|
|
240
|
-
when :Float
|
|
241
|
-
value.to_f
|
|
242
|
-
when :Boolean
|
|
243
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
244
|
-
true
|
|
245
|
-
else
|
|
246
|
-
false
|
|
247
|
-
end
|
|
248
|
-
when :Object
|
|
249
|
-
# generic object (usually a Hash), return directly
|
|
250
|
-
value
|
|
251
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
252
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
253
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
254
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
255
|
-
k_type = Regexp.last_match[:k_type]
|
|
256
|
-
v_type = Regexp.last_match[:v_type]
|
|
257
|
-
{}.tap do |hash|
|
|
258
|
-
value.each do |k, v|
|
|
259
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
260
|
-
end
|
|
261
|
-
end
|
|
262
|
-
else # model
|
|
263
|
-
# models (e.g. Pet) or oneOf
|
|
264
|
-
klass = BmcApi.const_get(type)
|
|
265
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
266
|
-
end
|
|
267
|
-
end
|
|
268
|
-
|
|
269
|
-
# Returns the string representation of the object
|
|
270
|
-
# @return [String] String presentation of the object
|
|
271
|
-
def to_s
|
|
272
|
-
to_hash.to_s
|
|
273
|
-
end
|
|
274
|
-
|
|
275
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
276
|
-
# @return [Hash] Returns the object in the form of hash
|
|
277
|
-
def to_body
|
|
278
|
-
to_hash
|
|
279
|
-
end
|
|
280
|
-
|
|
281
242
|
# Returns the object in the form of hash
|
|
282
243
|
# @return [Hash] Returns the object in the form of hash
|
|
283
244
|
def to_hash
|
|
@@ -294,24 +255,6 @@ module BmcApi
|
|
|
294
255
|
hash
|
|
295
256
|
end
|
|
296
257
|
|
|
297
|
-
# Outputs non-array value in the form of hash
|
|
298
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
299
|
-
# @param [Object] value Any valid value
|
|
300
|
-
# @return [Hash] Returns the value in the form of hash
|
|
301
|
-
def _to_hash(value)
|
|
302
|
-
if value.is_a?(Array)
|
|
303
|
-
value.compact.map { |v| _to_hash(v) }
|
|
304
|
-
elsif value.is_a?(Hash)
|
|
305
|
-
{}.tap do |hash|
|
|
306
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
307
|
-
end
|
|
308
|
-
elsif value.respond_to? :to_hash
|
|
309
|
-
value.to_hash
|
|
310
|
-
else
|
|
311
|
-
value
|
|
312
|
-
end
|
|
313
|
-
end
|
|
314
|
-
|
|
315
258
|
end
|
|
316
259
|
|
|
317
260
|
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
|
# SSH key modification model.
|
|
18
|
-
class SshKeyUpdate
|
|
18
|
+
class SshKeyUpdate < ApiModelBase
|
|
19
19
|
# Keys marked as default are always included on server creation and reset unless toggled off in creation/reset request.
|
|
20
20
|
attr_accessor :default
|
|
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::SshKeyUpdate`. 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::SshKeyUpdate`. 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
|
}
|
|
@@ -95,7 +101,7 @@ module BmcApi
|
|
|
95
101
|
end
|
|
96
102
|
|
|
97
103
|
if @name.to_s.length < 1
|
|
98
|
-
invalid_properties.push('invalid value for "name", the character length must be
|
|
104
|
+
invalid_properties.push('invalid value for "name", the character length must be greater than or equal to 1.')
|
|
99
105
|
end
|
|
100
106
|
|
|
101
107
|
pattern = Regexp.new(/^(?!\s*$).+/)
|
|
@@ -118,6 +124,16 @@ module BmcApi
|
|
|
118
124
|
true
|
|
119
125
|
end
|
|
120
126
|
|
|
127
|
+
# Custom attribute writer method with validation
|
|
128
|
+
# @param [Object] default Value to be assigned
|
|
129
|
+
def default=(default)
|
|
130
|
+
if default.nil?
|
|
131
|
+
fail ArgumentError, 'default cannot be nil'
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
@default = default
|
|
135
|
+
end
|
|
136
|
+
|
|
121
137
|
# Custom attribute writer method with validation
|
|
122
138
|
# @param [Object] name Value to be assigned
|
|
123
139
|
def name=(name)
|
|
@@ -130,7 +146,7 @@ module BmcApi
|
|
|
130
146
|
end
|
|
131
147
|
|
|
132
148
|
if name.to_s.length < 1
|
|
133
|
-
fail ArgumentError, 'invalid value for "name", the character length must be
|
|
149
|
+
fail ArgumentError, 'invalid value for "name", the character length must be greater than or equal to 1.'
|
|
134
150
|
end
|
|
135
151
|
|
|
136
152
|
pattern = Regexp.new(/^(?!\s*$).+/)
|
|
@@ -185,61 +201,6 @@ module BmcApi
|
|
|
185
201
|
new(transformed_hash)
|
|
186
202
|
end
|
|
187
203
|
|
|
188
|
-
# Deserializes the data based on type
|
|
189
|
-
# @param string type Data type
|
|
190
|
-
# @param string value Value to be deserialized
|
|
191
|
-
# @return [Object] Deserialized data
|
|
192
|
-
def self._deserialize(type, value)
|
|
193
|
-
case type.to_sym
|
|
194
|
-
when :Time
|
|
195
|
-
Time.parse(value)
|
|
196
|
-
when :Date
|
|
197
|
-
Date.parse(value)
|
|
198
|
-
when :String
|
|
199
|
-
value.to_s
|
|
200
|
-
when :Integer
|
|
201
|
-
value.to_i
|
|
202
|
-
when :Float
|
|
203
|
-
value.to_f
|
|
204
|
-
when :Boolean
|
|
205
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
206
|
-
true
|
|
207
|
-
else
|
|
208
|
-
false
|
|
209
|
-
end
|
|
210
|
-
when :Object
|
|
211
|
-
# generic object (usually a Hash), return directly
|
|
212
|
-
value
|
|
213
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
214
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
215
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
216
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
217
|
-
k_type = Regexp.last_match[:k_type]
|
|
218
|
-
v_type = Regexp.last_match[:v_type]
|
|
219
|
-
{}.tap do |hash|
|
|
220
|
-
value.each do |k, v|
|
|
221
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
222
|
-
end
|
|
223
|
-
end
|
|
224
|
-
else # model
|
|
225
|
-
# models (e.g. Pet) or oneOf
|
|
226
|
-
klass = BmcApi.const_get(type)
|
|
227
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
228
|
-
end
|
|
229
|
-
end
|
|
230
|
-
|
|
231
|
-
# Returns the string representation of the object
|
|
232
|
-
# @return [String] String presentation of the object
|
|
233
|
-
def to_s
|
|
234
|
-
to_hash.to_s
|
|
235
|
-
end
|
|
236
|
-
|
|
237
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
238
|
-
# @return [Hash] Returns the object in the form of hash
|
|
239
|
-
def to_body
|
|
240
|
-
to_hash
|
|
241
|
-
end
|
|
242
|
-
|
|
243
204
|
# Returns the object in the form of hash
|
|
244
205
|
# @return [Hash] Returns the object in the form of hash
|
|
245
206
|
def to_hash
|
|
@@ -256,24 +217,6 @@ module BmcApi
|
|
|
256
217
|
hash
|
|
257
218
|
end
|
|
258
219
|
|
|
259
|
-
# Outputs non-array value in the form of hash
|
|
260
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
261
|
-
# @param [Object] value Any valid value
|
|
262
|
-
# @return [Hash] Returns the value in the form of hash
|
|
263
|
-
def _to_hash(value)
|
|
264
|
-
if value.is_a?(Array)
|
|
265
|
-
value.compact.map { |v| _to_hash(v) }
|
|
266
|
-
elsif value.is_a?(Hash)
|
|
267
|
-
{}.tap do |hash|
|
|
268
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
269
|
-
end
|
|
270
|
-
elsif value.respond_to? :to_hash
|
|
271
|
-
value.to_hash
|
|
272
|
-
else
|
|
273
|
-
value
|
|
274
|
-
end
|
|
275
|
-
end
|
|
276
|
-
|
|
277
220
|
end
|
|
278
221
|
|
|
279
222
|
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
|
# Storage configuration.
|
|
18
|
-
class StorageConfiguration
|
|
18
|
+
class StorageConfiguration < ApiModelBase
|
|
19
19
|
attr_accessor :root_partition
|
|
20
20
|
|
|
21
21
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
@@ -25,9 +25,14 @@ module BmcApi
|
|
|
25
25
|
}
|
|
26
26
|
end
|
|
27
27
|
|
|
28
|
+
# Returns attribute mapping this model knows about
|
|
29
|
+
def self.acceptable_attribute_map
|
|
30
|
+
attribute_map
|
|
31
|
+
end
|
|
32
|
+
|
|
28
33
|
# Returns all the JSON keys this model knows about
|
|
29
34
|
def self.acceptable_attributes
|
|
30
|
-
|
|
35
|
+
acceptable_attribute_map.values
|
|
31
36
|
end
|
|
32
37
|
|
|
33
38
|
# Attribute type mapping.
|
|
@@ -51,9 +56,10 @@ module BmcApi
|
|
|
51
56
|
end
|
|
52
57
|
|
|
53
58
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
59
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
54
60
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
55
|
-
if (!
|
|
56
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::StorageConfiguration`. Please check the name to make sure it's valid. List of attributes: " +
|
|
61
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
62
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::StorageConfiguration`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
57
63
|
end
|
|
58
64
|
h[k.to_sym] = v
|
|
59
65
|
}
|
|
@@ -121,61 +127,6 @@ module BmcApi
|
|
|
121
127
|
new(transformed_hash)
|
|
122
128
|
end
|
|
123
129
|
|
|
124
|
-
# Deserializes the data based on type
|
|
125
|
-
# @param string type Data type
|
|
126
|
-
# @param string value Value to be deserialized
|
|
127
|
-
# @return [Object] Deserialized data
|
|
128
|
-
def self._deserialize(type, value)
|
|
129
|
-
case type.to_sym
|
|
130
|
-
when :Time
|
|
131
|
-
Time.parse(value)
|
|
132
|
-
when :Date
|
|
133
|
-
Date.parse(value)
|
|
134
|
-
when :String
|
|
135
|
-
value.to_s
|
|
136
|
-
when :Integer
|
|
137
|
-
value.to_i
|
|
138
|
-
when :Float
|
|
139
|
-
value.to_f
|
|
140
|
-
when :Boolean
|
|
141
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
142
|
-
true
|
|
143
|
-
else
|
|
144
|
-
false
|
|
145
|
-
end
|
|
146
|
-
when :Object
|
|
147
|
-
# generic object (usually a Hash), return directly
|
|
148
|
-
value
|
|
149
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
150
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
151
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
152
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
153
|
-
k_type = Regexp.last_match[:k_type]
|
|
154
|
-
v_type = Regexp.last_match[:v_type]
|
|
155
|
-
{}.tap do |hash|
|
|
156
|
-
value.each do |k, v|
|
|
157
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
158
|
-
end
|
|
159
|
-
end
|
|
160
|
-
else # model
|
|
161
|
-
# models (e.g. Pet) or oneOf
|
|
162
|
-
klass = BmcApi.const_get(type)
|
|
163
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
164
|
-
end
|
|
165
|
-
end
|
|
166
|
-
|
|
167
|
-
# Returns the string representation of the object
|
|
168
|
-
# @return [String] String presentation of the object
|
|
169
|
-
def to_s
|
|
170
|
-
to_hash.to_s
|
|
171
|
-
end
|
|
172
|
-
|
|
173
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
174
|
-
# @return [Hash] Returns the object in the form of hash
|
|
175
|
-
def to_body
|
|
176
|
-
to_hash
|
|
177
|
-
end
|
|
178
|
-
|
|
179
130
|
# Returns the object in the form of hash
|
|
180
131
|
# @return [Hash] Returns the object in the form of hash
|
|
181
132
|
def to_hash
|
|
@@ -192,24 +143,6 @@ module BmcApi
|
|
|
192
143
|
hash
|
|
193
144
|
end
|
|
194
145
|
|
|
195
|
-
# Outputs non-array value in the form of hash
|
|
196
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
197
|
-
# @param [Object] value Any valid value
|
|
198
|
-
# @return [Hash] Returns the value in the form of hash
|
|
199
|
-
def _to_hash(value)
|
|
200
|
-
if value.is_a?(Array)
|
|
201
|
-
value.compact.map { |v| _to_hash(v) }
|
|
202
|
-
elsif value.is_a?(Hash)
|
|
203
|
-
{}.tap do |hash|
|
|
204
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
205
|
-
end
|
|
206
|
-
elsif value.respond_to? :to_hash
|
|
207
|
-
value.to_hash
|
|
208
|
-
else
|
|
209
|
-
value
|
|
210
|
-
end
|
|
211
|
-
end
|
|
212
|
-
|
|
213
146
|
end
|
|
214
147
|
|
|
215
148
|
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
|
# Root partition configuration.
|
|
18
|
-
class StorageConfigurationRootPartition
|
|
18
|
+
class StorageConfigurationRootPartition < ApiModelBase
|
|
19
19
|
# Software RAID configuration. The following RAID options are available: NO_RAID, RAID_0, RAID_1.
|
|
20
20
|
attr_accessor :raid
|
|
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::StorageConfigurationRootPartition`. 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::StorageConfigurationRootPartition`. 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
|
}
|
|
@@ -136,61 +142,6 @@ module BmcApi
|
|
|
136
142
|
new(transformed_hash)
|
|
137
143
|
end
|
|
138
144
|
|
|
139
|
-
# Deserializes the data based on type
|
|
140
|
-
# @param string type Data type
|
|
141
|
-
# @param string value Value to be deserialized
|
|
142
|
-
# @return [Object] Deserialized data
|
|
143
|
-
def self._deserialize(type, value)
|
|
144
|
-
case type.to_sym
|
|
145
|
-
when :Time
|
|
146
|
-
Time.parse(value)
|
|
147
|
-
when :Date
|
|
148
|
-
Date.parse(value)
|
|
149
|
-
when :String
|
|
150
|
-
value.to_s
|
|
151
|
-
when :Integer
|
|
152
|
-
value.to_i
|
|
153
|
-
when :Float
|
|
154
|
-
value.to_f
|
|
155
|
-
when :Boolean
|
|
156
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
157
|
-
true
|
|
158
|
-
else
|
|
159
|
-
false
|
|
160
|
-
end
|
|
161
|
-
when :Object
|
|
162
|
-
# generic object (usually a Hash), return directly
|
|
163
|
-
value
|
|
164
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
165
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
166
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
167
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
168
|
-
k_type = Regexp.last_match[:k_type]
|
|
169
|
-
v_type = Regexp.last_match[:v_type]
|
|
170
|
-
{}.tap do |hash|
|
|
171
|
-
value.each do |k, v|
|
|
172
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
173
|
-
end
|
|
174
|
-
end
|
|
175
|
-
else # model
|
|
176
|
-
# models (e.g. Pet) or oneOf
|
|
177
|
-
klass = BmcApi.const_get(type)
|
|
178
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
179
|
-
end
|
|
180
|
-
end
|
|
181
|
-
|
|
182
|
-
# Returns the string representation of the object
|
|
183
|
-
# @return [String] String presentation of the object
|
|
184
|
-
def to_s
|
|
185
|
-
to_hash.to_s
|
|
186
|
-
end
|
|
187
|
-
|
|
188
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
189
|
-
# @return [Hash] Returns the object in the form of hash
|
|
190
|
-
def to_body
|
|
191
|
-
to_hash
|
|
192
|
-
end
|
|
193
|
-
|
|
194
145
|
# Returns the object in the form of hash
|
|
195
146
|
# @return [Hash] Returns the object in the form of hash
|
|
196
147
|
def to_hash
|
|
@@ -207,24 +158,6 @@ module BmcApi
|
|
|
207
158
|
hash
|
|
208
159
|
end
|
|
209
160
|
|
|
210
|
-
# Outputs non-array value in the form of hash
|
|
211
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
212
|
-
# @param [Object] value Any valid value
|
|
213
|
-
# @return [Hash] Returns the value in the form of hash
|
|
214
|
-
def _to_hash(value)
|
|
215
|
-
if value.is_a?(Array)
|
|
216
|
-
value.compact.map { |v| _to_hash(v) }
|
|
217
|
-
elsif value.is_a?(Hash)
|
|
218
|
-
{}.tap do |hash|
|
|
219
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
220
|
-
end
|
|
221
|
-
elsif value.respond_to? :to_hash
|
|
222
|
-
value.to_hash
|
|
223
|
-
else
|
|
224
|
-
value
|
|
225
|
-
end
|
|
226
|
-
end
|
|
227
|
-
|
|
228
161
|
end
|
|
229
162
|
|
|
230
163
|
end
|