pnap_bmc_api 1.5.0 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) 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/EsxiDatastoreConfiguration.md +18 -0
  6. data/docs/EsxiOsConfiguration.md +18 -0
  7. data/docs/OsConfiguration.md +2 -0
  8. data/docs/OsConfigurationCloudInit.md +1 -1
  9. data/docs/QuotasApi.md +6 -8
  10. data/docs/SSHKeysApi.md +12 -16
  11. data/docs/Server.md +11 -7
  12. data/docs/ServerCreate.md +3 -3
  13. data/docs/ServerNetworkUpdate.md +2 -2
  14. data/docs/ServerPrivateNetwork.md +3 -3
  15. data/docs/ServerProvision.md +38 -0
  16. data/docs/ServerPublicNetwork.md +2 -2
  17. data/docs/ServersApi.md +173 -111
  18. data/docs/StorageConfigurationRootPartition.md +2 -2
  19. data/lib/pnap_bmc_api/api/quotas_api.rb +11 -7
  20. data/lib/pnap_bmc_api/api/servers_api.rb +200 -75
  21. data/lib/pnap_bmc_api/api/ssh_keys_api.rb +21 -13
  22. data/lib/pnap_bmc_api/api_client.rb +26 -23
  23. data/lib/pnap_bmc_api/api_error.rb +2 -1
  24. data/lib/pnap_bmc_api/configuration.rb +28 -9
  25. data/lib/pnap_bmc_api/models/action_result.rb +16 -19
  26. data/lib/pnap_bmc_api/models/delete_result.rb +18 -19
  27. data/lib/pnap_bmc_api/models/delete_ssh_key_result.rb +18 -19
  28. data/lib/pnap_bmc_api/models/error.rb +16 -19
  29. data/lib/pnap_bmc_api/models/esxi_datastore_configuration.rb +262 -0
  30. data/lib/pnap_bmc_api/models/{quota_edit_limit_request_details_all_of.rb → esxi_os_configuration.rb} +25 -36
  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 +29 -21
  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 +14 -19
  39. data/lib/pnap_bmc_api/models/os_configuration_netris_softgate.rb +25 -22
  40. data/lib/pnap_bmc_api/models/os_configuration_windows.rb +19 -20
  41. data/lib/pnap_bmc_api/models/private_network_configuration.rb +14 -19
  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 +39 -19
  45. data/lib/pnap_bmc_api/models/quota_edit_limit_request_details.rb +42 -21
  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 +79 -33
  49. data/lib/pnap_bmc_api/models/server_create.rb +29 -22
  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 +23 -22
  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 +14 -19
  62. data/lib/pnap_bmc_api/models/storage_configuration_root_partition.rb +14 -19
  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/esxi_datastore_configuration_spec.rb +36 -0
  76. data/spec/models/esxi_os_configuration_spec.rb +36 -0
  77. data/spec/models/ip_blocks_configuration_spec.rb +7 -5
  78. data/spec/models/network_configuration_spec.rb +19 -5
  79. data/spec/models/os_configuration_cloud_init_spec.rb +5 -3
  80. data/spec/models/os_configuration_map_esxi_spec.rb +8 -6
  81. data/spec/models/os_configuration_map_proxmox_spec.rb +8 -6
  82. data/spec/models/os_configuration_map_spec.rb +8 -6
  83. data/spec/models/os_configuration_netris_controller_spec.rb +7 -5
  84. data/spec/models/os_configuration_netris_softgate_spec.rb +8 -6
  85. data/spec/models/os_configuration_spec.rb +39 -7
  86. data/spec/models/os_configuration_windows_spec.rb +6 -4
  87. data/spec/models/private_network_configuration_spec.rb +8 -6
  88. data/spec/models/public_network_configuration_spec.rb +6 -4
  89. data/spec/models/quota_edit_limit_request_details_spec.rb +8 -6
  90. data/spec/models/quota_edit_limit_request_spec.rb +7 -5
  91. data/spec/models/quota_spec.rb +13 -15
  92. data/spec/models/relinquish_ip_block_spec.rb +6 -4
  93. data/spec/models/reset_result_spec.rb +8 -6
  94. data/spec/models/server_create_spec.rb +25 -17
  95. data/spec/models/server_ip_block_spec.rb +7 -5
  96. data/spec/models/server_network_update_spec.rb +5 -3
  97. data/spec/models/server_patch_spec.rb +7 -5
  98. data/spec/models/server_private_network_spec.rb +9 -7
  99. data/spec/models/server_provision_spec.rb +96 -0
  100. data/spec/models/server_public_network_spec.rb +8 -6
  101. data/spec/models/server_reserve_spec.rb +6 -4
  102. data/spec/models/server_reset_spec.rb +9 -7
  103. data/spec/models/server_spec.rb +47 -27
  104. data/spec/models/ssh_key_create_spec.rb +8 -6
  105. data/spec/models/ssh_key_spec.rb +12 -10
  106. data/spec/models/ssh_key_update_spec.rb +7 -5
  107. data/spec/models/storage_configuration_root_partition_spec.rb +6 -4
  108. data/spec/models/storage_configuration_spec.rb +5 -3
  109. data/spec/models/tag_assignment_request_spec.rb +7 -5
  110. data/spec/models/tag_assignment_spec.rb +10 -8
  111. data/spec/spec_helper.rb +1 -1
  112. metadata +43 -39
  113. data/docs/QuotaEditLimitRequestDetailsAllOf.md +0 -18
  114. data/spec/api_client_spec.rb +0 -226
  115. data/spec/configuration_spec.rb +0 -42
  116. 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
 
@@ -91,36 +91,51 @@ module BmcApi
91
91
 
92
92
  if attributes.key?(:'id')
93
93
  self.id = attributes[:'id']
94
+ else
95
+ self.id = nil
94
96
  end
95
97
 
96
98
  if attributes.key?(:'default')
97
99
  self.default = attributes[:'default']
100
+ else
101
+ self.default = nil
98
102
  end
99
103
 
100
104
  if attributes.key?(:'name')
101
105
  self.name = attributes[:'name']
106
+ else
107
+ self.name = nil
102
108
  end
103
109
 
104
110
  if attributes.key?(:'key')
105
111
  self.key = attributes[:'key']
112
+ else
113
+ self.key = nil
106
114
  end
107
115
 
108
116
  if attributes.key?(:'fingerprint')
109
117
  self.fingerprint = attributes[:'fingerprint']
118
+ else
119
+ self.fingerprint = nil
110
120
  end
111
121
 
112
122
  if attributes.key?(:'created_on')
113
123
  self.created_on = attributes[:'created_on']
124
+ else
125
+ self.created_on = nil
114
126
  end
115
127
 
116
128
  if attributes.key?(:'last_updated_on')
117
129
  self.last_updated_on = attributes[:'last_updated_on']
130
+ else
131
+ self.last_updated_on = nil
118
132
  end
119
133
  end
120
134
 
121
135
  # Show invalid properties with the reasons. Usually used together with valid?
122
136
  # @return Array for valid properties with the reasons
123
137
  def list_invalid_properties
138
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
124
139
  invalid_properties = Array.new
125
140
  if @id.nil?
126
141
  invalid_properties.push('invalid value for "id", id cannot be nil.')
@@ -156,6 +171,7 @@ module BmcApi
156
171
  # Check to see if the all the properties in the model are valid
157
172
  # @return true if the model is valid
158
173
  def valid?
174
+ warn '[DEPRECATED] the `valid?` method is obsolete'
159
175
  return false if @id.nil?
160
176
  return false if @default.nil?
161
177
  return false if @name.nil?
@@ -196,37 +212,30 @@ module BmcApi
196
212
  # @param [Hash] attributes Model attributes in the form of hash
197
213
  # @return [Object] Returns the model itself
198
214
  def self.build_from_hash(attributes)
199
- new.build_from_hash(attributes)
200
- end
201
-
202
- # Builds the object from hash
203
- # @param [Hash] attributes Model attributes in the form of hash
204
- # @return [Object] Returns the model itself
205
- def build_from_hash(attributes)
206
215
  return nil unless attributes.is_a?(Hash)
207
216
  attributes = attributes.transform_keys(&:to_sym)
208
- self.class.openapi_types.each_pair do |key, type|
209
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
210
- self.send("#{key}=", nil)
217
+ transformed_hash = {}
218
+ openapi_types.each_pair do |key, type|
219
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
220
+ transformed_hash["#{key}"] = nil
211
221
  elsif type =~ /\AArray<(.*)>/i
212
222
  # check to ensure the input is an array given that the attribute
213
223
  # is documented as an array but the input is not
214
- if attributes[self.class.attribute_map[key]].is_a?(Array)
215
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
224
+ if attributes[attribute_map[key]].is_a?(Array)
225
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
216
226
  end
217
- elsif !attributes[self.class.attribute_map[key]].nil?
218
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
227
+ elsif !attributes[attribute_map[key]].nil?
228
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
219
229
  end
220
230
  end
221
-
222
- self
231
+ new(transformed_hash)
223
232
  end
224
233
 
225
234
  # Deserializes the data based on type
226
235
  # @param string type Data type
227
236
  # @param string value Value to be deserialized
228
237
  # @return [Object] Deserialized data
229
- def _deserialize(type, value)
238
+ def self._deserialize(type, value)
230
239
  case type.to_sym
231
240
  when :Time
232
241
  Time.parse(value)
@@ -261,7 +270,7 @@ module BmcApi
261
270
  else # model
262
271
  # models (e.g. Pet) or oneOf
263
272
  klass = BmcApi.const_get(type)
264
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
273
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
265
274
  end
266
275
  end
267
276
 
@@ -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
 
@@ -71,20 +71,27 @@ module BmcApi
71
71
 
72
72
  if attributes.key?(:'default')
73
73
  self.default = attributes[:'default']
74
+ else
75
+ self.default = nil
74
76
  end
75
77
 
76
78
  if attributes.key?(:'name')
77
79
  self.name = attributes[:'name']
80
+ else
81
+ self.name = nil
78
82
  end
79
83
 
80
84
  if attributes.key?(:'key')
81
85
  self.key = attributes[:'key']
86
+ else
87
+ self.key = nil
82
88
  end
83
89
  end
84
90
 
85
91
  # Show invalid properties with the reasons. Usually used together with valid?
86
92
  # @return Array for valid properties with the reasons
87
93
  def list_invalid_properties
94
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
88
95
  invalid_properties = Array.new
89
96
  if @default.nil?
90
97
  invalid_properties.push('invalid value for "default", default cannot be nil.')
@@ -102,21 +109,34 @@ module BmcApi
102
109
  invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
103
110
  end
104
111
 
112
+ pattern = Regexp.new(/^(?!\s*$).+/)
113
+ if @name !~ pattern
114
+ invalid_properties.push("invalid value for \"name\", must conform to the pattern #{pattern}.")
115
+ end
116
+
105
117
  if @key.nil?
106
118
  invalid_properties.push('invalid value for "key", key cannot be nil.')
107
119
  end
108
120
 
121
+ pattern = Regexp.new(/^(?!\s*$).+/)
122
+ if @key !~ pattern
123
+ invalid_properties.push("invalid value for \"key\", must conform to the pattern #{pattern}.")
124
+ end
125
+
109
126
  invalid_properties
110
127
  end
111
128
 
112
129
  # Check to see if the all the properties in the model are valid
113
130
  # @return true if the model is valid
114
131
  def valid?
132
+ warn '[DEPRECATED] the `valid?` method is obsolete'
115
133
  return false if @default.nil?
116
134
  return false if @name.nil?
117
135
  return false if @name.to_s.length > 100
118
136
  return false if @name.to_s.length < 1
137
+ return false if @name !~ Regexp.new(/^(?!\s*$).+/)
119
138
  return false if @key.nil?
139
+ return false if @key !~ Regexp.new(/^(?!\s*$).+/)
120
140
  true
121
141
  end
122
142
 
@@ -135,9 +155,29 @@ module BmcApi
135
155
  fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
136
156
  end
137
157
 
158
+ pattern = Regexp.new(/^(?!\s*$).+/)
159
+ if name !~ pattern
160
+ fail ArgumentError, "invalid value for \"name\", must conform to the pattern #{pattern}."
161
+ end
162
+
138
163
  @name = name
139
164
  end
140
165
 
166
+ # Custom attribute writer method with validation
167
+ # @param [Object] key Value to be assigned
168
+ def key=(key)
169
+ if key.nil?
170
+ fail ArgumentError, 'key cannot be nil'
171
+ end
172
+
173
+ pattern = Regexp.new(/^(?!\s*$).+/)
174
+ if key !~ pattern
175
+ fail ArgumentError, "invalid value for \"key\", must conform to the pattern #{pattern}."
176
+ end
177
+
178
+ @key = key
179
+ end
180
+
141
181
  # Checks equality by comparing each attribute.
142
182
  # @param [Object] Object to be compared
143
183
  def ==(o)
@@ -164,37 +204,30 @@ module BmcApi
164
204
  # @param [Hash] attributes Model attributes in the form of hash
165
205
  # @return [Object] Returns the model itself
166
206
  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
207
  return nil unless attributes.is_a?(Hash)
175
208
  attributes = attributes.transform_keys(&:to_sym)
176
- self.class.openapi_types.each_pair do |key, type|
177
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
178
- self.send("#{key}=", nil)
209
+ transformed_hash = {}
210
+ openapi_types.each_pair do |key, type|
211
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
212
+ transformed_hash["#{key}"] = nil
179
213
  elsif type =~ /\AArray<(.*)>/i
180
214
  # check to ensure the input is an array given that the attribute
181
215
  # is documented as an array but the input is not
182
- if attributes[self.class.attribute_map[key]].is_a?(Array)
183
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
216
+ if attributes[attribute_map[key]].is_a?(Array)
217
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
184
218
  end
185
- elsif !attributes[self.class.attribute_map[key]].nil?
186
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
219
+ elsif !attributes[attribute_map[key]].nil?
220
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
187
221
  end
188
222
  end
189
-
190
- self
223
+ new(transformed_hash)
191
224
  end
192
225
 
193
226
  # Deserializes the data based on type
194
227
  # @param string type Data type
195
228
  # @param string value Value to be deserialized
196
229
  # @return [Object] Deserialized data
197
- def _deserialize(type, value)
230
+ def self._deserialize(type, value)
198
231
  case type.to_sym
199
232
  when :Time
200
233
  Time.parse(value)
@@ -229,7 +262,7 @@ module BmcApi
229
262
  else # model
230
263
  # models (e.g. Pet) or oneOf
231
264
  klass = BmcApi.const_get(type)
232
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
265
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
233
266
  end
234
267
  end
235
268
 
@@ -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
 
@@ -66,16 +66,21 @@ module BmcApi
66
66
 
67
67
  if attributes.key?(:'default')
68
68
  self.default = attributes[:'default']
69
+ else
70
+ self.default = nil
69
71
  end
70
72
 
71
73
  if attributes.key?(:'name')
72
74
  self.name = attributes[:'name']
75
+ else
76
+ self.name = nil
73
77
  end
74
78
  end
75
79
 
76
80
  # Show invalid properties with the reasons. Usually used together with valid?
77
81
  # @return Array for valid properties with the reasons
78
82
  def list_invalid_properties
83
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
79
84
  invalid_properties = Array.new
80
85
  if @default.nil?
81
86
  invalid_properties.push('invalid value for "default", default cannot be nil.')
@@ -93,16 +98,23 @@ module BmcApi
93
98
  invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
94
99
  end
95
100
 
101
+ pattern = Regexp.new(/^(?!\s*$).+/)
102
+ if @name !~ pattern
103
+ invalid_properties.push("invalid value for \"name\", must conform to the pattern #{pattern}.")
104
+ end
105
+
96
106
  invalid_properties
97
107
  end
98
108
 
99
109
  # Check to see if the all the properties in the model are valid
100
110
  # @return true if the model is valid
101
111
  def valid?
112
+ warn '[DEPRECATED] the `valid?` method is obsolete'
102
113
  return false if @default.nil?
103
114
  return false if @name.nil?
104
115
  return false if @name.to_s.length > 100
105
116
  return false if @name.to_s.length < 1
117
+ return false if @name !~ Regexp.new(/^(?!\s*$).+/)
106
118
  true
107
119
  end
108
120
 
@@ -121,6 +133,11 @@ module BmcApi
121
133
  fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
122
134
  end
123
135
 
136
+ pattern = Regexp.new(/^(?!\s*$).+/)
137
+ if name !~ pattern
138
+ fail ArgumentError, "invalid value for \"name\", must conform to the pattern #{pattern}."
139
+ end
140
+
124
141
  @name = name
125
142
  end
126
143
 
@@ -149,37 +166,30 @@ module BmcApi
149
166
  # @param [Hash] attributes Model attributes in the form of hash
150
167
  # @return [Object] Returns the model itself
151
168
  def self.build_from_hash(attributes)
152
- new.build_from_hash(attributes)
153
- end
154
-
155
- # Builds the object from hash
156
- # @param [Hash] attributes Model attributes in the form of hash
157
- # @return [Object] Returns the model itself
158
- def build_from_hash(attributes)
159
169
  return nil unless attributes.is_a?(Hash)
160
170
  attributes = attributes.transform_keys(&:to_sym)
161
- self.class.openapi_types.each_pair do |key, type|
162
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
163
- self.send("#{key}=", nil)
171
+ transformed_hash = {}
172
+ openapi_types.each_pair do |key, type|
173
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
174
+ transformed_hash["#{key}"] = nil
164
175
  elsif type =~ /\AArray<(.*)>/i
165
176
  # check to ensure the input is an array given that the attribute
166
177
  # is documented as an array but the input is not
167
- if attributes[self.class.attribute_map[key]].is_a?(Array)
168
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
178
+ if attributes[attribute_map[key]].is_a?(Array)
179
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
169
180
  end
170
- elsif !attributes[self.class.attribute_map[key]].nil?
171
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
181
+ elsif !attributes[attribute_map[key]].nil?
182
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
172
183
  end
173
184
  end
174
-
175
- self
185
+ new(transformed_hash)
176
186
  end
177
187
 
178
188
  # Deserializes the data based on type
179
189
  # @param string type Data type
180
190
  # @param string value Value to be deserialized
181
191
  # @return [Object] Deserialized data
182
- def _deserialize(type, value)
192
+ def self._deserialize(type, value)
183
193
  case type.to_sym
184
194
  when :Time
185
195
  Time.parse(value)
@@ -214,7 +224,7 @@ module BmcApi
214
224
  else # model
215
225
  # models (e.g. Pet) or oneOf
216
226
  klass = BmcApi.const_get(type)
217
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
227
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
218
228
  end
219
229
  end
220
230
 
@@ -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
 
@@ -66,6 +66,7 @@ module BmcApi
66
66
  # Show invalid properties with the reasons. Usually used together with valid?
67
67
  # @return Array for valid properties with the reasons
68
68
  def list_invalid_properties
69
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
69
70
  invalid_properties = Array.new
70
71
  invalid_properties
71
72
  end
@@ -73,6 +74,7 @@ module BmcApi
73
74
  # Check to see if the all the properties in the model are valid
74
75
  # @return true if the model is valid
75
76
  def valid?
77
+ warn '[DEPRECATED] the `valid?` method is obsolete'
76
78
  true
77
79
  end
78
80
 
@@ -100,37 +102,30 @@ module BmcApi
100
102
  # @param [Hash] attributes Model attributes in the form of hash
101
103
  # @return [Object] Returns the model itself
102
104
  def self.build_from_hash(attributes)
103
- new.build_from_hash(attributes)
104
- end
105
-
106
- # Builds the object from hash
107
- # @param [Hash] attributes Model attributes in the form of hash
108
- # @return [Object] Returns the model itself
109
- def build_from_hash(attributes)
110
105
  return nil unless attributes.is_a?(Hash)
111
106
  attributes = attributes.transform_keys(&:to_sym)
112
- self.class.openapi_types.each_pair do |key, type|
113
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
114
- self.send("#{key}=", nil)
107
+ transformed_hash = {}
108
+ openapi_types.each_pair do |key, type|
109
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
110
+ transformed_hash["#{key}"] = nil
115
111
  elsif type =~ /\AArray<(.*)>/i
116
112
  # check to ensure the input is an array given that the attribute
117
113
  # is documented as an array but the input is not
118
- if attributes[self.class.attribute_map[key]].is_a?(Array)
119
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
114
+ if attributes[attribute_map[key]].is_a?(Array)
115
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
120
116
  end
121
- elsif !attributes[self.class.attribute_map[key]].nil?
122
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
117
+ elsif !attributes[attribute_map[key]].nil?
118
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
123
119
  end
124
120
  end
125
-
126
- self
121
+ new(transformed_hash)
127
122
  end
128
123
 
129
124
  # Deserializes the data based on type
130
125
  # @param string type Data type
131
126
  # @param string value Value to be deserialized
132
127
  # @return [Object] Deserialized data
133
- def _deserialize(type, value)
128
+ def self._deserialize(type, value)
134
129
  case type.to_sym
135
130
  when :Time
136
131
  Time.parse(value)
@@ -165,7 +160,7 @@ module BmcApi
165
160
  else # model
166
161
  # models (e.g. Pet) or oneOf
167
162
  klass = BmcApi.const_get(type)
168
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
163
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
169
164
  end
170
165
  end
171
166
 
@@ -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
 
@@ -80,6 +80,7 @@ module BmcApi
80
80
  # Show invalid properties with the reasons. Usually used together with valid?
81
81
  # @return Array for valid properties with the reasons
82
82
  def list_invalid_properties
83
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
83
84
  invalid_properties = Array.new
84
85
  invalid_properties
85
86
  end
@@ -87,6 +88,7 @@ module BmcApi
87
88
  # Check to see if the all the properties in the model are valid
88
89
  # @return true if the model is valid
89
90
  def valid?
91
+ warn '[DEPRECATED] the `valid?` method is obsolete'
90
92
  true
91
93
  end
92
94
 
@@ -115,37 +117,30 @@ module BmcApi
115
117
  # @param [Hash] attributes Model attributes in the form of hash
116
118
  # @return [Object] Returns the model itself
117
119
  def self.build_from_hash(attributes)
118
- new.build_from_hash(attributes)
119
- end
120
-
121
- # Builds the object from hash
122
- # @param [Hash] attributes Model attributes in the form of hash
123
- # @return [Object] Returns the model itself
124
- def build_from_hash(attributes)
125
120
  return nil unless attributes.is_a?(Hash)
126
121
  attributes = attributes.transform_keys(&:to_sym)
127
- self.class.openapi_types.each_pair do |key, type|
128
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
129
- self.send("#{key}=", nil)
122
+ transformed_hash = {}
123
+ openapi_types.each_pair do |key, type|
124
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
125
+ transformed_hash["#{key}"] = nil
130
126
  elsif type =~ /\AArray<(.*)>/i
131
127
  # check to ensure the input is an array given that the attribute
132
128
  # is documented as an array but the input is not
133
- if attributes[self.class.attribute_map[key]].is_a?(Array)
134
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
129
+ if attributes[attribute_map[key]].is_a?(Array)
130
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
135
131
  end
136
- elsif !attributes[self.class.attribute_map[key]].nil?
137
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
132
+ elsif !attributes[attribute_map[key]].nil?
133
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
138
134
  end
139
135
  end
140
-
141
- self
136
+ new(transformed_hash)
142
137
  end
143
138
 
144
139
  # Deserializes the data based on type
145
140
  # @param string type Data type
146
141
  # @param string value Value to be deserialized
147
142
  # @return [Object] Deserialized data
148
- def _deserialize(type, value)
143
+ def self._deserialize(type, value)
149
144
  case type.to_sym
150
145
  when :Time
151
146
  Time.parse(value)
@@ -180,7 +175,7 @@ module BmcApi
180
175
  else # model
181
176
  # models (e.g. Pet) or oneOf
182
177
  klass = BmcApi.const_get(type)
183
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
178
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
184
179
  end
185
180
  end
186
181
 
@@ -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
 
@@ -103,10 +103,14 @@ module BmcApi
103
103
 
104
104
  if attributes.key?(:'id')
105
105
  self.id = attributes[:'id']
106
+ else
107
+ self.id = nil
106
108
  end
107
109
 
108
110
  if attributes.key?(:'name')
109
111
  self.name = attributes[:'name']
112
+ else
113
+ self.name = nil
110
114
  end
111
115
 
112
116
  if attributes.key?(:'value')
@@ -115,6 +119,8 @@ module BmcApi
115
119
 
116
120
  if attributes.key?(:'is_billing_tag')
117
121
  self.is_billing_tag = attributes[:'is_billing_tag']
122
+ else
123
+ self.is_billing_tag = nil
118
124
  end
119
125
 
120
126
  if attributes.key?(:'created_by')
@@ -125,6 +131,7 @@ module BmcApi
125
131
  # Show invalid properties with the reasons. Usually used together with valid?
126
132
  # @return Array for valid properties with the reasons
127
133
  def list_invalid_properties
134
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
128
135
  invalid_properties = Array.new
129
136
  if @id.nil?
130
137
  invalid_properties.push('invalid value for "id", id cannot be nil.')
@@ -144,6 +151,7 @@ module BmcApi
144
151
  # Check to see if the all the properties in the model are valid
145
152
  # @return true if the model is valid
146
153
  def valid?
154
+ warn '[DEPRECATED] the `valid?` method is obsolete'
147
155
  return false if @id.nil?
148
156
  return false if @name.nil?
149
157
  return false if @is_billing_tag.nil?
@@ -190,37 +198,30 @@ module BmcApi
190
198
  # @param [Hash] attributes Model attributes in the form of hash
191
199
  # @return [Object] Returns the model itself
192
200
  def self.build_from_hash(attributes)
193
- new.build_from_hash(attributes)
194
- end
195
-
196
- # Builds the object from hash
197
- # @param [Hash] attributes Model attributes in the form of hash
198
- # @return [Object] Returns the model itself
199
- def build_from_hash(attributes)
200
201
  return nil unless attributes.is_a?(Hash)
201
202
  attributes = attributes.transform_keys(&:to_sym)
202
- self.class.openapi_types.each_pair do |key, type|
203
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
204
- self.send("#{key}=", nil)
203
+ transformed_hash = {}
204
+ openapi_types.each_pair do |key, type|
205
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
206
+ transformed_hash["#{key}"] = nil
205
207
  elsif type =~ /\AArray<(.*)>/i
206
208
  # check to ensure the input is an array given that the attribute
207
209
  # is documented as an array but the input is not
208
- if attributes[self.class.attribute_map[key]].is_a?(Array)
209
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
210
+ if attributes[attribute_map[key]].is_a?(Array)
211
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
210
212
  end
211
- elsif !attributes[self.class.attribute_map[key]].nil?
212
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
213
+ elsif !attributes[attribute_map[key]].nil?
214
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
213
215
  end
214
216
  end
215
-
216
- self
217
+ new(transformed_hash)
217
218
  end
218
219
 
219
220
  # Deserializes the data based on type
220
221
  # @param string type Data type
221
222
  # @param string value Value to be deserialized
222
223
  # @return [Object] Deserialized data
223
- def _deserialize(type, value)
224
+ def self._deserialize(type, value)
224
225
  case type.to_sym
225
226
  when :Time
226
227
  Time.parse(value)
@@ -255,7 +256,7 @@ module BmcApi
255
256
  else # model
256
257
  # models (e.g. Pet) or oneOf
257
258
  klass = BmcApi.const_get(type)
258
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
259
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
259
260
  end
260
261
  end
261
262