pnap_bmc_api 2.2.1 → 2.3.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 (115) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -0
  3. data/VERSION +1 -1
  4. data/docs/IpBlocksConfiguration.md +1 -1
  5. data/docs/OsConfigurationCloudInit.md +1 -1
  6. data/docs/OsConfigurationWindows.md +3 -1
  7. data/docs/PrivateNetworkConfiguration.md +1 -1
  8. data/docs/PublicNetworkConfiguration.md +1 -1
  9. data/docs/ReservationTransferDetails.md +18 -0
  10. data/docs/Server.md +3 -3
  11. data/docs/ServerCreate.md +3 -3
  12. data/docs/ServerNetworkUpdate.md +1 -1
  13. data/docs/ServerPrivateNetwork.md +4 -2
  14. data/docs/ServerProvision.md +1 -1
  15. data/docs/ServerPublicNetwork.md +5 -3
  16. data/docs/ServersApi.md +72 -0
  17. data/lib/pnap_bmc_api/api/quotas_api.rb +4 -4
  18. data/lib/pnap_bmc_api/api/servers_api.rb +97 -23
  19. data/lib/pnap_bmc_api/api/ssh_keys_api.rb +6 -6
  20. data/lib/pnap_bmc_api/api_client.rb +17 -14
  21. data/lib/pnap_bmc_api/api_error.rb +1 -1
  22. data/lib/pnap_bmc_api/api_model_base.rb +88 -0
  23. data/lib/pnap_bmc_api/configuration.rb +11 -1
  24. data/lib/pnap_bmc_api/models/action_result.rb +21 -78
  25. data/lib/pnap_bmc_api/models/delete_result.rb +31 -78
  26. data/lib/pnap_bmc_api/models/delete_ssh_key_result.rb +31 -78
  27. data/lib/pnap_bmc_api/models/error.rb +21 -78
  28. data/lib/pnap_bmc_api/models/esxi_datastore_configuration.rb +13 -80
  29. data/lib/pnap_bmc_api/models/esxi_os_configuration.rb +11 -78
  30. data/lib/pnap_bmc_api/models/gpu_configuration.rb +11 -78
  31. data/lib/pnap_bmc_api/models/ip_blocks_configuration.rb +12 -79
  32. data/lib/pnap_bmc_api/models/network_configuration.rb +11 -78
  33. data/lib/pnap_bmc_api/models/os_configuration.rb +11 -78
  34. data/lib/pnap_bmc_api/models/os_configuration_cloud_init.rb +11 -78
  35. data/lib/pnap_bmc_api/models/os_configuration_map.rb +11 -78
  36. data/lib/pnap_bmc_api/models/os_configuration_map_esxi.rb +11 -78
  37. data/lib/pnap_bmc_api/models/os_configuration_map_proxmox.rb +11 -78
  38. data/lib/pnap_bmc_api/models/os_configuration_netris_controller.rb +11 -78
  39. data/lib/pnap_bmc_api/models/os_configuration_netris_softgate.rb +11 -78
  40. data/lib/pnap_bmc_api/models/os_configuration_windows.rb +27 -82
  41. data/lib/pnap_bmc_api/models/private_network_configuration.rb +12 -79
  42. data/lib/pnap_bmc_api/models/public_network_configuration.rb +12 -79
  43. data/lib/pnap_bmc_api/models/quota.rb +61 -78
  44. data/lib/pnap_bmc_api/models/quota_edit_limit_request.rb +11 -78
  45. data/lib/pnap_bmc_api/models/quota_edit_limit_request_details.rb +22 -79
  46. data/lib/pnap_bmc_api/models/relinquish_ip_block.rb +11 -78
  47. data/lib/pnap_bmc_api/models/reservation_transfer_details.rb +166 -0
  48. data/lib/pnap_bmc_api/models/reset_result.rb +21 -78
  49. data/lib/pnap_bmc_api/models/server.rb +116 -83
  50. data/lib/pnap_bmc_api/models/server_create.rb +46 -83
  51. data/lib/pnap_bmc_api/models/server_ip_block.rb +21 -78
  52. data/lib/pnap_bmc_api/models/server_network_update.rb +12 -79
  53. data/lib/pnap_bmc_api/models/server_patch.rb +13 -80
  54. data/lib/pnap_bmc_api/models/server_private_network.rb +36 -83
  55. data/lib/pnap_bmc_api/models/server_provision.rb +24 -81
  56. data/lib/pnap_bmc_api/models/server_public_network.rb +36 -83
  57. data/lib/pnap_bmc_api/models/server_reserve.rb +21 -78
  58. data/lib/pnap_bmc_api/models/server_reset.rb +11 -78
  59. data/lib/pnap_bmc_api/models/ssh_key.rb +81 -78
  60. data/lib/pnap_bmc_api/models/ssh_key_create.rb +23 -80
  61. data/lib/pnap_bmc_api/models/ssh_key_update.rb +23 -80
  62. data/lib/pnap_bmc_api/models/storage_configuration.rb +11 -78
  63. data/lib/pnap_bmc_api/models/storage_configuration_root_partition.rb +11 -78
  64. data/lib/pnap_bmc_api/models/tag_assignment.rb +41 -78
  65. data/lib/pnap_bmc_api/models/tag_assignment_request.rb +21 -78
  66. data/lib/pnap_bmc_api/version.rb +1 -2
  67. data/lib/pnap_bmc_api.rb +3 -1
  68. data/pnap_bmc_api.gemspec +6 -6
  69. data/spec/api/quotas_api_spec.rb +1 -1
  70. data/spec/api/servers_api_spec.rb +14 -1
  71. data/spec/api/ssh_keys_api_spec.rb +1 -1
  72. data/spec/models/action_result_spec.rb +2 -2
  73. data/spec/models/delete_result_spec.rb +2 -2
  74. data/spec/models/delete_ssh_key_result_spec.rb +2 -2
  75. data/spec/models/error_spec.rb +2 -2
  76. data/spec/models/esxi_datastore_configuration_spec.rb +2 -2
  77. data/spec/models/esxi_os_configuration_spec.rb +2 -2
  78. data/spec/models/gpu_configuration_spec.rb +2 -2
  79. data/spec/models/ip_blocks_configuration_spec.rb +2 -2
  80. data/spec/models/network_configuration_spec.rb +2 -2
  81. data/spec/models/os_configuration_cloud_init_spec.rb +2 -2
  82. data/spec/models/os_configuration_map_esxi_spec.rb +2 -2
  83. data/spec/models/os_configuration_map_proxmox_spec.rb +2 -2
  84. data/spec/models/os_configuration_map_spec.rb +2 -2
  85. data/spec/models/os_configuration_netris_controller_spec.rb +2 -2
  86. data/spec/models/os_configuration_netris_softgate_spec.rb +2 -2
  87. data/spec/models/os_configuration_spec.rb +2 -2
  88. data/spec/models/os_configuration_windows_spec.rb +8 -2
  89. data/spec/models/private_network_configuration_spec.rb +2 -2
  90. data/spec/models/public_network_configuration_spec.rb +2 -2
  91. data/spec/models/quota_edit_limit_request_details_spec.rb +2 -2
  92. data/spec/models/quota_edit_limit_request_spec.rb +2 -2
  93. data/spec/models/quota_spec.rb +2 -2
  94. data/spec/models/relinquish_ip_block_spec.rb +2 -2
  95. data/spec/models/reservation_transfer_details_spec.rb +36 -0
  96. data/spec/models/reset_result_spec.rb +2 -2
  97. data/spec/models/server_create_spec.rb +2 -2
  98. data/spec/models/server_ip_block_spec.rb +2 -2
  99. data/spec/models/server_network_update_spec.rb +2 -2
  100. data/spec/models/server_patch_spec.rb +2 -2
  101. data/spec/models/server_private_network_spec.rb +8 -2
  102. data/spec/models/server_provision_spec.rb +2 -2
  103. data/spec/models/server_public_network_spec.rb +8 -2
  104. data/spec/models/server_reserve_spec.rb +2 -2
  105. data/spec/models/server_reset_spec.rb +2 -2
  106. data/spec/models/server_spec.rb +2 -2
  107. data/spec/models/ssh_key_create_spec.rb +2 -2
  108. data/spec/models/ssh_key_spec.rb +2 -2
  109. data/spec/models/ssh_key_update_spec.rb +2 -2
  110. data/spec/models/storage_configuration_root_partition_spec.rb +2 -2
  111. data/spec/models/storage_configuration_spec.rb +2 -2
  112. data/spec/models/tag_assignment_request_spec.rb +2 -2
  113. data/spec/models/tag_assignment_spec.rb +2 -2
  114. data/spec/spec_helper.rb +1 -1
  115. metadata +48 -39
@@ -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: 7.2.0
9
+ Generator version: 7.20.0
10
10
 
11
11
  =end
12
12
 
@@ -15,7 +15,7 @@ require 'time'
15
15
 
16
16
  module BmcApi
17
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
- class OsConfigurationNetrisController
18
+ class OsConfigurationNetrisController < ApiModelBase
19
19
  # (Read-only) Host OS on which the Netris Controller is installed.
20
20
  attr_accessor :host_os
21
21
 
@@ -34,9 +34,14 @@ module BmcApi
34
34
  }
35
35
  end
36
36
 
37
+ # Returns attribute mapping this model knows about
38
+ def self.acceptable_attribute_map
39
+ attribute_map
40
+ end
41
+
37
42
  # Returns all the JSON keys this model knows about
38
43
  def self.acceptable_attributes
39
- attribute_map.values
44
+ acceptable_attribute_map.values
40
45
  end
41
46
 
42
47
  # Attribute type mapping.
@@ -62,9 +67,10 @@ module BmcApi
62
67
  end
63
68
 
64
69
  # check to see if the attribute exists and convert string to symbol for hash key
70
+ acceptable_attribute_map = self.class.acceptable_attribute_map
65
71
  attributes = attributes.each_with_object({}) { |(k, v), h|
66
- if (!self.class.attribute_map.key?(k.to_sym))
67
- fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::OsConfigurationNetrisController`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
72
+ if (!acceptable_attribute_map.key?(k.to_sym))
73
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::OsConfigurationNetrisController`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
68
74
  end
69
75
  h[k.to_sym] = v
70
76
  }
@@ -142,61 +148,6 @@ module BmcApi
142
148
  new(transformed_hash)
143
149
  end
144
150
 
145
- # Deserializes the data based on type
146
- # @param string type Data type
147
- # @param string value Value to be deserialized
148
- # @return [Object] Deserialized data
149
- def self._deserialize(type, value)
150
- case type.to_sym
151
- when :Time
152
- Time.parse(value)
153
- when :Date
154
- Date.parse(value)
155
- when :String
156
- value.to_s
157
- when :Integer
158
- value.to_i
159
- when :Float
160
- value.to_f
161
- when :Boolean
162
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
163
- true
164
- else
165
- false
166
- end
167
- when :Object
168
- # generic object (usually a Hash), return directly
169
- value
170
- when /\AArray<(?<inner_type>.+)>\z/
171
- inner_type = Regexp.last_match[:inner_type]
172
- value.map { |v| _deserialize(inner_type, v) }
173
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
174
- k_type = Regexp.last_match[:k_type]
175
- v_type = Regexp.last_match[:v_type]
176
- {}.tap do |hash|
177
- value.each do |k, v|
178
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
179
- end
180
- end
181
- else # model
182
- # models (e.g. Pet) or oneOf
183
- klass = BmcApi.const_get(type)
184
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
185
- end
186
- end
187
-
188
- # Returns the string representation of the object
189
- # @return [String] String presentation of the object
190
- def to_s
191
- to_hash.to_s
192
- end
193
-
194
- # to_body is an alias to to_hash (backward compatibility)
195
- # @return [Hash] Returns the object in the form of hash
196
- def to_body
197
- to_hash
198
- end
199
-
200
151
  # Returns the object in the form of hash
201
152
  # @return [Hash] Returns the object in the form of hash
202
153
  def to_hash
@@ -213,24 +164,6 @@ module BmcApi
213
164
  hash
214
165
  end
215
166
 
216
- # Outputs non-array value in the form of hash
217
- # For object, use to_hash. Otherwise, just return the value
218
- # @param [Object] value Any valid value
219
- # @return [Hash] Returns the value in the form of hash
220
- def _to_hash(value)
221
- if value.is_a?(Array)
222
- value.compact.map { |v| _to_hash(v) }
223
- elsif value.is_a?(Hash)
224
- {}.tap do |hash|
225
- value.each { |k, v| hash[k] = _to_hash(v) }
226
- end
227
- elsif value.respond_to? :to_hash
228
- value.to_hash
229
- else
230
- value
231
- end
232
- end
233
-
234
167
  end
235
168
 
236
169
  end
@@ -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: 7.2.0
9
+ Generator version: 7.20.0
10
10
 
11
11
  =end
12
12
 
@@ -15,7 +15,7 @@ require 'time'
15
15
 
16
16
  module BmcApi
17
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
- class OsConfigurationNetrisSoftgate
18
+ class OsConfigurationNetrisSoftgate < ApiModelBase
19
19
  # (Read-only) Host OS on which the Netris Softgate is installed.
20
20
  attr_accessor :host_os
21
21
 
@@ -38,9 +38,14 @@ module BmcApi
38
38
  }
39
39
  end
40
40
 
41
+ # Returns attribute mapping this model knows about
42
+ def self.acceptable_attribute_map
43
+ attribute_map
44
+ end
45
+
41
46
  # Returns all the JSON keys this model knows about
42
47
  def self.acceptable_attributes
43
- attribute_map.values
48
+ acceptable_attribute_map.values
44
49
  end
45
50
 
46
51
  # Attribute type mapping.
@@ -67,9 +72,10 @@ module BmcApi
67
72
  end
68
73
 
69
74
  # check to see if the attribute exists and convert string to symbol for hash key
75
+ acceptable_attribute_map = self.class.acceptable_attribute_map
70
76
  attributes = attributes.each_with_object({}) { |(k, v), h|
71
- if (!self.class.attribute_map.key?(k.to_sym))
72
- fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::OsConfigurationNetrisSoftgate`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
77
+ if (!acceptable_attribute_map.key?(k.to_sym))
78
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::OsConfigurationNetrisSoftgate`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
73
79
  end
74
80
  h[k.to_sym] = v
75
81
  }
@@ -203,61 +209,6 @@ module BmcApi
203
209
  new(transformed_hash)
204
210
  end
205
211
 
206
- # Deserializes the data based on type
207
- # @param string type Data type
208
- # @param string value Value to be deserialized
209
- # @return [Object] Deserialized data
210
- def self._deserialize(type, value)
211
- case type.to_sym
212
- when :Time
213
- Time.parse(value)
214
- when :Date
215
- Date.parse(value)
216
- when :String
217
- value.to_s
218
- when :Integer
219
- value.to_i
220
- when :Float
221
- value.to_f
222
- when :Boolean
223
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
224
- true
225
- else
226
- false
227
- end
228
- when :Object
229
- # generic object (usually a Hash), return directly
230
- value
231
- when /\AArray<(?<inner_type>.+)>\z/
232
- inner_type = Regexp.last_match[:inner_type]
233
- value.map { |v| _deserialize(inner_type, v) }
234
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
235
- k_type = Regexp.last_match[:k_type]
236
- v_type = Regexp.last_match[:v_type]
237
- {}.tap do |hash|
238
- value.each do |k, v|
239
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
240
- end
241
- end
242
- else # model
243
- # models (e.g. Pet) or oneOf
244
- klass = BmcApi.const_get(type)
245
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
246
- end
247
- end
248
-
249
- # Returns the string representation of the object
250
- # @return [String] String presentation of the object
251
- def to_s
252
- to_hash.to_s
253
- end
254
-
255
- # to_body is an alias to to_hash (backward compatibility)
256
- # @return [Hash] Returns the object in the form of hash
257
- def to_body
258
- to_hash
259
- end
260
-
261
212
  # Returns the object in the form of hash
262
213
  # @return [Hash] Returns the object in the form of hash
263
214
  def to_hash
@@ -274,24 +225,6 @@ module BmcApi
274
225
  hash
275
226
  end
276
227
 
277
- # Outputs non-array value in the form of hash
278
- # For object, use to_hash. Otherwise, just return the value
279
- # @param [Object] value Any valid value
280
- # @return [Hash] Returns the value in the form of hash
281
- def _to_hash(value)
282
- if value.is_a?(Array)
283
- value.compact.map { |v| _to_hash(v) }
284
- elsif value.is_a?(Hash)
285
- {}.tap do |hash|
286
- value.each { |k, v| hash[k] = _to_hash(v) }
287
- end
288
- elsif value.respond_to? :to_hash
289
- value.to_hash
290
- else
291
- value
292
- end
293
- end
294
-
295
228
  end
296
229
 
297
230
  end
@@ -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: 7.2.0
9
+ Generator version: 7.20.0
10
10
 
11
11
  =end
12
12
 
@@ -15,26 +15,36 @@ require 'time'
15
15
 
16
16
  module BmcApi
17
17
  # Windows OS configuration properties.
18
- class OsConfigurationWindows
18
+ class OsConfigurationWindows < ApiModelBase
19
19
  # List of IPs allowed for RDP access to Windows OS. Supported in single IP, CIDR and range format. When undefined, RDP is disabled. To allow RDP access from any IP use 0.0.0.0/0. This will only be returned in response to provisioning a server.
20
20
  attr_accessor :rdp_allowed_ips
21
21
 
22
+ # Use a Bring Your Own (BYO) Windows license. If true, the server is provisioned in trial mode, and you must activate your own license. If false (default), the server includes a managed Windows license billed by the platform.
23
+ attr_accessor :bring_your_own_license
24
+
22
25
  # Attribute mapping from ruby-style variable name to JSON key.
23
26
  def self.attribute_map
24
27
  {
25
- :'rdp_allowed_ips' => :'rdpAllowedIps'
28
+ :'rdp_allowed_ips' => :'rdpAllowedIps',
29
+ :'bring_your_own_license' => :'bringYourOwnLicense'
26
30
  }
27
31
  end
28
32
 
33
+ # Returns attribute mapping this model knows about
34
+ def self.acceptable_attribute_map
35
+ attribute_map
36
+ end
37
+
29
38
  # Returns all the JSON keys this model knows about
30
39
  def self.acceptable_attributes
31
- attribute_map.values
40
+ acceptable_attribute_map.values
32
41
  end
33
42
 
34
43
  # Attribute type mapping.
35
44
  def self.openapi_types
36
45
  {
37
- :'rdp_allowed_ips' => :'Array<String>'
46
+ :'rdp_allowed_ips' => :'Array<String>',
47
+ :'bring_your_own_license' => :'Boolean'
38
48
  }
39
49
  end
40
50
 
@@ -52,9 +62,10 @@ module BmcApi
52
62
  end
53
63
 
54
64
  # check to see if the attribute exists and convert string to symbol for hash key
65
+ acceptable_attribute_map = self.class.acceptable_attribute_map
55
66
  attributes = attributes.each_with_object({}) { |(k, v), h|
56
- if (!self.class.attribute_map.key?(k.to_sym))
57
- fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::OsConfigurationWindows`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
67
+ if (!acceptable_attribute_map.key?(k.to_sym))
68
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::OsConfigurationWindows`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
58
69
  end
59
70
  h[k.to_sym] = v
60
71
  }
@@ -64,6 +75,12 @@ module BmcApi
64
75
  self.rdp_allowed_ips = value
65
76
  end
66
77
  end
78
+
79
+ if attributes.key?(:'bring_your_own_license')
80
+ self.bring_your_own_license = attributes[:'bring_your_own_license']
81
+ else
82
+ self.bring_your_own_license = false
83
+ end
67
84
  end
68
85
 
69
86
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -105,7 +122,8 @@ module BmcApi
105
122
  def ==(o)
106
123
  return true if self.equal?(o)
107
124
  self.class == o.class &&
108
- rdp_allowed_ips == o.rdp_allowed_ips
125
+ rdp_allowed_ips == o.rdp_allowed_ips &&
126
+ bring_your_own_license == o.bring_your_own_license
109
127
  end
110
128
 
111
129
  # @see the `==` method
@@ -117,7 +135,7 @@ module BmcApi
117
135
  # Calculates hash code according to all attributes.
118
136
  # @return [Integer] Hash code
119
137
  def hash
120
- [rdp_allowed_ips].hash
138
+ [rdp_allowed_ips, bring_your_own_license].hash
121
139
  end
122
140
 
123
141
  # Builds the object from hash
@@ -143,61 +161,6 @@ module BmcApi
143
161
  new(transformed_hash)
144
162
  end
145
163
 
146
- # Deserializes the data based on type
147
- # @param string type Data type
148
- # @param string value Value to be deserialized
149
- # @return [Object] Deserialized data
150
- def self._deserialize(type, value)
151
- case type.to_sym
152
- when :Time
153
- Time.parse(value)
154
- when :Date
155
- Date.parse(value)
156
- when :String
157
- value.to_s
158
- when :Integer
159
- value.to_i
160
- when :Float
161
- value.to_f
162
- when :Boolean
163
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
164
- true
165
- else
166
- false
167
- end
168
- when :Object
169
- # generic object (usually a Hash), return directly
170
- value
171
- when /\AArray<(?<inner_type>.+)>\z/
172
- inner_type = Regexp.last_match[:inner_type]
173
- value.map { |v| _deserialize(inner_type, v) }
174
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
175
- k_type = Regexp.last_match[:k_type]
176
- v_type = Regexp.last_match[:v_type]
177
- {}.tap do |hash|
178
- value.each do |k, v|
179
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
180
- end
181
- end
182
- else # model
183
- # models (e.g. Pet) or oneOf
184
- klass = BmcApi.const_get(type)
185
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
186
- end
187
- end
188
-
189
- # Returns the string representation of the object
190
- # @return [String] String presentation of the object
191
- def to_s
192
- to_hash.to_s
193
- end
194
-
195
- # to_body is an alias to to_hash (backward compatibility)
196
- # @return [Hash] Returns the object in the form of hash
197
- def to_body
198
- to_hash
199
- end
200
-
201
164
  # Returns the object in the form of hash
202
165
  # @return [Hash] Returns the object in the form of hash
203
166
  def to_hash
@@ -214,24 +177,6 @@ module BmcApi
214
177
  hash
215
178
  end
216
179
 
217
- # Outputs non-array value in the form of hash
218
- # For object, use to_hash. Otherwise, just return the value
219
- # @param [Object] value Any valid value
220
- # @return [Hash] Returns the value in the form of hash
221
- def _to_hash(value)
222
- if value.is_a?(Array)
223
- value.compact.map { |v| _to_hash(v) }
224
- elsif value.is_a?(Hash)
225
- {}.tap do |hash|
226
- value.each { |k, v| hash[k] = _to_hash(v) }
227
- end
228
- elsif value.respond_to? :to_hash
229
- value.to_hash
230
- else
231
- value
232
- end
233
- end
234
-
235
180
  end
236
181
 
237
182
  end
@@ -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: 7.2.0
9
+ Generator version: 7.20.0
10
10
 
11
11
  =end
12
12
 
@@ -15,14 +15,14 @@ require 'time'
15
15
 
16
16
  module BmcApi
17
17
  # Private network details of bare metal server.
18
- class PrivateNetworkConfiguration
18
+ class PrivateNetworkConfiguration < ApiModelBase
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
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
- # 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.
25
+ # The list of private networks this server belongs to. If this field is part of a request body, it will be used for specifying the private networks to assign to this server upon provisioning. Used alongside the USER_DEFINED configurationType.
26
26
  attr_accessor :private_networks
27
27
 
28
28
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -34,9 +34,14 @@ module BmcApi
34
34
  }
35
35
  end
36
36
 
37
+ # Returns attribute mapping this model knows about
38
+ def self.acceptable_attribute_map
39
+ attribute_map
40
+ end
41
+
37
42
  # Returns all the JSON keys this model knows about
38
43
  def self.acceptable_attributes
39
- attribute_map.values
44
+ acceptable_attribute_map.values
40
45
  end
41
46
 
42
47
  # Attribute type mapping.
@@ -62,9 +67,10 @@ module BmcApi
62
67
  end
63
68
 
64
69
  # check to see if the attribute exists and convert string to symbol for hash key
70
+ acceptable_attribute_map = self.class.acceptable_attribute_map
65
71
  attributes = attributes.each_with_object({}) { |(k, v), h|
66
- if (!self.class.attribute_map.key?(k.to_sym))
67
- fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::PrivateNetworkConfiguration`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
72
+ if (!acceptable_attribute_map.key?(k.to_sym))
73
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::PrivateNetworkConfiguration`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
68
74
  end
69
75
  h[k.to_sym] = v
70
76
  }
@@ -146,61 +152,6 @@ module BmcApi
146
152
  new(transformed_hash)
147
153
  end
148
154
 
149
- # Deserializes the data based on type
150
- # @param string type Data type
151
- # @param string value Value to be deserialized
152
- # @return [Object] Deserialized data
153
- def self._deserialize(type, value)
154
- case type.to_sym
155
- when :Time
156
- Time.parse(value)
157
- when :Date
158
- Date.parse(value)
159
- when :String
160
- value.to_s
161
- when :Integer
162
- value.to_i
163
- when :Float
164
- value.to_f
165
- when :Boolean
166
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
167
- true
168
- else
169
- false
170
- end
171
- when :Object
172
- # generic object (usually a Hash), return directly
173
- value
174
- when /\AArray<(?<inner_type>.+)>\z/
175
- inner_type = Regexp.last_match[:inner_type]
176
- value.map { |v| _deserialize(inner_type, v) }
177
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
178
- k_type = Regexp.last_match[:k_type]
179
- v_type = Regexp.last_match[:v_type]
180
- {}.tap do |hash|
181
- value.each do |k, v|
182
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
183
- end
184
- end
185
- else # model
186
- # models (e.g. Pet) or oneOf
187
- klass = BmcApi.const_get(type)
188
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
189
- end
190
- end
191
-
192
- # Returns the string representation of the object
193
- # @return [String] String presentation of the object
194
- def to_s
195
- to_hash.to_s
196
- end
197
-
198
- # to_body is an alias to to_hash (backward compatibility)
199
- # @return [Hash] Returns the object in the form of hash
200
- def to_body
201
- to_hash
202
- end
203
-
204
155
  # Returns the object in the form of hash
205
156
  # @return [Hash] Returns the object in the form of hash
206
157
  def to_hash
@@ -217,24 +168,6 @@ module BmcApi
217
168
  hash
218
169
  end
219
170
 
220
- # Outputs non-array value in the form of hash
221
- # For object, use to_hash. Otherwise, just return the value
222
- # @param [Object] value Any valid value
223
- # @return [Hash] Returns the value in the form of hash
224
- def _to_hash(value)
225
- if value.is_a?(Array)
226
- value.compact.map { |v| _to_hash(v) }
227
- elsif value.is_a?(Hash)
228
- {}.tap do |hash|
229
- value.each { |k, v| hash[k] = _to_hash(v) }
230
- end
231
- elsif value.respond_to? :to_hash
232
- value.to_hash
233
- else
234
- value
235
- end
236
- end
237
-
238
171
  end
239
172
 
240
173
  end