pnap_bmc_api 1.5.0 → 2.0.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 +5 -1
- data/VERSION +1 -1
- data/docs/DeleteResult.md +1 -1
- data/docs/OsConfigurationCloudInit.md +1 -1
- data/docs/QuotasApi.md +6 -8
- data/docs/SSHKeysApi.md +12 -16
- data/docs/Server.md +11 -7
- data/docs/ServerCreate.md +3 -3
- data/docs/ServerNetworkUpdate.md +2 -2
- data/docs/ServerPrivateNetwork.md +3 -3
- data/docs/ServerProvision.md +38 -0
- data/docs/ServerPublicNetwork.md +2 -2
- data/docs/ServersApi.md +173 -111
- data/docs/StorageConfigurationRootPartition.md +2 -2
- data/lib/pnap_bmc_api/api/quotas_api.rb +11 -7
- data/lib/pnap_bmc_api/api/servers_api.rb +200 -75
- data/lib/pnap_bmc_api/api/ssh_keys_api.rb +21 -13
- data/lib/pnap_bmc_api/api_client.rb +24 -21
- data/lib/pnap_bmc_api/api_error.rb +2 -1
- data/lib/pnap_bmc_api/configuration.rb +28 -9
- data/lib/pnap_bmc_api/models/action_result.rb +16 -19
- data/lib/pnap_bmc_api/models/delete_result.rb +18 -19
- data/lib/pnap_bmc_api/models/delete_ssh_key_result.rb +18 -19
- data/lib/pnap_bmc_api/models/error.rb +16 -19
- data/lib/pnap_bmc_api/models/ip_blocks_configuration.rb +19 -20
- data/lib/pnap_bmc_api/models/network_configuration.rb +14 -19
- data/lib/pnap_bmc_api/models/os_configuration.rb +19 -20
- data/lib/pnap_bmc_api/models/os_configuration_cloud_init.rb +15 -20
- data/lib/pnap_bmc_api/models/os_configuration_map.rb +14 -19
- data/lib/pnap_bmc_api/models/os_configuration_map_esxi.rb +19 -20
- data/lib/pnap_bmc_api/models/os_configuration_map_proxmox.rb +19 -20
- data/lib/pnap_bmc_api/models/os_configuration_netris_controller.rb +14 -19
- data/lib/pnap_bmc_api/models/os_configuration_netris_softgate.rb +25 -22
- data/lib/pnap_bmc_api/models/os_configuration_windows.rb +19 -20
- data/lib/pnap_bmc_api/models/private_network_configuration.rb +14 -19
- data/lib/pnap_bmc_api/models/public_network_configuration.rb +14 -19
- data/lib/pnap_bmc_api/models/quota.rb +30 -19
- data/lib/pnap_bmc_api/models/quota_edit_limit_request.rb +39 -19
- data/lib/pnap_bmc_api/models/quota_edit_limit_request_details.rb +42 -21
- data/lib/pnap_bmc_api/models/relinquish_ip_block.rb +14 -19
- data/lib/pnap_bmc_api/models/reset_result.rb +16 -19
- data/lib/pnap_bmc_api/models/server.rb +79 -33
- data/lib/pnap_bmc_api/models/server_create.rb +29 -22
- data/lib/pnap_bmc_api/models/server_ip_block.rb +16 -19
- data/lib/pnap_bmc_api/models/server_network_update.rb +15 -20
- data/lib/pnap_bmc_api/models/server_patch.rb +27 -24
- data/lib/pnap_bmc_api/models/server_private_network.rb +23 -22
- data/lib/pnap_bmc_api/models/server_provision.rb +395 -0
- data/lib/pnap_bmc_api/models/server_public_network.rb +17 -20
- data/lib/pnap_bmc_api/models/server_reserve.rb +16 -19
- data/lib/pnap_bmc_api/models/server_reset.rb +14 -19
- data/lib/pnap_bmc_api/models/ssh_key.rb +28 -19
- data/lib/pnap_bmc_api/models/ssh_key_create.rb +52 -19
- data/lib/pnap_bmc_api/models/ssh_key_update.rb +29 -19
- data/lib/pnap_bmc_api/models/storage_configuration.rb +14 -19
- data/lib/pnap_bmc_api/models/storage_configuration_root_partition.rb +14 -19
- data/lib/pnap_bmc_api/models/tag_assignment.rb +20 -19
- data/lib/pnap_bmc_api/models/tag_assignment_request.rb +16 -19
- data/lib/pnap_bmc_api/version.rb +1 -1
- data/lib/pnap_bmc_api.rb +2 -2
- data/pnap_bmc_api.gemspec +2 -2
- data/spec/api/quotas_api_spec.rb +6 -6
- data/spec/api/servers_api_spec.rb +109 -36
- data/spec/api/ssh_keys_api_spec.rb +9 -9
- data/spec/models/action_result_spec.rb +6 -4
- data/spec/models/delete_result_spec.rb +7 -5
- data/spec/models/delete_ssh_key_result_spec.rb +7 -5
- data/spec/models/error_spec.rb +7 -5
- data/spec/models/ip_blocks_configuration_spec.rb +7 -5
- data/spec/models/network_configuration_spec.rb +19 -5
- data/spec/models/os_configuration_cloud_init_spec.rb +5 -3
- data/spec/models/os_configuration_map_esxi_spec.rb +8 -6
- data/spec/models/os_configuration_map_proxmox_spec.rb +8 -6
- data/spec/models/os_configuration_map_spec.rb +8 -6
- data/spec/models/os_configuration_netris_controller_spec.rb +7 -5
- data/spec/models/os_configuration_netris_softgate_spec.rb +8 -6
- data/spec/models/os_configuration_spec.rb +33 -7
- data/spec/models/os_configuration_windows_spec.rb +6 -4
- data/spec/models/private_network_configuration_spec.rb +8 -6
- data/spec/models/public_network_configuration_spec.rb +6 -4
- data/spec/models/quota_edit_limit_request_details_spec.rb +8 -6
- data/spec/models/quota_edit_limit_request_spec.rb +7 -5
- data/spec/models/quota_spec.rb +13 -15
- data/spec/models/relinquish_ip_block_spec.rb +6 -4
- data/spec/models/reset_result_spec.rb +8 -6
- data/spec/models/server_create_spec.rb +25 -17
- data/spec/models/server_ip_block_spec.rb +7 -5
- data/spec/models/server_network_update_spec.rb +5 -3
- data/spec/models/server_patch_spec.rb +7 -5
- data/spec/models/server_private_network_spec.rb +9 -7
- data/spec/models/server_provision_spec.rb +96 -0
- data/spec/models/server_public_network_spec.rb +8 -6
- data/spec/models/server_reserve_spec.rb +6 -4
- data/spec/models/server_reset_spec.rb +9 -7
- data/spec/models/server_spec.rb +47 -27
- data/spec/models/ssh_key_create_spec.rb +8 -6
- data/spec/models/ssh_key_spec.rb +12 -10
- data/spec/models/ssh_key_update_spec.rb +7 -5
- data/spec/models/storage_configuration_root_partition_spec.rb +6 -4
- data/spec/models/storage_configuration_spec.rb +5 -3
- data/spec/models/tag_assignment_request_spec.rb +7 -5
- data/spec/models/tag_assignment_spec.rb +10 -8
- data/spec/spec_helper.rb +1 -1
- metadata +38 -42
- data/docs/QuotaEditLimitRequestDetailsAllOf.md +0 -18
- data/lib/pnap_bmc_api/models/quota_edit_limit_request_details_all_of.rb +0 -226
- data/spec/api_client_spec.rb +0 -226
- data/spec/configuration_spec.rb +0 -42
- data/spec/models/quota_edit_limit_request_details_all_of_spec.rb +0 -34
@@ -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
|
-
OpenAPI Generator version:
|
9
|
+
OpenAPI Generator version: 7.2.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -117,42 +117,59 @@ module BmcApi
|
|
117
117
|
|
118
118
|
if attributes.key?(:'id')
|
119
119
|
self.id = attributes[:'id']
|
120
|
+
else
|
121
|
+
self.id = nil
|
120
122
|
end
|
121
123
|
|
122
124
|
if attributes.key?(:'name')
|
123
125
|
self.name = attributes[:'name']
|
126
|
+
else
|
127
|
+
self.name = nil
|
124
128
|
end
|
125
129
|
|
126
130
|
if attributes.key?(:'description')
|
127
131
|
self.description = attributes[:'description']
|
132
|
+
else
|
133
|
+
self.description = nil
|
128
134
|
end
|
129
135
|
|
130
136
|
if attributes.key?(:'status')
|
131
137
|
self.status = attributes[:'status']
|
138
|
+
else
|
139
|
+
self.status = nil
|
132
140
|
end
|
133
141
|
|
134
142
|
if attributes.key?(:'limit')
|
135
143
|
self.limit = attributes[:'limit']
|
144
|
+
else
|
145
|
+
self.limit = nil
|
136
146
|
end
|
137
147
|
|
138
148
|
if attributes.key?(:'unit')
|
139
149
|
self.unit = attributes[:'unit']
|
150
|
+
else
|
151
|
+
self.unit = nil
|
140
152
|
end
|
141
153
|
|
142
154
|
if attributes.key?(:'used')
|
143
155
|
self.used = attributes[:'used']
|
156
|
+
else
|
157
|
+
self.used = nil
|
144
158
|
end
|
145
159
|
|
146
160
|
if attributes.key?(:'quota_edit_limit_request_details')
|
147
161
|
if (value = attributes[:'quota_edit_limit_request_details']).is_a?(Array)
|
148
162
|
self.quota_edit_limit_request_details = value
|
149
163
|
end
|
164
|
+
else
|
165
|
+
self.quota_edit_limit_request_details = nil
|
150
166
|
end
|
151
167
|
end
|
152
168
|
|
153
169
|
# Show invalid properties with the reasons. Usually used together with valid?
|
154
170
|
# @return Array for valid properties with the reasons
|
155
171
|
def list_invalid_properties
|
172
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
156
173
|
invalid_properties = Array.new
|
157
174
|
if @id.nil?
|
158
175
|
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
@@ -200,6 +217,7 @@ module BmcApi
|
|
200
217
|
# Check to see if the all the properties in the model are valid
|
201
218
|
# @return true if the model is valid
|
202
219
|
def valid?
|
220
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
203
221
|
return false if @id.nil?
|
204
222
|
return false if @name.nil?
|
205
223
|
return false if @description.nil?
|
@@ -284,37 +302,30 @@ module BmcApi
|
|
284
302
|
# @param [Hash] attributes Model attributes in the form of hash
|
285
303
|
# @return [Object] Returns the model itself
|
286
304
|
def self.build_from_hash(attributes)
|
287
|
-
new.build_from_hash(attributes)
|
288
|
-
end
|
289
|
-
|
290
|
-
# Builds the object from hash
|
291
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
292
|
-
# @return [Object] Returns the model itself
|
293
|
-
def build_from_hash(attributes)
|
294
305
|
return nil unless attributes.is_a?(Hash)
|
295
306
|
attributes = attributes.transform_keys(&:to_sym)
|
296
|
-
|
297
|
-
|
298
|
-
|
307
|
+
transformed_hash = {}
|
308
|
+
openapi_types.each_pair do |key, type|
|
309
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
310
|
+
transformed_hash["#{key}"] = nil
|
299
311
|
elsif type =~ /\AArray<(.*)>/i
|
300
312
|
# check to ensure the input is an array given that the attribute
|
301
313
|
# is documented as an array but the input is not
|
302
|
-
if attributes[
|
303
|
-
|
314
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
315
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
304
316
|
end
|
305
|
-
elsif !attributes[
|
306
|
-
|
317
|
+
elsif !attributes[attribute_map[key]].nil?
|
318
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
307
319
|
end
|
308
320
|
end
|
309
|
-
|
310
|
-
self
|
321
|
+
new(transformed_hash)
|
311
322
|
end
|
312
323
|
|
313
324
|
# Deserializes the data based on type
|
314
325
|
# @param string type Data type
|
315
326
|
# @param string value Value to be deserialized
|
316
327
|
# @return [Object] Deserialized data
|
317
|
-
def _deserialize(type, value)
|
328
|
+
def self._deserialize(type, value)
|
318
329
|
case type.to_sym
|
319
330
|
when :Time
|
320
331
|
Time.parse(value)
|
@@ -349,7 +360,7 @@ module BmcApi
|
|
349
360
|
else # model
|
350
361
|
# models (e.g. Pet) or oneOf
|
351
362
|
klass = BmcApi.const_get(type)
|
352
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
363
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
353
364
|
end
|
354
365
|
end
|
355
366
|
|
@@ -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
|
-
OpenAPI Generator version:
|
9
|
+
OpenAPI Generator version: 7.2.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -66,16 +66,21 @@ module BmcApi
|
|
66
66
|
|
67
67
|
if attributes.key?(:'limit')
|
68
68
|
self.limit = attributes[:'limit']
|
69
|
+
else
|
70
|
+
self.limit = nil
|
69
71
|
end
|
70
72
|
|
71
73
|
if attributes.key?(:'reason')
|
72
74
|
self.reason = attributes[:'reason']
|
75
|
+
else
|
76
|
+
self.reason = nil
|
73
77
|
end
|
74
78
|
end
|
75
79
|
|
76
80
|
# Show invalid properties with the reasons. Usually used together with valid?
|
77
81
|
# @return Array for valid properties with the reasons
|
78
82
|
def list_invalid_properties
|
83
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
79
84
|
invalid_properties = Array.new
|
80
85
|
if @limit.nil?
|
81
86
|
invalid_properties.push('invalid value for "limit", limit cannot be nil.')
|
@@ -89,15 +94,22 @@ module BmcApi
|
|
89
94
|
invalid_properties.push('invalid value for "reason", reason cannot be nil.')
|
90
95
|
end
|
91
96
|
|
97
|
+
pattern = Regexp.new(/^(?!\s*$).+/)
|
98
|
+
if @reason !~ pattern
|
99
|
+
invalid_properties.push("invalid value for \"reason\", must conform to the pattern #{pattern}.")
|
100
|
+
end
|
101
|
+
|
92
102
|
invalid_properties
|
93
103
|
end
|
94
104
|
|
95
105
|
# Check to see if the all the properties in the model are valid
|
96
106
|
# @return true if the model is valid
|
97
107
|
def valid?
|
108
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
98
109
|
return false if @limit.nil?
|
99
110
|
return false if @limit < 0
|
100
111
|
return false if @reason.nil?
|
112
|
+
return false if @reason !~ Regexp.new(/^(?!\s*$).+/)
|
101
113
|
true
|
102
114
|
end
|
103
115
|
|
@@ -115,6 +127,21 @@ module BmcApi
|
|
115
127
|
@limit = limit
|
116
128
|
end
|
117
129
|
|
130
|
+
# Custom attribute writer method with validation
|
131
|
+
# @param [Object] reason Value to be assigned
|
132
|
+
def reason=(reason)
|
133
|
+
if reason.nil?
|
134
|
+
fail ArgumentError, 'reason cannot be nil'
|
135
|
+
end
|
136
|
+
|
137
|
+
pattern = Regexp.new(/^(?!\s*$).+/)
|
138
|
+
if reason !~ pattern
|
139
|
+
fail ArgumentError, "invalid value for \"reason\", must conform to the pattern #{pattern}."
|
140
|
+
end
|
141
|
+
|
142
|
+
@reason = reason
|
143
|
+
end
|
144
|
+
|
118
145
|
# Checks equality by comparing each attribute.
|
119
146
|
# @param [Object] Object to be compared
|
120
147
|
def ==(o)
|
@@ -140,37 +167,30 @@ module BmcApi
|
|
140
167
|
# @param [Hash] attributes Model attributes in the form of hash
|
141
168
|
# @return [Object] Returns the model itself
|
142
169
|
def self.build_from_hash(attributes)
|
143
|
-
new.build_from_hash(attributes)
|
144
|
-
end
|
145
|
-
|
146
|
-
# Builds the object from hash
|
147
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
148
|
-
# @return [Object] Returns the model itself
|
149
|
-
def build_from_hash(attributes)
|
150
170
|
return nil unless attributes.is_a?(Hash)
|
151
171
|
attributes = attributes.transform_keys(&:to_sym)
|
152
|
-
|
153
|
-
|
154
|
-
|
172
|
+
transformed_hash = {}
|
173
|
+
openapi_types.each_pair do |key, type|
|
174
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
175
|
+
transformed_hash["#{key}"] = nil
|
155
176
|
elsif type =~ /\AArray<(.*)>/i
|
156
177
|
# check to ensure the input is an array given that the attribute
|
157
178
|
# is documented as an array but the input is not
|
158
|
-
if attributes[
|
159
|
-
|
179
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
180
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
160
181
|
end
|
161
|
-
elsif !attributes[
|
162
|
-
|
182
|
+
elsif !attributes[attribute_map[key]].nil?
|
183
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
163
184
|
end
|
164
185
|
end
|
165
|
-
|
166
|
-
self
|
186
|
+
new(transformed_hash)
|
167
187
|
end
|
168
188
|
|
169
189
|
# Deserializes the data based on type
|
170
190
|
# @param string type Data type
|
171
191
|
# @param string value Value to be deserialized
|
172
192
|
# @return [Object] Deserialized data
|
173
|
-
def _deserialize(type, value)
|
193
|
+
def self._deserialize(type, value)
|
174
194
|
case type.to_sym
|
175
195
|
when :Time
|
176
196
|
Time.parse(value)
|
@@ -205,7 +225,7 @@ module BmcApi
|
|
205
225
|
else # model
|
206
226
|
# models (e.g. Pet) or oneOf
|
207
227
|
klass = BmcApi.const_get(type)
|
208
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
228
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
209
229
|
end
|
210
230
|
end
|
211
231
|
|
@@ -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
|
-
OpenAPI Generator version:
|
9
|
+
OpenAPI Generator version: 7.2.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -56,8 +56,7 @@ module BmcApi
|
|
56
56
|
# List of class defined in allOf (OpenAPI v3)
|
57
57
|
def self.openapi_all_of
|
58
58
|
[
|
59
|
-
:'QuotaEditLimitRequest'
|
60
|
-
:'QuotaEditLimitRequestDetailsAllOf'
|
59
|
+
:'QuotaEditLimitRequest'
|
61
60
|
]
|
62
61
|
end
|
63
62
|
|
@@ -78,20 +77,27 @@ module BmcApi
|
|
78
77
|
|
79
78
|
if attributes.key?(:'limit')
|
80
79
|
self.limit = attributes[:'limit']
|
80
|
+
else
|
81
|
+
self.limit = nil
|
81
82
|
end
|
82
83
|
|
83
84
|
if attributes.key?(:'reason')
|
84
85
|
self.reason = attributes[:'reason']
|
86
|
+
else
|
87
|
+
self.reason = nil
|
85
88
|
end
|
86
89
|
|
87
90
|
if attributes.key?(:'requested_on')
|
88
91
|
self.requested_on = attributes[:'requested_on']
|
92
|
+
else
|
93
|
+
self.requested_on = nil
|
89
94
|
end
|
90
95
|
end
|
91
96
|
|
92
97
|
# Show invalid properties with the reasons. Usually used together with valid?
|
93
98
|
# @return Array for valid properties with the reasons
|
94
99
|
def list_invalid_properties
|
100
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
95
101
|
invalid_properties = Array.new
|
96
102
|
if @limit.nil?
|
97
103
|
invalid_properties.push('invalid value for "limit", limit cannot be nil.')
|
@@ -105,6 +111,11 @@ module BmcApi
|
|
105
111
|
invalid_properties.push('invalid value for "reason", reason cannot be nil.')
|
106
112
|
end
|
107
113
|
|
114
|
+
pattern = Regexp.new(/^(?!\s*$).+/)
|
115
|
+
if @reason !~ pattern
|
116
|
+
invalid_properties.push("invalid value for \"reason\", must conform to the pattern #{pattern}.")
|
117
|
+
end
|
118
|
+
|
108
119
|
if @requested_on.nil?
|
109
120
|
invalid_properties.push('invalid value for "requested_on", requested_on cannot be nil.')
|
110
121
|
end
|
@@ -115,9 +126,11 @@ module BmcApi
|
|
115
126
|
# Check to see if the all the properties in the model are valid
|
116
127
|
# @return true if the model is valid
|
117
128
|
def valid?
|
129
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
118
130
|
return false if @limit.nil?
|
119
131
|
return false if @limit < 0
|
120
132
|
return false if @reason.nil?
|
133
|
+
return false if @reason !~ Regexp.new(/^(?!\s*$).+/)
|
121
134
|
return false if @requested_on.nil?
|
122
135
|
true
|
123
136
|
end
|
@@ -136,6 +149,21 @@ module BmcApi
|
|
136
149
|
@limit = limit
|
137
150
|
end
|
138
151
|
|
152
|
+
# Custom attribute writer method with validation
|
153
|
+
# @param [Object] reason Value to be assigned
|
154
|
+
def reason=(reason)
|
155
|
+
if reason.nil?
|
156
|
+
fail ArgumentError, 'reason cannot be nil'
|
157
|
+
end
|
158
|
+
|
159
|
+
pattern = Regexp.new(/^(?!\s*$).+/)
|
160
|
+
if reason !~ pattern
|
161
|
+
fail ArgumentError, "invalid value for \"reason\", must conform to the pattern #{pattern}."
|
162
|
+
end
|
163
|
+
|
164
|
+
@reason = reason
|
165
|
+
end
|
166
|
+
|
139
167
|
# Checks equality by comparing each attribute.
|
140
168
|
# @param [Object] Object to be compared
|
141
169
|
def ==(o)
|
@@ -162,37 +190,30 @@ module BmcApi
|
|
162
190
|
# @param [Hash] attributes Model attributes in the form of hash
|
163
191
|
# @return [Object] Returns the model itself
|
164
192
|
def self.build_from_hash(attributes)
|
165
|
-
new.build_from_hash(attributes)
|
166
|
-
end
|
167
|
-
|
168
|
-
# Builds the object from hash
|
169
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
170
|
-
# @return [Object] Returns the model itself
|
171
|
-
def build_from_hash(attributes)
|
172
193
|
return nil unless attributes.is_a?(Hash)
|
173
194
|
attributes = attributes.transform_keys(&:to_sym)
|
174
|
-
|
175
|
-
|
176
|
-
|
195
|
+
transformed_hash = {}
|
196
|
+
openapi_types.each_pair do |key, type|
|
197
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
198
|
+
transformed_hash["#{key}"] = nil
|
177
199
|
elsif type =~ /\AArray<(.*)>/i
|
178
200
|
# check to ensure the input is an array given that the attribute
|
179
201
|
# is documented as an array but the input is not
|
180
|
-
if attributes[
|
181
|
-
|
202
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
203
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
182
204
|
end
|
183
|
-
elsif !attributes[
|
184
|
-
|
205
|
+
elsif !attributes[attribute_map[key]].nil?
|
206
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
185
207
|
end
|
186
208
|
end
|
187
|
-
|
188
|
-
self
|
209
|
+
new(transformed_hash)
|
189
210
|
end
|
190
211
|
|
191
212
|
# Deserializes the data based on type
|
192
213
|
# @param string type Data type
|
193
214
|
# @param string value Value to be deserialized
|
194
215
|
# @return [Object] Deserialized data
|
195
|
-
def _deserialize(type, value)
|
216
|
+
def self._deserialize(type, value)
|
196
217
|
case type.to_sym
|
197
218
|
when :Time
|
198
219
|
Time.parse(value)
|
@@ -227,7 +248,7 @@ module BmcApi
|
|
227
248
|
else # model
|
228
249
|
# models (e.g. Pet) or oneOf
|
229
250
|
klass = BmcApi.const_get(type)
|
230
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
251
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
231
252
|
end
|
232
253
|
end
|
233
254
|
|
@@ -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
|
-
OpenAPI Generator version:
|
9
|
+
OpenAPI Generator version: 7.2.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -69,6 +69,7 @@ module BmcApi
|
|
69
69
|
# Show invalid properties with the reasons. Usually used together with valid?
|
70
70
|
# @return Array for valid properties with the reasons
|
71
71
|
def list_invalid_properties
|
72
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
72
73
|
invalid_properties = Array.new
|
73
74
|
invalid_properties
|
74
75
|
end
|
@@ -76,6 +77,7 @@ module BmcApi
|
|
76
77
|
# Check to see if the all the properties in the model are valid
|
77
78
|
# @return true if the model is valid
|
78
79
|
def valid?
|
80
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
79
81
|
true
|
80
82
|
end
|
81
83
|
|
@@ -103,37 +105,30 @@ module BmcApi
|
|
103
105
|
# @param [Hash] attributes Model attributes in the form of hash
|
104
106
|
# @return [Object] Returns the model itself
|
105
107
|
def self.build_from_hash(attributes)
|
106
|
-
new.build_from_hash(attributes)
|
107
|
-
end
|
108
|
-
|
109
|
-
# Builds the object from hash
|
110
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
111
|
-
# @return [Object] Returns the model itself
|
112
|
-
def build_from_hash(attributes)
|
113
108
|
return nil unless attributes.is_a?(Hash)
|
114
109
|
attributes = attributes.transform_keys(&:to_sym)
|
115
|
-
|
116
|
-
|
117
|
-
|
110
|
+
transformed_hash = {}
|
111
|
+
openapi_types.each_pair do |key, type|
|
112
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
113
|
+
transformed_hash["#{key}"] = nil
|
118
114
|
elsif type =~ /\AArray<(.*)>/i
|
119
115
|
# check to ensure the input is an array given that the attribute
|
120
116
|
# is documented as an array but the input is not
|
121
|
-
if attributes[
|
122
|
-
|
117
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
118
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
123
119
|
end
|
124
|
-
elsif !attributes[
|
125
|
-
|
120
|
+
elsif !attributes[attribute_map[key]].nil?
|
121
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
126
122
|
end
|
127
123
|
end
|
128
|
-
|
129
|
-
self
|
124
|
+
new(transformed_hash)
|
130
125
|
end
|
131
126
|
|
132
127
|
# Deserializes the data based on type
|
133
128
|
# @param string type Data type
|
134
129
|
# @param string value Value to be deserialized
|
135
130
|
# @return [Object] Deserialized data
|
136
|
-
def _deserialize(type, value)
|
131
|
+
def self._deserialize(type, value)
|
137
132
|
case type.to_sym
|
138
133
|
when :Time
|
139
134
|
Time.parse(value)
|
@@ -168,7 +163,7 @@ module BmcApi
|
|
168
163
|
else # model
|
169
164
|
# models (e.g. Pet) or oneOf
|
170
165
|
klass = BmcApi.const_get(type)
|
171
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
166
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
172
167
|
end
|
173
168
|
end
|
174
169
|
|
@@ -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
|
-
OpenAPI Generator version:
|
9
|
+
OpenAPI Generator version: 7.2.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -70,6 +70,8 @@ module BmcApi
|
|
70
70
|
|
71
71
|
if attributes.key?(:'result')
|
72
72
|
self.result = attributes[:'result']
|
73
|
+
else
|
74
|
+
self.result = nil
|
73
75
|
end
|
74
76
|
|
75
77
|
if attributes.key?(:'password')
|
@@ -84,6 +86,7 @@ module BmcApi
|
|
84
86
|
# Show invalid properties with the reasons. Usually used together with valid?
|
85
87
|
# @return Array for valid properties with the reasons
|
86
88
|
def list_invalid_properties
|
89
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
87
90
|
invalid_properties = Array.new
|
88
91
|
if @result.nil?
|
89
92
|
invalid_properties.push('invalid value for "result", result cannot be nil.')
|
@@ -95,6 +98,7 @@ module BmcApi
|
|
95
98
|
# Check to see if the all the properties in the model are valid
|
96
99
|
# @return true if the model is valid
|
97
100
|
def valid?
|
101
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
98
102
|
return false if @result.nil?
|
99
103
|
true
|
100
104
|
end
|
@@ -125,37 +129,30 @@ module BmcApi
|
|
125
129
|
# @param [Hash] attributes Model attributes in the form of hash
|
126
130
|
# @return [Object] Returns the model itself
|
127
131
|
def self.build_from_hash(attributes)
|
128
|
-
new.build_from_hash(attributes)
|
129
|
-
end
|
130
|
-
|
131
|
-
# Builds the object from hash
|
132
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
133
|
-
# @return [Object] Returns the model itself
|
134
|
-
def build_from_hash(attributes)
|
135
132
|
return nil unless attributes.is_a?(Hash)
|
136
133
|
attributes = attributes.transform_keys(&:to_sym)
|
137
|
-
|
138
|
-
|
139
|
-
|
134
|
+
transformed_hash = {}
|
135
|
+
openapi_types.each_pair do |key, type|
|
136
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
137
|
+
transformed_hash["#{key}"] = nil
|
140
138
|
elsif type =~ /\AArray<(.*)>/i
|
141
139
|
# check to ensure the input is an array given that the attribute
|
142
140
|
# is documented as an array but the input is not
|
143
|
-
if attributes[
|
144
|
-
|
141
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
142
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
145
143
|
end
|
146
|
-
elsif !attributes[
|
147
|
-
|
144
|
+
elsif !attributes[attribute_map[key]].nil?
|
145
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
148
146
|
end
|
149
147
|
end
|
150
|
-
|
151
|
-
self
|
148
|
+
new(transformed_hash)
|
152
149
|
end
|
153
150
|
|
154
151
|
# Deserializes the data based on type
|
155
152
|
# @param string type Data type
|
156
153
|
# @param string value Value to be deserialized
|
157
154
|
# @return [Object] Deserialized data
|
158
|
-
def _deserialize(type, value)
|
155
|
+
def self._deserialize(type, value)
|
159
156
|
case type.to_sym
|
160
157
|
when :Time
|
161
158
|
Time.parse(value)
|
@@ -190,7 +187,7 @@ module BmcApi
|
|
190
187
|
else # model
|
191
188
|
# models (e.g. Pet) or oneOf
|
192
189
|
klass = BmcApi.const_get(type)
|
193
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
190
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
194
191
|
end
|
195
192
|
end
|
196
193
|
|