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.
Files changed (110) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +5 -1
  3. data/VERSION +1 -1
  4. data/docs/DeleteResult.md +1 -1
  5. data/docs/OsConfigurationCloudInit.md +1 -1
  6. data/docs/QuotasApi.md +6 -8
  7. data/docs/SSHKeysApi.md +12 -16
  8. data/docs/Server.md +11 -7
  9. data/docs/ServerCreate.md +3 -3
  10. data/docs/ServerNetworkUpdate.md +2 -2
  11. data/docs/ServerPrivateNetwork.md +3 -3
  12. data/docs/ServerProvision.md +38 -0
  13. data/docs/ServerPublicNetwork.md +2 -2
  14. data/docs/ServersApi.md +173 -111
  15. data/docs/StorageConfigurationRootPartition.md +2 -2
  16. data/lib/pnap_bmc_api/api/quotas_api.rb +11 -7
  17. data/lib/pnap_bmc_api/api/servers_api.rb +200 -75
  18. data/lib/pnap_bmc_api/api/ssh_keys_api.rb +21 -13
  19. data/lib/pnap_bmc_api/api_client.rb +24 -21
  20. data/lib/pnap_bmc_api/api_error.rb +2 -1
  21. data/lib/pnap_bmc_api/configuration.rb +28 -9
  22. data/lib/pnap_bmc_api/models/action_result.rb +16 -19
  23. data/lib/pnap_bmc_api/models/delete_result.rb +18 -19
  24. data/lib/pnap_bmc_api/models/delete_ssh_key_result.rb +18 -19
  25. data/lib/pnap_bmc_api/models/error.rb +16 -19
  26. data/lib/pnap_bmc_api/models/ip_blocks_configuration.rb +19 -20
  27. data/lib/pnap_bmc_api/models/network_configuration.rb +14 -19
  28. data/lib/pnap_bmc_api/models/os_configuration.rb +19 -20
  29. data/lib/pnap_bmc_api/models/os_configuration_cloud_init.rb +15 -20
  30. data/lib/pnap_bmc_api/models/os_configuration_map.rb +14 -19
  31. data/lib/pnap_bmc_api/models/os_configuration_map_esxi.rb +19 -20
  32. data/lib/pnap_bmc_api/models/os_configuration_map_proxmox.rb +19 -20
  33. data/lib/pnap_bmc_api/models/os_configuration_netris_controller.rb +14 -19
  34. data/lib/pnap_bmc_api/models/os_configuration_netris_softgate.rb +25 -22
  35. data/lib/pnap_bmc_api/models/os_configuration_windows.rb +19 -20
  36. data/lib/pnap_bmc_api/models/private_network_configuration.rb +14 -19
  37. data/lib/pnap_bmc_api/models/public_network_configuration.rb +14 -19
  38. data/lib/pnap_bmc_api/models/quota.rb +30 -19
  39. data/lib/pnap_bmc_api/models/quota_edit_limit_request.rb +39 -19
  40. data/lib/pnap_bmc_api/models/quota_edit_limit_request_details.rb +42 -21
  41. data/lib/pnap_bmc_api/models/relinquish_ip_block.rb +14 -19
  42. data/lib/pnap_bmc_api/models/reset_result.rb +16 -19
  43. data/lib/pnap_bmc_api/models/server.rb +79 -33
  44. data/lib/pnap_bmc_api/models/server_create.rb +29 -22
  45. data/lib/pnap_bmc_api/models/server_ip_block.rb +16 -19
  46. data/lib/pnap_bmc_api/models/server_network_update.rb +15 -20
  47. data/lib/pnap_bmc_api/models/server_patch.rb +27 -24
  48. data/lib/pnap_bmc_api/models/server_private_network.rb +23 -22
  49. data/lib/pnap_bmc_api/models/server_provision.rb +395 -0
  50. data/lib/pnap_bmc_api/models/server_public_network.rb +17 -20
  51. data/lib/pnap_bmc_api/models/server_reserve.rb +16 -19
  52. data/lib/pnap_bmc_api/models/server_reset.rb +14 -19
  53. data/lib/pnap_bmc_api/models/ssh_key.rb +28 -19
  54. data/lib/pnap_bmc_api/models/ssh_key_create.rb +52 -19
  55. data/lib/pnap_bmc_api/models/ssh_key_update.rb +29 -19
  56. data/lib/pnap_bmc_api/models/storage_configuration.rb +14 -19
  57. data/lib/pnap_bmc_api/models/storage_configuration_root_partition.rb +14 -19
  58. data/lib/pnap_bmc_api/models/tag_assignment.rb +20 -19
  59. data/lib/pnap_bmc_api/models/tag_assignment_request.rb +16 -19
  60. data/lib/pnap_bmc_api/version.rb +1 -1
  61. data/lib/pnap_bmc_api.rb +2 -2
  62. data/pnap_bmc_api.gemspec +2 -2
  63. data/spec/api/quotas_api_spec.rb +6 -6
  64. data/spec/api/servers_api_spec.rb +109 -36
  65. data/spec/api/ssh_keys_api_spec.rb +9 -9
  66. data/spec/models/action_result_spec.rb +6 -4
  67. data/spec/models/delete_result_spec.rb +7 -5
  68. data/spec/models/delete_ssh_key_result_spec.rb +7 -5
  69. data/spec/models/error_spec.rb +7 -5
  70. data/spec/models/ip_blocks_configuration_spec.rb +7 -5
  71. data/spec/models/network_configuration_spec.rb +19 -5
  72. data/spec/models/os_configuration_cloud_init_spec.rb +5 -3
  73. data/spec/models/os_configuration_map_esxi_spec.rb +8 -6
  74. data/spec/models/os_configuration_map_proxmox_spec.rb +8 -6
  75. data/spec/models/os_configuration_map_spec.rb +8 -6
  76. data/spec/models/os_configuration_netris_controller_spec.rb +7 -5
  77. data/spec/models/os_configuration_netris_softgate_spec.rb +8 -6
  78. data/spec/models/os_configuration_spec.rb +33 -7
  79. data/spec/models/os_configuration_windows_spec.rb +6 -4
  80. data/spec/models/private_network_configuration_spec.rb +8 -6
  81. data/spec/models/public_network_configuration_spec.rb +6 -4
  82. data/spec/models/quota_edit_limit_request_details_spec.rb +8 -6
  83. data/spec/models/quota_edit_limit_request_spec.rb +7 -5
  84. data/spec/models/quota_spec.rb +13 -15
  85. data/spec/models/relinquish_ip_block_spec.rb +6 -4
  86. data/spec/models/reset_result_spec.rb +8 -6
  87. data/spec/models/server_create_spec.rb +25 -17
  88. data/spec/models/server_ip_block_spec.rb +7 -5
  89. data/spec/models/server_network_update_spec.rb +5 -3
  90. data/spec/models/server_patch_spec.rb +7 -5
  91. data/spec/models/server_private_network_spec.rb +9 -7
  92. data/spec/models/server_provision_spec.rb +96 -0
  93. data/spec/models/server_public_network_spec.rb +8 -6
  94. data/spec/models/server_reserve_spec.rb +6 -4
  95. data/spec/models/server_reset_spec.rb +9 -7
  96. data/spec/models/server_spec.rb +47 -27
  97. data/spec/models/ssh_key_create_spec.rb +8 -6
  98. data/spec/models/ssh_key_spec.rb +12 -10
  99. data/spec/models/ssh_key_update_spec.rb +7 -5
  100. data/spec/models/storage_configuration_root_partition_spec.rb +6 -4
  101. data/spec/models/storage_configuration_spec.rb +5 -3
  102. data/spec/models/tag_assignment_request_spec.rb +7 -5
  103. data/spec/models/tag_assignment_spec.rb +10 -8
  104. data/spec/spec_helper.rb +1 -1
  105. metadata +38 -42
  106. data/docs/QuotaEditLimitRequestDetailsAllOf.md +0 -18
  107. data/lib/pnap_bmc_api/models/quota_edit_limit_request_details_all_of.rb +0 -226
  108. data/spec/api_client_spec.rb +0 -226
  109. data/spec/configuration_spec.rb +0 -42
  110. 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
 
@@ -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
 
@@ -94,6 +94,7 @@ 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
98
99
  if !@controller_address.nil? && @controller_address.to_s.length > 253
99
100
  invalid_properties.push('invalid value for "controller_address", the character length must be smaller than or equal to 253.')
@@ -115,6 +116,7 @@ module BmcApi
115
116
  # Check to see if the all the properties in the model are valid
116
117
  # @return true if the model is valid
117
118
  def valid?
119
+ warn '[DEPRECATED] the `valid?` method is obsolete'
118
120
  return false if !@controller_address.nil? && @controller_address.to_s.length > 253
119
121
  return false if !@controller_address.nil? && @controller_address !~ Regexp.new(/^(?!-)[\w\-]{1,63}(?<!-)(\.(?!-)[\w\-]{1,63}(?<!-))*$/)
120
122
  return false if !@controller_auth_key.nil? && @controller_auth_key !~ Regexp.new(/^\S+$/)
@@ -124,12 +126,16 @@ module BmcApi
124
126
  # Custom attribute writer method with validation
125
127
  # @param [Object] controller_address Value to be assigned
126
128
  def controller_address=(controller_address)
127
- if !controller_address.nil? && controller_address.to_s.length > 253
129
+ if controller_address.nil?
130
+ fail ArgumentError, 'controller_address cannot be nil'
131
+ end
132
+
133
+ if controller_address.to_s.length > 253
128
134
  fail ArgumentError, 'invalid value for "controller_address", the character length must be smaller than or equal to 253.'
129
135
  end
130
136
 
131
137
  pattern = Regexp.new(/^(?!-)[\w\-]{1,63}(?<!-)(\.(?!-)[\w\-]{1,63}(?<!-))*$/)
132
- if !controller_address.nil? && controller_address !~ pattern
138
+ if controller_address !~ pattern
133
139
  fail ArgumentError, "invalid value for \"controller_address\", must conform to the pattern #{pattern}."
134
140
  end
135
141
 
@@ -139,8 +145,12 @@ module BmcApi
139
145
  # Custom attribute writer method with validation
140
146
  # @param [Object] controller_auth_key Value to be assigned
141
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
+
142
152
  pattern = Regexp.new(/^\S+$/)
143
- if !controller_auth_key.nil? && controller_auth_key !~ pattern
153
+ if controller_auth_key !~ pattern
144
154
  fail ArgumentError, "invalid value for \"controller_auth_key\", must conform to the pattern #{pattern}."
145
155
  end
146
156
 
@@ -174,37 +184,30 @@ module BmcApi
174
184
  # @param [Hash] attributes Model attributes in the form of hash
175
185
  # @return [Object] Returns the model itself
176
186
  def self.build_from_hash(attributes)
177
- new.build_from_hash(attributes)
178
- end
179
-
180
- # Builds the object from hash
181
- # @param [Hash] attributes Model attributes in the form of hash
182
- # @return [Object] Returns the model itself
183
- def build_from_hash(attributes)
184
187
  return nil unless attributes.is_a?(Hash)
185
188
  attributes = attributes.transform_keys(&:to_sym)
186
- self.class.openapi_types.each_pair do |key, type|
187
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
188
- 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
189
193
  elsif type =~ /\AArray<(.*)>/i
190
194
  # check to ensure the input is an array given that the attribute
191
195
  # is documented as an array but the input is not
192
- if attributes[self.class.attribute_map[key]].is_a?(Array)
193
- 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) }
194
198
  end
195
- elsif !attributes[self.class.attribute_map[key]].nil?
196
- 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]])
197
201
  end
198
202
  end
199
-
200
- self
203
+ new(transformed_hash)
201
204
  end
202
205
 
203
206
  # Deserializes the data based on type
204
207
  # @param string type Data type
205
208
  # @param string value Value to be deserialized
206
209
  # @return [Object] Deserialized data
207
- def _deserialize(type, value)
210
+ def self._deserialize(type, value)
208
211
  case type.to_sym
209
212
  when :Time
210
213
  Time.parse(value)
@@ -239,7 +242,7 @@ module BmcApi
239
242
  else # model
240
243
  # models (e.g. Pet) or oneOf
241
244
  klass = BmcApi.const_get(type)
242
- 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)
243
246
  end
244
247
  end
245
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
 
@@ -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