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
|
|
@@ -65,6 +65,8 @@ module BmcApi
|
|
65
65
|
|
66
66
|
if attributes.key?(:'message')
|
67
67
|
self.message = attributes[:'message']
|
68
|
+
else
|
69
|
+
self.message = nil
|
68
70
|
end
|
69
71
|
|
70
72
|
if attributes.key?(:'validation_errors')
|
@@ -77,6 +79,7 @@ module BmcApi
|
|
77
79
|
# Show invalid properties with the reasons. Usually used together with valid?
|
78
80
|
# @return Array for valid properties with the reasons
|
79
81
|
def list_invalid_properties
|
82
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
80
83
|
invalid_properties = Array.new
|
81
84
|
if @message.nil?
|
82
85
|
invalid_properties.push('invalid value for "message", message cannot be nil.')
|
@@ -88,6 +91,7 @@ module BmcApi
|
|
88
91
|
# Check to see if the all the properties in the model are valid
|
89
92
|
# @return true if the model is valid
|
90
93
|
def valid?
|
94
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
91
95
|
return false if @message.nil?
|
92
96
|
true
|
93
97
|
end
|
@@ -117,37 +121,30 @@ module BmcApi
|
|
117
121
|
# @param [Hash] attributes Model attributes in the form of hash
|
118
122
|
# @return [Object] Returns the model itself
|
119
123
|
def self.build_from_hash(attributes)
|
120
|
-
new.build_from_hash(attributes)
|
121
|
-
end
|
122
|
-
|
123
|
-
# Builds the object from hash
|
124
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
125
|
-
# @return [Object] Returns the model itself
|
126
|
-
def build_from_hash(attributes)
|
127
124
|
return nil unless attributes.is_a?(Hash)
|
128
125
|
attributes = attributes.transform_keys(&:to_sym)
|
129
|
-
|
130
|
-
|
131
|
-
|
126
|
+
transformed_hash = {}
|
127
|
+
openapi_types.each_pair do |key, type|
|
128
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
129
|
+
transformed_hash["#{key}"] = nil
|
132
130
|
elsif type =~ /\AArray<(.*)>/i
|
133
131
|
# check to ensure the input is an array given that the attribute
|
134
132
|
# is documented as an array but the input is not
|
135
|
-
if attributes[
|
136
|
-
|
133
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
134
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
137
135
|
end
|
138
|
-
elsif !attributes[
|
139
|
-
|
136
|
+
elsif !attributes[attribute_map[key]].nil?
|
137
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
140
138
|
end
|
141
139
|
end
|
142
|
-
|
143
|
-
self
|
140
|
+
new(transformed_hash)
|
144
141
|
end
|
145
142
|
|
146
143
|
# Deserializes the data based on type
|
147
144
|
# @param string type Data type
|
148
145
|
# @param string value Value to be deserialized
|
149
146
|
# @return [Object] Deserialized data
|
150
|
-
def _deserialize(type, value)
|
147
|
+
def self._deserialize(type, value)
|
151
148
|
case type.to_sym
|
152
149
|
when :Time
|
153
150
|
Time.parse(value)
|
@@ -182,7 +179,7 @@ module BmcApi
|
|
182
179
|
else # model
|
183
180
|
# models (e.g. Pet) or oneOf
|
184
181
|
klass = BmcApi.const_get(type)
|
185
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
182
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
186
183
|
end
|
187
184
|
end
|
188
185
|
|
@@ -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
|
|
@@ -102,6 +102,7 @@ module BmcApi
|
|
102
102
|
# Show invalid properties with the reasons. Usually used together with valid?
|
103
103
|
# @return Array for valid properties with the reasons
|
104
104
|
def list_invalid_properties
|
105
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
105
106
|
invalid_properties = Array.new
|
106
107
|
if !@ip_blocks.nil? && @ip_blocks.length > 1
|
107
108
|
invalid_properties.push('invalid value for "ip_blocks", number of items must be less than or equal to 1.')
|
@@ -113,6 +114,7 @@ module BmcApi
|
|
113
114
|
# Check to see if the all the properties in the model are valid
|
114
115
|
# @return true if the model is valid
|
115
116
|
def valid?
|
117
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
116
118
|
configuration_type_validator = EnumAttributeValidator.new('String', ["PURCHASE_NEW", "USER_DEFINED", "NONE"])
|
117
119
|
return false unless configuration_type_validator.valid?(@configuration_type)
|
118
120
|
return false if !@ip_blocks.nil? && @ip_blocks.length > 1
|
@@ -132,7 +134,11 @@ module BmcApi
|
|
132
134
|
# Custom attribute writer method with validation
|
133
135
|
# @param [Object] ip_blocks Value to be assigned
|
134
136
|
def ip_blocks=(ip_blocks)
|
135
|
-
if
|
137
|
+
if ip_blocks.nil?
|
138
|
+
fail ArgumentError, 'ip_blocks cannot be nil'
|
139
|
+
end
|
140
|
+
|
141
|
+
if ip_blocks.length > 1
|
136
142
|
fail ArgumentError, 'invalid value for "ip_blocks", number of items must be less than or equal to 1.'
|
137
143
|
end
|
138
144
|
|
@@ -164,37 +170,30 @@ module BmcApi
|
|
164
170
|
# @param [Hash] attributes Model attributes in the form of hash
|
165
171
|
# @return [Object] Returns the model itself
|
166
172
|
def self.build_from_hash(attributes)
|
167
|
-
new.build_from_hash(attributes)
|
168
|
-
end
|
169
|
-
|
170
|
-
# Builds the object from hash
|
171
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
172
|
-
# @return [Object] Returns the model itself
|
173
|
-
def build_from_hash(attributes)
|
174
173
|
return nil unless attributes.is_a?(Hash)
|
175
174
|
attributes = attributes.transform_keys(&:to_sym)
|
176
|
-
|
177
|
-
|
178
|
-
|
175
|
+
transformed_hash = {}
|
176
|
+
openapi_types.each_pair do |key, type|
|
177
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
178
|
+
transformed_hash["#{key}"] = nil
|
179
179
|
elsif type =~ /\AArray<(.*)>/i
|
180
180
|
# check to ensure the input is an array given that the attribute
|
181
181
|
# is documented as an array but the input is not
|
182
|
-
if attributes[
|
183
|
-
|
182
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
183
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
184
184
|
end
|
185
|
-
elsif !attributes[
|
186
|
-
|
185
|
+
elsif !attributes[attribute_map[key]].nil?
|
186
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
187
187
|
end
|
188
188
|
end
|
189
|
-
|
190
|
-
self
|
189
|
+
new(transformed_hash)
|
191
190
|
end
|
192
191
|
|
193
192
|
# Deserializes the data based on type
|
194
193
|
# @param string type Data type
|
195
194
|
# @param string value Value to be deserialized
|
196
195
|
# @return [Object] Deserialized data
|
197
|
-
def _deserialize(type, value)
|
196
|
+
def self._deserialize(type, value)
|
198
197
|
case type.to_sym
|
199
198
|
when :Time
|
200
199
|
Time.parse(value)
|
@@ -229,7 +228,7 @@ module BmcApi
|
|
229
228
|
else # model
|
230
229
|
# models (e.g. Pet) or oneOf
|
231
230
|
klass = BmcApi.const_get(type)
|
232
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
231
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
233
232
|
end
|
234
233
|
end
|
235
234
|
|
@@ -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
|
|
@@ -91,6 +91,7 @@ module BmcApi
|
|
91
91
|
# Show invalid properties with the reasons. Usually used together with valid?
|
92
92
|
# @return Array for valid properties with the reasons
|
93
93
|
def list_invalid_properties
|
94
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
94
95
|
invalid_properties = Array.new
|
95
96
|
invalid_properties
|
96
97
|
end
|
@@ -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
|
true
|
102
104
|
end
|
103
105
|
|
@@ -128,37 +130,30 @@ module BmcApi
|
|
128
130
|
# @param [Hash] attributes Model attributes in the form of hash
|
129
131
|
# @return [Object] Returns the model itself
|
130
132
|
def self.build_from_hash(attributes)
|
131
|
-
new.build_from_hash(attributes)
|
132
|
-
end
|
133
|
-
|
134
|
-
# Builds the object from hash
|
135
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
136
|
-
# @return [Object] Returns the model itself
|
137
|
-
def build_from_hash(attributes)
|
138
133
|
return nil unless attributes.is_a?(Hash)
|
139
134
|
attributes = attributes.transform_keys(&:to_sym)
|
140
|
-
|
141
|
-
|
142
|
-
|
135
|
+
transformed_hash = {}
|
136
|
+
openapi_types.each_pair do |key, type|
|
137
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
138
|
+
transformed_hash["#{key}"] = nil
|
143
139
|
elsif type =~ /\AArray<(.*)>/i
|
144
140
|
# check to ensure the input is an array given that the attribute
|
145
141
|
# is documented as an array but the input is not
|
146
|
-
if attributes[
|
147
|
-
|
142
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
143
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
148
144
|
end
|
149
|
-
elsif !attributes[
|
150
|
-
|
145
|
+
elsif !attributes[attribute_map[key]].nil?
|
146
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
151
147
|
end
|
152
148
|
end
|
153
|
-
|
154
|
-
self
|
149
|
+
new(transformed_hash)
|
155
150
|
end
|
156
151
|
|
157
152
|
# Deserializes the data based on type
|
158
153
|
# @param string type Data type
|
159
154
|
# @param string value Value to be deserialized
|
160
155
|
# @return [Object] Deserialized data
|
161
|
-
def _deserialize(type, value)
|
156
|
+
def self._deserialize(type, value)
|
162
157
|
case type.to_sym
|
163
158
|
when :Time
|
164
159
|
Time.parse(value)
|
@@ -193,7 +188,7 @@ module BmcApi
|
|
193
188
|
else # model
|
194
189
|
# models (e.g. Pet) or oneOf
|
195
190
|
klass = BmcApi.const_get(type)
|
196
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
191
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
197
192
|
end
|
198
193
|
end
|
199
194
|
|
@@ -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
|
|
@@ -130,6 +130,7 @@ module BmcApi
|
|
130
130
|
# Show invalid properties with the reasons. Usually used together with valid?
|
131
131
|
# @return Array for valid properties with the reasons
|
132
132
|
def list_invalid_properties
|
133
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
133
134
|
invalid_properties = Array.new
|
134
135
|
if !@management_access_allowed_ips.nil? && @management_access_allowed_ips.length < 1
|
135
136
|
invalid_properties.push('invalid value for "management_access_allowed_ips", number of items must be greater than or equal to 1.')
|
@@ -141,6 +142,7 @@ module BmcApi
|
|
141
142
|
# Check to see if the all the properties in the model are valid
|
142
143
|
# @return true if the model is valid
|
143
144
|
def valid?
|
145
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
144
146
|
return false if !@management_access_allowed_ips.nil? && @management_access_allowed_ips.length < 1
|
145
147
|
true
|
146
148
|
end
|
@@ -148,7 +150,11 @@ module BmcApi
|
|
148
150
|
# Custom attribute writer method with validation
|
149
151
|
# @param [Object] management_access_allowed_ips Value to be assigned
|
150
152
|
def management_access_allowed_ips=(management_access_allowed_ips)
|
151
|
-
if
|
153
|
+
if management_access_allowed_ips.nil?
|
154
|
+
fail ArgumentError, 'management_access_allowed_ips cannot be nil'
|
155
|
+
end
|
156
|
+
|
157
|
+
if management_access_allowed_ips.length < 1
|
152
158
|
fail ArgumentError, 'invalid value for "management_access_allowed_ips", number of items must be greater than or equal to 1.'
|
153
159
|
end
|
154
160
|
|
@@ -186,37 +192,30 @@ module BmcApi
|
|
186
192
|
# @param [Hash] attributes Model attributes in the form of hash
|
187
193
|
# @return [Object] Returns the model itself
|
188
194
|
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
195
|
return nil unless attributes.is_a?(Hash)
|
197
196
|
attributes = attributes.transform_keys(&:to_sym)
|
198
|
-
|
199
|
-
|
200
|
-
|
197
|
+
transformed_hash = {}
|
198
|
+
openapi_types.each_pair do |key, type|
|
199
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
200
|
+
transformed_hash["#{key}"] = nil
|
201
201
|
elsif type =~ /\AArray<(.*)>/i
|
202
202
|
# check to ensure the input is an array given that the attribute
|
203
203
|
# is documented as an array but the input is not
|
204
|
-
if attributes[
|
205
|
-
|
204
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
205
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
206
206
|
end
|
207
|
-
elsif !attributes[
|
208
|
-
|
207
|
+
elsif !attributes[attribute_map[key]].nil?
|
208
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
209
209
|
end
|
210
210
|
end
|
211
|
-
|
212
|
-
self
|
211
|
+
new(transformed_hash)
|
213
212
|
end
|
214
213
|
|
215
214
|
# Deserializes the data based on type
|
216
215
|
# @param string type Data type
|
217
216
|
# @param string value Value to be deserialized
|
218
217
|
# @return [Object] Deserialized data
|
219
|
-
def _deserialize(type, value)
|
218
|
+
def self._deserialize(type, value)
|
220
219
|
case type.to_sym
|
221
220
|
when :Time
|
222
221
|
Time.parse(value)
|
@@ -251,7 +250,7 @@ module BmcApi
|
|
251
250
|
else # model
|
252
251
|
# models (e.g. Pet) or oneOf
|
253
252
|
klass = BmcApi.const_get(type)
|
254
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
253
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
255
254
|
end
|
256
255
|
end
|
257
256
|
|
@@ -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
|
|