pnap_bmc_api 1.5.0 → 2.1.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 +7 -1
- data/VERSION +1 -1
- data/docs/DeleteResult.md +1 -1
- data/docs/EsxiDatastoreConfiguration.md +18 -0
- data/docs/EsxiOsConfiguration.md +18 -0
- data/docs/OsConfiguration.md +2 -0
- 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 +26 -23
- 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/esxi_datastore_configuration.rb +262 -0
- data/lib/pnap_bmc_api/models/{quota_edit_limit_request_details_all_of.rb → esxi_os_configuration.rb} +25 -36
- 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 +29 -21
- 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 +4 -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/esxi_datastore_configuration_spec.rb +36 -0
- data/spec/models/esxi_os_configuration_spec.rb +36 -0
- 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 +39 -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 +43 -39
- data/docs/QuotaEditLimitRequestDetailsAllOf.md +0 -18
- 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
|
|
@@ -34,6 +34,8 @@ module BmcApi
|
|
34
34
|
# If true, OS will be installed to and booted from the server's RAM. On restart RAM OS will be lost and the server will not be reachable unless a custom bootable OS has been deployed. Follow the <a href='https://phoenixnap.com/kb/bmc-custom-os' target='_blank'>instructions</a> on how to install custom OS on BMC. Only supported for ubuntu/focal and ubuntu/jammy.
|
35
35
|
attr_accessor :install_os_to_ram
|
36
36
|
|
37
|
+
attr_accessor :esxi
|
38
|
+
|
37
39
|
attr_accessor :cloud_init
|
38
40
|
|
39
41
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -46,6 +48,7 @@ module BmcApi
|
|
46
48
|
:'management_ui_url' => :'managementUiUrl',
|
47
49
|
:'management_access_allowed_ips' => :'managementAccessAllowedIps',
|
48
50
|
:'install_os_to_ram' => :'installOsToRam',
|
51
|
+
:'esxi' => :'esxi',
|
49
52
|
:'cloud_init' => :'cloudInit'
|
50
53
|
}
|
51
54
|
end
|
@@ -65,6 +68,7 @@ module BmcApi
|
|
65
68
|
:'management_ui_url' => :'String',
|
66
69
|
:'management_access_allowed_ips' => :'Array<String>',
|
67
70
|
:'install_os_to_ram' => :'Boolean',
|
71
|
+
:'esxi' => :'EsxiOsConfiguration',
|
68
72
|
:'cloud_init' => :'OsConfigurationCloudInit'
|
69
73
|
}
|
70
74
|
end
|
@@ -122,6 +126,10 @@ module BmcApi
|
|
122
126
|
self.install_os_to_ram = false
|
123
127
|
end
|
124
128
|
|
129
|
+
if attributes.key?(:'esxi')
|
130
|
+
self.esxi = attributes[:'esxi']
|
131
|
+
end
|
132
|
+
|
125
133
|
if attributes.key?(:'cloud_init')
|
126
134
|
self.cloud_init = attributes[:'cloud_init']
|
127
135
|
end
|
@@ -130,6 +138,7 @@ module BmcApi
|
|
130
138
|
# Show invalid properties with the reasons. Usually used together with valid?
|
131
139
|
# @return Array for valid properties with the reasons
|
132
140
|
def list_invalid_properties
|
141
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
133
142
|
invalid_properties = Array.new
|
134
143
|
if !@management_access_allowed_ips.nil? && @management_access_allowed_ips.length < 1
|
135
144
|
invalid_properties.push('invalid value for "management_access_allowed_ips", number of items must be greater than or equal to 1.')
|
@@ -141,6 +150,7 @@ module BmcApi
|
|
141
150
|
# Check to see if the all the properties in the model are valid
|
142
151
|
# @return true if the model is valid
|
143
152
|
def valid?
|
153
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
144
154
|
return false if !@management_access_allowed_ips.nil? && @management_access_allowed_ips.length < 1
|
145
155
|
true
|
146
156
|
end
|
@@ -148,7 +158,11 @@ module BmcApi
|
|
148
158
|
# Custom attribute writer method with validation
|
149
159
|
# @param [Object] management_access_allowed_ips Value to be assigned
|
150
160
|
def management_access_allowed_ips=(management_access_allowed_ips)
|
151
|
-
if
|
161
|
+
if management_access_allowed_ips.nil?
|
162
|
+
fail ArgumentError, 'management_access_allowed_ips cannot be nil'
|
163
|
+
end
|
164
|
+
|
165
|
+
if management_access_allowed_ips.length < 1
|
152
166
|
fail ArgumentError, 'invalid value for "management_access_allowed_ips", number of items must be greater than or equal to 1.'
|
153
167
|
end
|
154
168
|
|
@@ -167,6 +181,7 @@ module BmcApi
|
|
167
181
|
management_ui_url == o.management_ui_url &&
|
168
182
|
management_access_allowed_ips == o.management_access_allowed_ips &&
|
169
183
|
install_os_to_ram == o.install_os_to_ram &&
|
184
|
+
esxi == o.esxi &&
|
170
185
|
cloud_init == o.cloud_init
|
171
186
|
end
|
172
187
|
|
@@ -179,44 +194,37 @@ module BmcApi
|
|
179
194
|
# Calculates hash code according to all attributes.
|
180
195
|
# @return [Integer] Hash code
|
181
196
|
def hash
|
182
|
-
[netris_controller, netris_softgate, windows, root_password, management_ui_url, management_access_allowed_ips, install_os_to_ram, cloud_init].hash
|
197
|
+
[netris_controller, netris_softgate, windows, root_password, management_ui_url, management_access_allowed_ips, install_os_to_ram, esxi, cloud_init].hash
|
183
198
|
end
|
184
199
|
|
185
200
|
# Builds the object from hash
|
186
201
|
# @param [Hash] attributes Model attributes in the form of hash
|
187
202
|
# @return [Object] Returns the model itself
|
188
203
|
def self.build_from_hash(attributes)
|
189
|
-
new.build_from_hash(attributes)
|
190
|
-
end
|
191
|
-
|
192
|
-
# Builds the object from hash
|
193
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
194
|
-
# @return [Object] Returns the model itself
|
195
|
-
def build_from_hash(attributes)
|
196
204
|
return nil unless attributes.is_a?(Hash)
|
197
205
|
attributes = attributes.transform_keys(&:to_sym)
|
198
|
-
|
199
|
-
|
200
|
-
|
206
|
+
transformed_hash = {}
|
207
|
+
openapi_types.each_pair do |key, type|
|
208
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
209
|
+
transformed_hash["#{key}"] = nil
|
201
210
|
elsif type =~ /\AArray<(.*)>/i
|
202
211
|
# check to ensure the input is an array given that the attribute
|
203
212
|
# is documented as an array but the input is not
|
204
|
-
if attributes[
|
205
|
-
|
213
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
214
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
206
215
|
end
|
207
|
-
elsif !attributes[
|
208
|
-
|
216
|
+
elsif !attributes[attribute_map[key]].nil?
|
217
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
209
218
|
end
|
210
219
|
end
|
211
|
-
|
212
|
-
self
|
220
|
+
new(transformed_hash)
|
213
221
|
end
|
214
222
|
|
215
223
|
# Deserializes the data based on type
|
216
224
|
# @param string type Data type
|
217
225
|
# @param string value Value to be deserialized
|
218
226
|
# @return [Object] Deserialized data
|
219
|
-
def _deserialize(type, value)
|
227
|
+
def self._deserialize(type, value)
|
220
228
|
case type.to_sym
|
221
229
|
when :Time
|
222
230
|
Time.parse(value)
|
@@ -251,7 +259,7 @@ module BmcApi
|
|
251
259
|
else # model
|
252
260
|
# models (e.g. Pet) or oneOf
|
253
261
|
klass = BmcApi.const_get(type)
|
254
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
262
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
255
263
|
end
|
256
264
|
end
|
257
265
|
|
@@ -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
|
|
@@ -16,7 +16,7 @@ require 'time'
|
|
16
16
|
module BmcApi
|
17
17
|
# Cloud-init configuration details.
|
18
18
|
class OsConfigurationCloudInit
|
19
|
-
# User data for the <a href='https://cloudinit.readthedocs.io/en/latest/' target='_blank'>cloud-init</a> configuration in base64 encoding. NoCloud format is supported. Follow the <a href='https://phoenixnap.com/kb/bmc-cloud-init' target='_blank'>instructions</a> on how to provision a server using cloud-init. Only ubuntu/bionic, ubuntu/focal and ubuntu/jammy are supported. User data will not be stored and cannot be retrieved once you deploy the server. Copy and save it for future reference.
|
19
|
+
# (Write-only) User data for the <a href='https://cloudinit.readthedocs.io/en/latest/' target='_blank'>cloud-init</a> configuration in base64 encoding. NoCloud format is supported. Follow the <a href='https://phoenixnap.com/kb/bmc-cloud-init' target='_blank'>instructions</a> on how to provision a server using cloud-init. Only ubuntu/bionic, ubuntu/focal and ubuntu/jammy are supported. User data will not be stored and cannot be retrieved once you deploy the server. Copy and save it for future reference.
|
20
20
|
attr_accessor :user_data
|
21
21
|
|
22
22
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -67,6 +67,7 @@ module BmcApi
|
|
67
67
|
# Show invalid properties with the reasons. Usually used together with valid?
|
68
68
|
# @return Array for valid properties with the reasons
|
69
69
|
def list_invalid_properties
|
70
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
70
71
|
invalid_properties = Array.new
|
71
72
|
invalid_properties
|
72
73
|
end
|
@@ -74,6 +75,7 @@ module BmcApi
|
|
74
75
|
# Check to see if the all the properties in the model are valid
|
75
76
|
# @return true if the model is valid
|
76
77
|
def valid?
|
78
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
77
79
|
true
|
78
80
|
end
|
79
81
|
|
@@ -101,37 +103,30 @@ module BmcApi
|
|
101
103
|
# @param [Hash] attributes Model attributes in the form of hash
|
102
104
|
# @return [Object] Returns the model itself
|
103
105
|
def self.build_from_hash(attributes)
|
104
|
-
new.build_from_hash(attributes)
|
105
|
-
end
|
106
|
-
|
107
|
-
# Builds the object from hash
|
108
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
109
|
-
# @return [Object] Returns the model itself
|
110
|
-
def build_from_hash(attributes)
|
111
106
|
return nil unless attributes.is_a?(Hash)
|
112
107
|
attributes = attributes.transform_keys(&:to_sym)
|
113
|
-
|
114
|
-
|
115
|
-
|
108
|
+
transformed_hash = {}
|
109
|
+
openapi_types.each_pair do |key, type|
|
110
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
111
|
+
transformed_hash["#{key}"] = nil
|
116
112
|
elsif type =~ /\AArray<(.*)>/i
|
117
113
|
# check to ensure the input is an array given that the attribute
|
118
114
|
# is documented as an array but the input is not
|
119
|
-
if attributes[
|
120
|
-
|
115
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
116
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
121
117
|
end
|
122
|
-
elsif !attributes[
|
123
|
-
|
118
|
+
elsif !attributes[attribute_map[key]].nil?
|
119
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
124
120
|
end
|
125
121
|
end
|
126
|
-
|
127
|
-
self
|
122
|
+
new(transformed_hash)
|
128
123
|
end
|
129
124
|
|
130
125
|
# Deserializes the data based on type
|
131
126
|
# @param string type Data type
|
132
127
|
# @param string value Value to be deserialized
|
133
128
|
# @return [Object] Deserialized data
|
134
|
-
def _deserialize(type, value)
|
129
|
+
def self._deserialize(type, value)
|
135
130
|
case type.to_sym
|
136
131
|
when :Time
|
137
132
|
Time.parse(value)
|
@@ -166,7 +161,7 @@ module BmcApi
|
|
166
161
|
else # model
|
167
162
|
# models (e.g. Pet) or oneOf
|
168
163
|
klass = BmcApi.const_get(type)
|
169
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
164
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
170
165
|
end
|
171
166
|
end
|
172
167
|
|
@@ -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
|
|
@@ -82,6 +82,7 @@ module BmcApi
|
|
82
82
|
# Show invalid properties with the reasons. Usually used together with valid?
|
83
83
|
# @return Array for valid properties with the reasons
|
84
84
|
def list_invalid_properties
|
85
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
85
86
|
invalid_properties = Array.new
|
86
87
|
invalid_properties
|
87
88
|
end
|
@@ -89,6 +90,7 @@ module BmcApi
|
|
89
90
|
# Check to see if the all the properties in the model are valid
|
90
91
|
# @return true if the model is valid
|
91
92
|
def valid?
|
93
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
92
94
|
true
|
93
95
|
end
|
94
96
|
|
@@ -118,37 +120,30 @@ module BmcApi
|
|
118
120
|
# @param [Hash] attributes Model attributes in the form of hash
|
119
121
|
# @return [Object] Returns the model itself
|
120
122
|
def self.build_from_hash(attributes)
|
121
|
-
new.build_from_hash(attributes)
|
122
|
-
end
|
123
|
-
|
124
|
-
# Builds the object from hash
|
125
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
126
|
-
# @return [Object] Returns the model itself
|
127
|
-
def build_from_hash(attributes)
|
128
123
|
return nil unless attributes.is_a?(Hash)
|
129
124
|
attributes = attributes.transform_keys(&:to_sym)
|
130
|
-
|
131
|
-
|
132
|
-
|
125
|
+
transformed_hash = {}
|
126
|
+
openapi_types.each_pair do |key, type|
|
127
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
128
|
+
transformed_hash["#{key}"] = nil
|
133
129
|
elsif type =~ /\AArray<(.*)>/i
|
134
130
|
# check to ensure the input is an array given that the attribute
|
135
131
|
# is documented as an array but the input is not
|
136
|
-
if attributes[
|
137
|
-
|
132
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
133
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
138
134
|
end
|
139
|
-
elsif !attributes[
|
140
|
-
|
135
|
+
elsif !attributes[attribute_map[key]].nil?
|
136
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
141
137
|
end
|
142
138
|
end
|
143
|
-
|
144
|
-
self
|
139
|
+
new(transformed_hash)
|
145
140
|
end
|
146
141
|
|
147
142
|
# Deserializes the data based on type
|
148
143
|
# @param string type Data type
|
149
144
|
# @param string value Value to be deserialized
|
150
145
|
# @return [Object] Deserialized data
|
151
|
-
def _deserialize(type, value)
|
146
|
+
def self._deserialize(type, value)
|
152
147
|
case type.to_sym
|
153
148
|
when :Time
|
154
149
|
Time.parse(value)
|
@@ -183,7 +178,7 @@ module BmcApi
|
|
183
178
|
else # model
|
184
179
|
# models (e.g. Pet) or oneOf
|
185
180
|
klass = BmcApi.const_get(type)
|
186
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
181
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
187
182
|
end
|
188
183
|
end
|
189
184
|
|
@@ -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
|
|
@@ -87,6 +87,7 @@ module BmcApi
|
|
87
87
|
# Show invalid properties with the reasons. Usually used together with valid?
|
88
88
|
# @return Array for valid properties with the reasons
|
89
89
|
def list_invalid_properties
|
90
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
90
91
|
invalid_properties = Array.new
|
91
92
|
if !@management_access_allowed_ips.nil? && @management_access_allowed_ips.length < 1
|
92
93
|
invalid_properties.push('invalid value for "management_access_allowed_ips", number of items must be greater than or equal to 1.')
|
@@ -98,6 +99,7 @@ module BmcApi
|
|
98
99
|
# Check to see if the all the properties in the model are valid
|
99
100
|
# @return true if the model is valid
|
100
101
|
def valid?
|
102
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
101
103
|
return false if !@management_access_allowed_ips.nil? && @management_access_allowed_ips.length < 1
|
102
104
|
true
|
103
105
|
end
|
@@ -105,7 +107,11 @@ module BmcApi
|
|
105
107
|
# Custom attribute writer method with validation
|
106
108
|
# @param [Object] management_access_allowed_ips Value to be assigned
|
107
109
|
def management_access_allowed_ips=(management_access_allowed_ips)
|
108
|
-
if
|
110
|
+
if management_access_allowed_ips.nil?
|
111
|
+
fail ArgumentError, 'management_access_allowed_ips cannot be nil'
|
112
|
+
end
|
113
|
+
|
114
|
+
if management_access_allowed_ips.length < 1
|
109
115
|
fail ArgumentError, 'invalid value for "management_access_allowed_ips", number of items must be greater than or equal to 1.'
|
110
116
|
end
|
111
117
|
|
@@ -138,37 +144,30 @@ module BmcApi
|
|
138
144
|
# @param [Hash] attributes Model attributes in the form of hash
|
139
145
|
# @return [Object] Returns the model itself
|
140
146
|
def self.build_from_hash(attributes)
|
141
|
-
new.build_from_hash(attributes)
|
142
|
-
end
|
143
|
-
|
144
|
-
# Builds the object from hash
|
145
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
146
|
-
# @return [Object] Returns the model itself
|
147
|
-
def build_from_hash(attributes)
|
148
147
|
return nil unless attributes.is_a?(Hash)
|
149
148
|
attributes = attributes.transform_keys(&:to_sym)
|
150
|
-
|
151
|
-
|
152
|
-
|
149
|
+
transformed_hash = {}
|
150
|
+
openapi_types.each_pair do |key, type|
|
151
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
152
|
+
transformed_hash["#{key}"] = nil
|
153
153
|
elsif type =~ /\AArray<(.*)>/i
|
154
154
|
# check to ensure the input is an array given that the attribute
|
155
155
|
# is documented as an array but the input is not
|
156
|
-
if attributes[
|
157
|
-
|
156
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
157
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
158
158
|
end
|
159
|
-
elsif !attributes[
|
160
|
-
|
159
|
+
elsif !attributes[attribute_map[key]].nil?
|
160
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
161
161
|
end
|
162
162
|
end
|
163
|
-
|
164
|
-
self
|
163
|
+
new(transformed_hash)
|
165
164
|
end
|
166
165
|
|
167
166
|
# Deserializes the data based on type
|
168
167
|
# @param string type Data type
|
169
168
|
# @param string value Value to be deserialized
|
170
169
|
# @return [Object] Deserialized data
|
171
|
-
def _deserialize(type, value)
|
170
|
+
def self._deserialize(type, value)
|
172
171
|
case type.to_sym
|
173
172
|
when :Time
|
174
173
|
Time.parse(value)
|
@@ -203,7 +202,7 @@ module BmcApi
|
|
203
202
|
else # model
|
204
203
|
# models (e.g. Pet) or oneOf
|
205
204
|
klass = BmcApi.const_get(type)
|
206
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
205
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
207
206
|
end
|
208
207
|
end
|
209
208
|
|
@@ -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
|
|
@@ -87,6 +87,7 @@ module BmcApi
|
|
87
87
|
# Show invalid properties with the reasons. Usually used together with valid?
|
88
88
|
# @return Array for valid properties with the reasons
|
89
89
|
def list_invalid_properties
|
90
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
90
91
|
invalid_properties = Array.new
|
91
92
|
if !@management_access_allowed_ips.nil? && @management_access_allowed_ips.length < 1
|
92
93
|
invalid_properties.push('invalid value for "management_access_allowed_ips", number of items must be greater than or equal to 1.')
|
@@ -98,6 +99,7 @@ module BmcApi
|
|
98
99
|
# Check to see if the all the properties in the model are valid
|
99
100
|
# @return true if the model is valid
|
100
101
|
def valid?
|
102
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
101
103
|
return false if !@management_access_allowed_ips.nil? && @management_access_allowed_ips.length < 1
|
102
104
|
true
|
103
105
|
end
|
@@ -105,7 +107,11 @@ module BmcApi
|
|
105
107
|
# Custom attribute writer method with validation
|
106
108
|
# @param [Object] management_access_allowed_ips Value to be assigned
|
107
109
|
def management_access_allowed_ips=(management_access_allowed_ips)
|
108
|
-
if
|
110
|
+
if management_access_allowed_ips.nil?
|
111
|
+
fail ArgumentError, 'management_access_allowed_ips cannot be nil'
|
112
|
+
end
|
113
|
+
|
114
|
+
if management_access_allowed_ips.length < 1
|
109
115
|
fail ArgumentError, 'invalid value for "management_access_allowed_ips", number of items must be greater than or equal to 1.'
|
110
116
|
end
|
111
117
|
|
@@ -138,37 +144,30 @@ module BmcApi
|
|
138
144
|
# @param [Hash] attributes Model attributes in the form of hash
|
139
145
|
# @return [Object] Returns the model itself
|
140
146
|
def self.build_from_hash(attributes)
|
141
|
-
new.build_from_hash(attributes)
|
142
|
-
end
|
143
|
-
|
144
|
-
# Builds the object from hash
|
145
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
146
|
-
# @return [Object] Returns the model itself
|
147
|
-
def build_from_hash(attributes)
|
148
147
|
return nil unless attributes.is_a?(Hash)
|
149
148
|
attributes = attributes.transform_keys(&:to_sym)
|
150
|
-
|
151
|
-
|
152
|
-
|
149
|
+
transformed_hash = {}
|
150
|
+
openapi_types.each_pair do |key, type|
|
151
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
152
|
+
transformed_hash["#{key}"] = nil
|
153
153
|
elsif type =~ /\AArray<(.*)>/i
|
154
154
|
# check to ensure the input is an array given that the attribute
|
155
155
|
# is documented as an array but the input is not
|
156
|
-
if attributes[
|
157
|
-
|
156
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
157
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
158
158
|
end
|
159
|
-
elsif !attributes[
|
160
|
-
|
159
|
+
elsif !attributes[attribute_map[key]].nil?
|
160
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
161
161
|
end
|
162
162
|
end
|
163
|
-
|
164
|
-
self
|
163
|
+
new(transformed_hash)
|
165
164
|
end
|
166
165
|
|
167
166
|
# Deserializes the data based on type
|
168
167
|
# @param string type Data type
|
169
168
|
# @param string value Value to be deserialized
|
170
169
|
# @return [Object] Deserialized data
|
171
|
-
def _deserialize(type, value)
|
170
|
+
def self._deserialize(type, value)
|
172
171
|
case type.to_sym
|
173
172
|
when :Time
|
174
173
|
Time.parse(value)
|
@@ -203,7 +202,7 @@ module BmcApi
|
|
203
202
|
else # model
|
204
203
|
# models (e.g. Pet) or oneOf
|
205
204
|
klass = BmcApi.const_get(type)
|
206
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
205
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
207
206
|
end
|
208
207
|
end
|
209
208
|
|
@@ -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
|
|
@@ -85,6 +85,7 @@ module BmcApi
|
|
85
85
|
# Show invalid properties with the reasons. Usually used together with valid?
|
86
86
|
# @return Array for valid properties with the reasons
|
87
87
|
def list_invalid_properties
|
88
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
88
89
|
invalid_properties = Array.new
|
89
90
|
invalid_properties
|
90
91
|
end
|
@@ -92,6 +93,7 @@ module BmcApi
|
|
92
93
|
# Check to see if the all the properties in the model are valid
|
93
94
|
# @return true if the model is valid
|
94
95
|
def valid?
|
96
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
95
97
|
true
|
96
98
|
end
|
97
99
|
|
@@ -121,37 +123,30 @@ module BmcApi
|
|
121
123
|
# @param [Hash] attributes Model attributes in the form of hash
|
122
124
|
# @return [Object] Returns the model itself
|
123
125
|
def self.build_from_hash(attributes)
|
124
|
-
new.build_from_hash(attributes)
|
125
|
-
end
|
126
|
-
|
127
|
-
# Builds the object from hash
|
128
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
129
|
-
# @return [Object] Returns the model itself
|
130
|
-
def build_from_hash(attributes)
|
131
126
|
return nil unless attributes.is_a?(Hash)
|
132
127
|
attributes = attributes.transform_keys(&:to_sym)
|
133
|
-
|
134
|
-
|
135
|
-
|
128
|
+
transformed_hash = {}
|
129
|
+
openapi_types.each_pair do |key, type|
|
130
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
131
|
+
transformed_hash["#{key}"] = nil
|
136
132
|
elsif type =~ /\AArray<(.*)>/i
|
137
133
|
# check to ensure the input is an array given that the attribute
|
138
134
|
# is documented as an array but the input is not
|
139
|
-
if attributes[
|
140
|
-
|
135
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
136
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
141
137
|
end
|
142
|
-
elsif !attributes[
|
143
|
-
|
138
|
+
elsif !attributes[attribute_map[key]].nil?
|
139
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
144
140
|
end
|
145
141
|
end
|
146
|
-
|
147
|
-
self
|
142
|
+
new(transformed_hash)
|
148
143
|
end
|
149
144
|
|
150
145
|
# Deserializes the data based on type
|
151
146
|
# @param string type Data type
|
152
147
|
# @param string value Value to be deserialized
|
153
148
|
# @return [Object] Deserialized data
|
154
|
-
def _deserialize(type, value)
|
149
|
+
def self._deserialize(type, value)
|
155
150
|
case type.to_sym
|
156
151
|
when :Time
|
157
152
|
Time.parse(value)
|
@@ -186,7 +181,7 @@ module BmcApi
|
|
186
181
|
else # model
|
187
182
|
# models (e.g. Pet) or oneOf
|
188
183
|
klass = BmcApi.const_get(type)
|
189
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
184
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
190
185
|
end
|
191
186
|
end
|
192
187
|
|