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
 
@@ -16,7 +16,7 @@ require 'time'
16
16
  module BmcApi
17
17
  # Update network details of bare metal server.
18
18
  class ServerNetworkUpdate
19
- # List of IPs to be associated to the server.<br> Setting the `force` query parameter to `true` allows you to:<ul> <li> Assign no specific IP addresses by designating an empty array of IPs. <li> Assign one or more IP addresses which are already configured on other resource(s) in network.</ul>
19
+ # List of IPs to be associated to the server.<br> Valid IP formats are single IPv4 addresses or IPv4 ranges. IPs must be within the network's range.<br> Setting the `force` query parameter to `true` allows you to:<ul> <li> Assign no specific IP addresses by designating an empty array of IPs. <li> Assign one or more IP addresses which are already configured on other resource(s) in network. <li> Assign IP addresses which are considered as reserved in network.</ul>
20
20
  attr_accessor :ips
21
21
 
22
22
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -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
 
@@ -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
- # Server patch.
17
+ # Patch bare metal server.
18
18
  class ServerPatch
19
19
  # Description of server.
20
20
  attr_accessor :description
@@ -76,6 +76,7 @@ module BmcApi
76
76
  # Show invalid properties with the reasons. Usually used together with valid?
77
77
  # @return Array for valid properties with the reasons
78
78
  def list_invalid_properties
79
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
79
80
  invalid_properties = Array.new
80
81
  if !@description.nil? && @description.to_s.length > 250
81
82
  invalid_properties.push('invalid value for "description", the character length must be smaller than or equal to 250.')
@@ -100,6 +101,7 @@ module BmcApi
100
101
  # Check to see if the all the properties in the model are valid
101
102
  # @return true if the model is valid
102
103
  def valid?
104
+ warn '[DEPRECATED] the `valid?` method is obsolete'
103
105
  return false if !@description.nil? && @description.to_s.length > 250
104
106
  return false if !@hostname.nil? && @hostname.to_s.length > 100
105
107
  return false if !@hostname.nil? && @hostname.to_s.length < 1
@@ -110,7 +112,11 @@ module BmcApi
110
112
  # Custom attribute writer method with validation
111
113
  # @param [Object] description Value to be assigned
112
114
  def description=(description)
113
- if !description.nil? && description.to_s.length > 250
115
+ if description.nil?
116
+ fail ArgumentError, 'description cannot be nil'
117
+ end
118
+
119
+ if description.to_s.length > 250
114
120
  fail ArgumentError, 'invalid value for "description", the character length must be smaller than or equal to 250.'
115
121
  end
116
122
 
@@ -120,16 +126,20 @@ module BmcApi
120
126
  # Custom attribute writer method with validation
121
127
  # @param [Object] hostname Value to be assigned
122
128
  def hostname=(hostname)
123
- if !hostname.nil? && hostname.to_s.length > 100
129
+ if hostname.nil?
130
+ fail ArgumentError, 'hostname cannot be nil'
131
+ end
132
+
133
+ if hostname.to_s.length > 100
124
134
  fail ArgumentError, 'invalid value for "hostname", the character length must be smaller than or equal to 100.'
125
135
  end
126
136
 
127
- if !hostname.nil? && hostname.to_s.length < 1
137
+ if hostname.to_s.length < 1
128
138
  fail ArgumentError, 'invalid value for "hostname", the character length must be great than or equal to 1.'
129
139
  end
130
140
 
131
141
  pattern = Regexp.new(/[a-zA-Z0-9().-]+/)
132
- if !hostname.nil? && hostname !~ pattern
142
+ if hostname !~ pattern
133
143
  fail ArgumentError, "invalid value for \"hostname\", must conform to the pattern #{pattern}."
134
144
  end
135
145
 
@@ -161,37 +171,30 @@ module BmcApi
161
171
  # @param [Hash] attributes Model attributes in the form of hash
162
172
  # @return [Object] Returns the model itself
163
173
  def self.build_from_hash(attributes)
164
- new.build_from_hash(attributes)
165
- end
166
-
167
- # Builds the object from hash
168
- # @param [Hash] attributes Model attributes in the form of hash
169
- # @return [Object] Returns the model itself
170
- def build_from_hash(attributes)
171
174
  return nil unless attributes.is_a?(Hash)
172
175
  attributes = attributes.transform_keys(&:to_sym)
173
- self.class.openapi_types.each_pair do |key, type|
174
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
175
- self.send("#{key}=", nil)
176
+ transformed_hash = {}
177
+ openapi_types.each_pair do |key, type|
178
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
179
+ transformed_hash["#{key}"] = nil
176
180
  elsif type =~ /\AArray<(.*)>/i
177
181
  # check to ensure the input is an array given that the attribute
178
182
  # is documented as an array but the input is not
179
- if attributes[self.class.attribute_map[key]].is_a?(Array)
180
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
183
+ if attributes[attribute_map[key]].is_a?(Array)
184
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
181
185
  end
182
- elsif !attributes[self.class.attribute_map[key]].nil?
183
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
186
+ elsif !attributes[attribute_map[key]].nil?
187
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
184
188
  end
185
189
  end
186
-
187
- self
190
+ new(transformed_hash)
188
191
  end
189
192
 
190
193
  # Deserializes the data based on type
191
194
  # @param string type Data type
192
195
  # @param string value Value to be deserialized
193
196
  # @return [Object] Deserialized data
194
- def _deserialize(type, value)
197
+ def self._deserialize(type, value)
195
198
  case type.to_sym
196
199
  when :Time
197
200
  Time.parse(value)
@@ -226,7 +229,7 @@ module BmcApi
226
229
  else # model
227
230
  # models (e.g. Pet) or oneOf
228
231
  klass = BmcApi.const_get(type)
229
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
232
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
230
233
  end
231
234
  end
232
235
 
@@ -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,10 +19,10 @@ module BmcApi
19
19
  # The network identifier.
20
20
  attr_accessor :id
21
21
 
22
- # IPs to configure/configured on the server.<br> Should be null or empty list if DHCP is true. IPs must be within the network's range.<br> If field is undefined and DHCP is false, next available IP in network will be automatically allocated.<br> If the network contains a membership of type 'storage', the first twelve IPs are already reserved by BMC and not usable.<br> Setting the `force` query parameter to `true` allows you to:<ul> <li> Assign no specific IP addresses by designating an empty array of IPs. Note that at least one IP is required for the gateway address to be selected from this network. <li> Assign one or more IP addresses which are already configured on other resource(s) in network.</ul>
22
+ # IPs to configure/configured on the server.<br> Valid IP formats are single IPv4 addresses or IPv4 ranges. IPs must be within the network's range. Should be null or empty list if DHCP is true. <br> If field is undefined and DHCP is false, next available IP in network will be automatically allocated.<br> If the network contains a membership of type 'storage', the first twelve IPs are already reserved by BMC and not usable.<br> Setting the `force` query parameter to `true` allows you to:<ul> <li> Assign no specific IP addresses by designating an empty array of IPs. Note that at least one IP is required for the gateway address to be selected from this network. <li> Assign one or more IP addresses which are already configured on other resource(s) in network. <li> Assign IP addresses which are considered as reserved in network.</ul>
23
23
  attr_accessor :ips
24
24
 
25
- # Determines whether DHCP is enabled for this server. Should be false if any IPs are provided. Not supported for Proxmox OS and ESXi OS.
25
+ # Determines whether DHCP is enabled for this server. Should be false if any IPs are provided. Not supported for Proxmox OS.
26
26
  attr_accessor :dhcp
27
27
 
28
28
  # (Read-only) The status of the network.
@@ -76,6 +76,8 @@ module BmcApi
76
76
 
77
77
  if attributes.key?(:'id')
78
78
  self.id = attributes[:'id']
79
+ else
80
+ self.id = nil
79
81
  end
80
82
 
81
83
  if attributes.key?(:'ips')
@@ -98,13 +100,14 @@ module BmcApi
98
100
  # Show invalid properties with the reasons. Usually used together with valid?
99
101
  # @return Array for valid properties with the reasons
100
102
  def list_invalid_properties
103
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
101
104
  invalid_properties = Array.new
102
105
  if @id.nil?
103
106
  invalid_properties.push('invalid value for "id", id cannot be nil.')
104
107
  end
105
108
 
106
- if !@ips.nil? && @ips.length > 10
107
- invalid_properties.push('invalid value for "ips", number of items must be less than or equal to 10.')
109
+ if !@ips.nil? && @ips.length > 256
110
+ invalid_properties.push('invalid value for "ips", number of items must be less than or equal to 256.')
108
111
  end
109
112
 
110
113
  invalid_properties
@@ -113,16 +116,21 @@ module BmcApi
113
116
  # Check to see if the all the properties in the model are valid
114
117
  # @return true if the model is valid
115
118
  def valid?
119
+ warn '[DEPRECATED] the `valid?` method is obsolete'
116
120
  return false if @id.nil?
117
- return false if !@ips.nil? && @ips.length > 10
121
+ return false if !@ips.nil? && @ips.length > 256
118
122
  true
119
123
  end
120
124
 
121
125
  # Custom attribute writer method with validation
122
126
  # @param [Object] ips Value to be assigned
123
127
  def ips=(ips)
124
- if !ips.nil? && ips.length > 10
125
- fail ArgumentError, 'invalid value for "ips", number of items must be less than or equal to 10.'
128
+ if ips.nil?
129
+ fail ArgumentError, 'ips cannot be nil'
130
+ end
131
+
132
+ if ips.length > 256
133
+ fail ArgumentError, 'invalid value for "ips", number of items must be less than or equal to 256.'
126
134
  end
127
135
 
128
136
  @ips = ips
@@ -155,37 +163,30 @@ module BmcApi
155
163
  # @param [Hash] attributes Model attributes in the form of hash
156
164
  # @return [Object] Returns the model itself
157
165
  def self.build_from_hash(attributes)
158
- new.build_from_hash(attributes)
159
- end
160
-
161
- # Builds the object from hash
162
- # @param [Hash] attributes Model attributes in the form of hash
163
- # @return [Object] Returns the model itself
164
- def build_from_hash(attributes)
165
166
  return nil unless attributes.is_a?(Hash)
166
167
  attributes = attributes.transform_keys(&:to_sym)
167
- self.class.openapi_types.each_pair do |key, type|
168
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
169
- self.send("#{key}=", nil)
168
+ transformed_hash = {}
169
+ openapi_types.each_pair do |key, type|
170
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
171
+ transformed_hash["#{key}"] = nil
170
172
  elsif type =~ /\AArray<(.*)>/i
171
173
  # check to ensure the input is an array given that the attribute
172
174
  # is documented as an array but the input is not
173
- if attributes[self.class.attribute_map[key]].is_a?(Array)
174
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
175
+ if attributes[attribute_map[key]].is_a?(Array)
176
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
175
177
  end
176
- elsif !attributes[self.class.attribute_map[key]].nil?
177
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
178
+ elsif !attributes[attribute_map[key]].nil?
179
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
178
180
  end
179
181
  end
180
-
181
- self
182
+ new(transformed_hash)
182
183
  end
183
184
 
184
185
  # Deserializes the data based on type
185
186
  # @param string type Data type
186
187
  # @param string value Value to be deserialized
187
188
  # @return [Object] Deserialized data
188
- def _deserialize(type, value)
189
+ def self._deserialize(type, value)
189
190
  case type.to_sym
190
191
  when :Time
191
192
  Time.parse(value)
@@ -220,7 +221,7 @@ module BmcApi
220
221
  else # model
221
222
  # models (e.g. Pet) or oneOf
222
223
  klass = BmcApi.const_get(type)
223
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
224
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
224
225
  end
225
226
  end
226
227