pnap_bmc_api 1.4.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.
Files changed (114) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +7 -1
  3. data/VERSION +1 -1
  4. data/docs/DeleteResult.md +1 -1
  5. data/docs/OsConfigurationCloudInit.md +1 -1
  6. data/docs/OsConfigurationNetrisController.md +1 -1
  7. data/docs/PrivateNetworkConfiguration.md +1 -1
  8. data/docs/QuotaEditLimitRequest.md +1 -1
  9. data/docs/QuotaEditLimitRequestDetails.md +1 -1
  10. data/docs/QuotasApi.md +6 -8
  11. data/docs/SSHKeysApi.md +12 -16
  12. data/docs/Server.md +14 -8
  13. data/docs/ServerCreate.md +7 -5
  14. data/docs/ServerNetworkUpdate.md +2 -2
  15. data/docs/ServerPrivateNetwork.md +3 -3
  16. data/docs/ServerProvision.md +38 -0
  17. data/docs/ServerPublicNetwork.md +2 -2
  18. data/docs/ServersApi.md +173 -111
  19. data/docs/StorageConfiguration.md +18 -0
  20. data/docs/StorageConfigurationRootPartition.md +20 -0
  21. data/lib/pnap_bmc_api/api/quotas_api.rb +11 -7
  22. data/lib/pnap_bmc_api/api/servers_api.rb +200 -75
  23. data/lib/pnap_bmc_api/api/ssh_keys_api.rb +21 -13
  24. data/lib/pnap_bmc_api/api_client.rb +24 -21
  25. data/lib/pnap_bmc_api/api_error.rb +2 -1
  26. data/lib/pnap_bmc_api/configuration.rb +28 -9
  27. data/lib/pnap_bmc_api/models/action_result.rb +16 -19
  28. data/lib/pnap_bmc_api/models/delete_result.rb +18 -19
  29. data/lib/pnap_bmc_api/models/delete_ssh_key_result.rb +18 -19
  30. data/lib/pnap_bmc_api/models/error.rb +16 -19
  31. data/lib/pnap_bmc_api/models/ip_blocks_configuration.rb +19 -20
  32. data/lib/pnap_bmc_api/models/network_configuration.rb +14 -19
  33. data/lib/pnap_bmc_api/models/os_configuration.rb +19 -20
  34. data/lib/pnap_bmc_api/models/os_configuration_cloud_init.rb +15 -20
  35. data/lib/pnap_bmc_api/models/os_configuration_map.rb +14 -19
  36. data/lib/pnap_bmc_api/models/os_configuration_map_esxi.rb +19 -20
  37. data/lib/pnap_bmc_api/models/os_configuration_map_proxmox.rb +19 -20
  38. data/lib/pnap_bmc_api/models/os_configuration_netris_controller.rb +16 -21
  39. data/lib/pnap_bmc_api/models/os_configuration_netris_softgate.rb +66 -20
  40. data/lib/pnap_bmc_api/models/os_configuration_windows.rb +19 -20
  41. data/lib/pnap_bmc_api/models/private_network_configuration.rb +15 -20
  42. data/lib/pnap_bmc_api/models/public_network_configuration.rb +14 -19
  43. data/lib/pnap_bmc_api/models/quota.rb +30 -19
  44. data/lib/pnap_bmc_api/models/quota_edit_limit_request.rb +40 -20
  45. data/lib/pnap_bmc_api/models/quota_edit_limit_request_details.rb +43 -22
  46. data/lib/pnap_bmc_api/models/relinquish_ip_block.rb +14 -19
  47. data/lib/pnap_bmc_api/models/reset_result.rb +16 -19
  48. data/lib/pnap_bmc_api/models/server.rb +94 -34
  49. data/lib/pnap_bmc_api/models/server_create.rb +43 -27
  50. data/lib/pnap_bmc_api/models/server_ip_block.rb +16 -19
  51. data/lib/pnap_bmc_api/models/server_network_update.rb +15 -20
  52. data/lib/pnap_bmc_api/models/server_patch.rb +27 -24
  53. data/lib/pnap_bmc_api/models/server_private_network.rb +27 -26
  54. data/lib/pnap_bmc_api/models/server_provision.rb +395 -0
  55. data/lib/pnap_bmc_api/models/server_public_network.rb +17 -20
  56. data/lib/pnap_bmc_api/models/server_reserve.rb +16 -19
  57. data/lib/pnap_bmc_api/models/server_reset.rb +14 -19
  58. data/lib/pnap_bmc_api/models/ssh_key.rb +28 -19
  59. data/lib/pnap_bmc_api/models/ssh_key_create.rb +52 -19
  60. data/lib/pnap_bmc_api/models/ssh_key_update.rb +29 -19
  61. data/lib/pnap_bmc_api/models/storage_configuration.rb +215 -0
  62. data/lib/pnap_bmc_api/models/{quota_edit_limit_request_details_all_of.rb → storage_configuration_root_partition.rb} +40 -36
  63. data/lib/pnap_bmc_api/models/tag_assignment.rb +20 -19
  64. data/lib/pnap_bmc_api/models/tag_assignment_request.rb +16 -19
  65. data/lib/pnap_bmc_api/version.rb +1 -1
  66. data/lib/pnap_bmc_api.rb +4 -2
  67. data/pnap_bmc_api.gemspec +2 -2
  68. data/spec/api/quotas_api_spec.rb +6 -6
  69. data/spec/api/servers_api_spec.rb +109 -36
  70. data/spec/api/ssh_keys_api_spec.rb +9 -9
  71. data/spec/models/action_result_spec.rb +6 -4
  72. data/spec/models/delete_result_spec.rb +7 -5
  73. data/spec/models/delete_ssh_key_result_spec.rb +7 -5
  74. data/spec/models/error_spec.rb +7 -5
  75. data/spec/models/ip_blocks_configuration_spec.rb +7 -5
  76. data/spec/models/network_configuration_spec.rb +19 -5
  77. data/spec/models/os_configuration_cloud_init_spec.rb +5 -3
  78. data/spec/models/os_configuration_map_esxi_spec.rb +8 -6
  79. data/spec/models/os_configuration_map_proxmox_spec.rb +8 -6
  80. data/spec/models/os_configuration_map_spec.rb +8 -6
  81. data/spec/models/os_configuration_netris_controller_spec.rb +7 -5
  82. data/spec/models/os_configuration_netris_softgate_spec.rb +8 -6
  83. data/spec/models/os_configuration_spec.rb +33 -7
  84. data/spec/models/os_configuration_windows_spec.rb +6 -4
  85. data/spec/models/private_network_configuration_spec.rb +8 -6
  86. data/spec/models/public_network_configuration_spec.rb +6 -4
  87. data/spec/models/quota_edit_limit_request_details_spec.rb +8 -6
  88. data/spec/models/quota_edit_limit_request_spec.rb +7 -5
  89. data/spec/models/quota_spec.rb +13 -15
  90. data/spec/models/relinquish_ip_block_spec.rb +6 -4
  91. data/spec/models/reset_result_spec.rb +8 -6
  92. data/spec/models/server_create_spec.rb +25 -17
  93. data/spec/models/server_ip_block_spec.rb +7 -5
  94. data/spec/models/server_network_update_spec.rb +5 -3
  95. data/spec/models/server_patch_spec.rb +7 -5
  96. data/spec/models/server_private_network_spec.rb +9 -7
  97. data/spec/models/server_provision_spec.rb +96 -0
  98. data/spec/models/server_public_network_spec.rb +8 -6
  99. data/spec/models/server_reserve_spec.rb +6 -4
  100. data/spec/models/server_reset_spec.rb +9 -7
  101. data/spec/models/server_spec.rb +47 -27
  102. data/spec/models/ssh_key_create_spec.rb +8 -6
  103. data/spec/models/ssh_key_spec.rb +12 -10
  104. data/spec/models/ssh_key_update_spec.rb +7 -5
  105. data/spec/models/storage_configuration_root_partition_spec.rb +42 -0
  106. data/spec/models/storage_configuration_spec.rb +36 -0
  107. data/spec/models/tag_assignment_request_spec.rb +7 -5
  108. data/spec/models/tag_assignment_spec.rb +10 -8
  109. data/spec/spec_helper.rb +1 -1
  110. metadata +41 -37
  111. data/docs/QuotaEditLimitRequestDetailsAllOf.md +0 -18
  112. data/spec/api_client_spec.rb +0 -226
  113. data/spec/configuration_spec.rb +0 -42
  114. 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: 6.1.0
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 !management_access_allowed_ips.nil? && management_access_allowed_ips.length < 1
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
- self.class.openapi_types.each_pair do |key, type|
151
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
152
- self.send("#{key}=", nil)
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[self.class.attribute_map[key]].is_a?(Array)
157
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
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[self.class.attribute_map[key]].nil?
160
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
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: 6.1.0
9
+ OpenAPI Generator version: 7.2.0
10
10
 
11
11
  =end
12
12
 
@@ -14,12 +14,12 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module BmcApi
17
- # Netris Controller configuration properties.
17
+ # Netris Controller configuration properties. Knowledge base article to help you can be found <a href='https://phoenixnap.com/kb/netris-bare-metal-cloud#deploy-netris-controller' target='_blank'>here</a>.
18
18
  class OsConfigurationNetrisController
19
19
  # (Read-only) Host OS on which the Netris Controller is installed.
20
20
  attr_accessor :host_os
21
21
 
22
- # (Read-only) The URL for the Netris Controller web console. Will only be returned in response to provisioning a server.
22
+ # (Read-only) The URL for the Netris Controller web console. It will only be returned in response to provisioning a server.
23
23
  attr_accessor :netris_web_console_url
24
24
 
25
25
  # (Read-only) Auto-generated password set for user 'netris' in the web console.<br> The password is not stored and therefore will only be returned in response to provisioning a server. Copy and save it for future reference.
@@ -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
- self.class.openapi_types.each_pair do |key, type|
134
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
135
- self.send("#{key}=", nil)
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[self.class.attribute_map[key]].is_a?(Array)
140
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
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[self.class.attribute_map[key]].nil?
143
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
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
 
@@ -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: 6.1.0
9
+ OpenAPI Generator version: 7.2.0
10
10
 
11
11
  =end
12
12
 
@@ -14,7 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module BmcApi
17
- # Netris Softgate configuration properties.
17
+ # Netris Softgate configuration properties. Follow <a href='https://phoenixnap.com/kb/netris-bare-metal-cloud#deploy-netris-softgate' target='_blank'>instructions</a> for retrieving the required details.
18
18
  class OsConfigurationNetrisSoftgate
19
19
  # (Read-only) Host OS on which the Netris Softgate is installed.
20
20
  attr_accessor :host_os
@@ -94,16 +94,69 @@ module BmcApi
94
94
  # Show invalid properties with the reasons. Usually used together with valid?
95
95
  # @return Array for valid properties with the reasons
96
96
  def list_invalid_properties
97
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
97
98
  invalid_properties = Array.new
99
+ if !@controller_address.nil? && @controller_address.to_s.length > 253
100
+ invalid_properties.push('invalid value for "controller_address", the character length must be smaller than or equal to 253.')
101
+ end
102
+
103
+ pattern = Regexp.new(/^(?!-)[\w\-]{1,63}(?<!-)(\.(?!-)[\w\-]{1,63}(?<!-))*$/)
104
+ if !@controller_address.nil? && @controller_address !~ pattern
105
+ invalid_properties.push("invalid value for \"controller_address\", must conform to the pattern #{pattern}.")
106
+ end
107
+
108
+ pattern = Regexp.new(/^\S+$/)
109
+ if !@controller_auth_key.nil? && @controller_auth_key !~ pattern
110
+ invalid_properties.push("invalid value for \"controller_auth_key\", must conform to the pattern #{pattern}.")
111
+ end
112
+
98
113
  invalid_properties
99
114
  end
100
115
 
101
116
  # Check to see if the all the properties in the model are valid
102
117
  # @return true if the model is valid
103
118
  def valid?
119
+ warn '[DEPRECATED] the `valid?` method is obsolete'
120
+ return false if !@controller_address.nil? && @controller_address.to_s.length > 253
121
+ return false if !@controller_address.nil? && @controller_address !~ Regexp.new(/^(?!-)[\w\-]{1,63}(?<!-)(\.(?!-)[\w\-]{1,63}(?<!-))*$/)
122
+ return false if !@controller_auth_key.nil? && @controller_auth_key !~ Regexp.new(/^\S+$/)
104
123
  true
105
124
  end
106
125
 
126
+ # Custom attribute writer method with validation
127
+ # @param [Object] controller_address Value to be assigned
128
+ def controller_address=(controller_address)
129
+ if controller_address.nil?
130
+ fail ArgumentError, 'controller_address cannot be nil'
131
+ end
132
+
133
+ if controller_address.to_s.length > 253
134
+ fail ArgumentError, 'invalid value for "controller_address", the character length must be smaller than or equal to 253.'
135
+ end
136
+
137
+ pattern = Regexp.new(/^(?!-)[\w\-]{1,63}(?<!-)(\.(?!-)[\w\-]{1,63}(?<!-))*$/)
138
+ if controller_address !~ pattern
139
+ fail ArgumentError, "invalid value for \"controller_address\", must conform to the pattern #{pattern}."
140
+ end
141
+
142
+ @controller_address = controller_address
143
+ end
144
+
145
+ # Custom attribute writer method with validation
146
+ # @param [Object] controller_auth_key Value to be assigned
147
+ def controller_auth_key=(controller_auth_key)
148
+ if controller_auth_key.nil?
149
+ fail ArgumentError, 'controller_auth_key cannot be nil'
150
+ end
151
+
152
+ pattern = Regexp.new(/^\S+$/)
153
+ if controller_auth_key !~ pattern
154
+ fail ArgumentError, "invalid value for \"controller_auth_key\", must conform to the pattern #{pattern}."
155
+ end
156
+
157
+ @controller_auth_key = controller_auth_key
158
+ end
159
+
107
160
  # Checks equality by comparing each attribute.
108
161
  # @param [Object] Object to be compared
109
162
  def ==(o)
@@ -131,37 +184,30 @@ module BmcApi
131
184
  # @param [Hash] attributes Model attributes in the form of hash
132
185
  # @return [Object] Returns the model itself
133
186
  def self.build_from_hash(attributes)
134
- new.build_from_hash(attributes)
135
- end
136
-
137
- # Builds the object from hash
138
- # @param [Hash] attributes Model attributes in the form of hash
139
- # @return [Object] Returns the model itself
140
- def build_from_hash(attributes)
141
187
  return nil unless attributes.is_a?(Hash)
142
188
  attributes = attributes.transform_keys(&:to_sym)
143
- self.class.openapi_types.each_pair do |key, type|
144
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
145
- self.send("#{key}=", nil)
189
+ transformed_hash = {}
190
+ openapi_types.each_pair do |key, type|
191
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
192
+ transformed_hash["#{key}"] = nil
146
193
  elsif type =~ /\AArray<(.*)>/i
147
194
  # check to ensure the input is an array given that the attribute
148
195
  # is documented as an array but the input is not
149
- if attributes[self.class.attribute_map[key]].is_a?(Array)
150
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
196
+ if attributes[attribute_map[key]].is_a?(Array)
197
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
151
198
  end
152
- elsif !attributes[self.class.attribute_map[key]].nil?
153
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
199
+ elsif !attributes[attribute_map[key]].nil?
200
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
154
201
  end
155
202
  end
156
-
157
- self
203
+ new(transformed_hash)
158
204
  end
159
205
 
160
206
  # Deserializes the data based on type
161
207
  # @param string type Data type
162
208
  # @param string value Value to be deserialized
163
209
  # @return [Object] Deserialized data
164
- def _deserialize(type, value)
210
+ def self._deserialize(type, value)
165
211
  case type.to_sym
166
212
  when :Time
167
213
  Time.parse(value)
@@ -196,7 +242,7 @@ module BmcApi
196
242
  else # model
197
243
  # models (e.g. Pet) or oneOf
198
244
  klass = BmcApi.const_get(type)
199
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
245
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
200
246
  end
201
247
  end
202
248
 
@@ -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: 6.1.0
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
  if !@rdp_allowed_ips.nil? && @rdp_allowed_ips.length < 1
74
75
  invalid_properties.push('invalid value for "rdp_allowed_ips", number of items must be greater than or equal to 1.')
@@ -80,6 +81,7 @@ module BmcApi
80
81
  # Check to see if the all the properties in the model are valid
81
82
  # @return true if the model is valid
82
83
  def valid?
84
+ warn '[DEPRECATED] the `valid?` method is obsolete'
83
85
  return false if !@rdp_allowed_ips.nil? && @rdp_allowed_ips.length < 1
84
86
  true
85
87
  end
@@ -87,7 +89,11 @@ module BmcApi
87
89
  # Custom attribute writer method with validation
88
90
  # @param [Object] rdp_allowed_ips Value to be assigned
89
91
  def rdp_allowed_ips=(rdp_allowed_ips)
90
- if !rdp_allowed_ips.nil? && rdp_allowed_ips.length < 1
92
+ if rdp_allowed_ips.nil?
93
+ fail ArgumentError, 'rdp_allowed_ips cannot be nil'
94
+ end
95
+
96
+ if rdp_allowed_ips.length < 1
91
97
  fail ArgumentError, 'invalid value for "rdp_allowed_ips", number of items must be greater than or equal to 1.'
92
98
  end
93
99
 
@@ -118,37 +124,30 @@ module BmcApi
118
124
  # @param [Hash] attributes Model attributes in the form of hash
119
125
  # @return [Object] Returns the model itself
120
126
  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
127
  return nil unless attributes.is_a?(Hash)
129
128
  attributes = attributes.transform_keys(&:to_sym)
130
- self.class.openapi_types.each_pair do |key, type|
131
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
132
- self.send("#{key}=", nil)
129
+ transformed_hash = {}
130
+ openapi_types.each_pair do |key, type|
131
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
132
+ transformed_hash["#{key}"] = nil
133
133
  elsif type =~ /\AArray<(.*)>/i
134
134
  # check to ensure the input is an array given that the attribute
135
135
  # is documented as an array but the input is not
136
- if attributes[self.class.attribute_map[key]].is_a?(Array)
137
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
136
+ if attributes[attribute_map[key]].is_a?(Array)
137
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
138
138
  end
139
- elsif !attributes[self.class.attribute_map[key]].nil?
140
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
139
+ elsif !attributes[attribute_map[key]].nil?
140
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
141
141
  end
142
142
  end
143
-
144
- self
143
+ new(transformed_hash)
145
144
  end
146
145
 
147
146
  # Deserializes the data based on type
148
147
  # @param string type Data type
149
148
  # @param string value Value to be deserialized
150
149
  # @return [Object] Deserialized data
151
- def _deserialize(type, value)
150
+ def self._deserialize(type, value)
152
151
  case type.to_sym
153
152
  when :Time
154
153
  Time.parse(value)
@@ -183,7 +182,7 @@ module BmcApi
183
182
  else # model
184
183
  # models (e.g. Pet) or oneOf
185
184
  klass = BmcApi.const_get(type)
186
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
185
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
187
186
  end
188
187
  end
189
188
 
@@ -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: 6.1.0
9
+ OpenAPI Generator version: 7.2.0
10
10
 
11
11
  =end
12
12
 
@@ -19,7 +19,7 @@ module BmcApi
19
19
  # Deprecated in favour of a common gateway address across all networks available under NetworkConfiguration.<br> The address of the gateway assigned / to assign to the server.<br> When used as part of request body, IP address has to be part of private network assigned to this server.<br> Gateway address also has to be assigned on an already deployed resource unless the `force` query parameter is true.
20
20
  attr_accessor :gateway_address
21
21
 
22
- # (Write-only) Determines the approach for configuring private network(s) for the server being provisioned. Currently this field should be set to `USE_OR_CREATE_DEFAULT` or `USER_DEFINED`.
22
+ # (Write-only) Determines the approach for configuring private network(s) for the server being provisioned. Currently this field should be set to `USE_OR_CREATE_DEFAULT`, `USER_DEFINED` or `NONE`.
23
23
  attr_accessor :configuration_type
24
24
 
25
25
  # The list of private networks this server is member of. When this field is part of request body, it'll be used to specify the private networks to assign to this server upon provisioning. Used alongside the `USER_DEFINED` configurationType.
@@ -89,6 +89,7 @@ module BmcApi
89
89
  # Show invalid properties with the reasons. Usually used together with valid?
90
90
  # @return Array for valid properties with the reasons
91
91
  def list_invalid_properties
92
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
92
93
  invalid_properties = Array.new
93
94
  invalid_properties
94
95
  end
@@ -96,6 +97,7 @@ module BmcApi
96
97
  # Check to see if the all the properties in the model are valid
97
98
  # @return true if the model is valid
98
99
  def valid?
100
+ warn '[DEPRECATED] the `valid?` method is obsolete'
99
101
  true
100
102
  end
101
103
 
@@ -125,37 +127,30 @@ module BmcApi
125
127
  # @param [Hash] attributes Model attributes in the form of hash
126
128
  # @return [Object] Returns the model itself
127
129
  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
130
  return nil unless attributes.is_a?(Hash)
136
131
  attributes = attributes.transform_keys(&:to_sym)
137
- self.class.openapi_types.each_pair do |key, type|
138
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
139
- self.send("#{key}=", nil)
132
+ transformed_hash = {}
133
+ openapi_types.each_pair do |key, type|
134
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
135
+ transformed_hash["#{key}"] = nil
140
136
  elsif type =~ /\AArray<(.*)>/i
141
137
  # check to ensure the input is an array given that the attribute
142
138
  # is documented as an array but the input is not
143
- if attributes[self.class.attribute_map[key]].is_a?(Array)
144
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
139
+ if attributes[attribute_map[key]].is_a?(Array)
140
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
145
141
  end
146
- elsif !attributes[self.class.attribute_map[key]].nil?
147
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
142
+ elsif !attributes[attribute_map[key]].nil?
143
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
148
144
  end
149
145
  end
150
-
151
- self
146
+ new(transformed_hash)
152
147
  end
153
148
 
154
149
  # Deserializes the data based on type
155
150
  # @param string type Data type
156
151
  # @param string value Value to be deserialized
157
152
  # @return [Object] Deserialized data
158
- def _deserialize(type, value)
153
+ def self._deserialize(type, value)
159
154
  case type.to_sym
160
155
  when :Time
161
156
  Time.parse(value)
@@ -190,7 +185,7 @@ module BmcApi
190
185
  else # model
191
186
  # models (e.g. Pet) or oneOf
192
187
  klass = BmcApi.const_get(type)
193
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
188
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
194
189
  end
195
190
  end
196
191
 
@@ -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: 6.1.0
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
- self.class.openapi_types.each_pair do |key, type|
116
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
117
- self.send("#{key}=", nil)
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[self.class.attribute_map[key]].is_a?(Array)
122
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
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[self.class.attribute_map[key]].nil?
125
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
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