pnap_bmc_api 2.2.2 → 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 +3 -1
  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 +21 -78
  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 +35 -82
  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 +45 -36
@@ -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,8 +15,8 @@ require 'time'
15
15
 
16
16
  module BmcApi
17
17
  # Update network details of bare metal server.
18
- class ServerNetworkUpdate
19
- # List of IPs to be associated to the server.<br> Valid IP formats include single IP addresses or IP ranges (IPv4 or IPv6). 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>
18
+ class ServerNetworkUpdate < ApiModelBase
19
+ # List of IPs to be associated to the server.<br> Valid IP formats include single IP addresses or IP ranges (IPv4 or IPv6). All 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.
@@ -26,9 +26,14 @@ module BmcApi
26
26
  }
27
27
  end
28
28
 
29
+ # Returns attribute mapping this model knows about
30
+ def self.acceptable_attribute_map
31
+ attribute_map
32
+ end
33
+
29
34
  # Returns all the JSON keys this model knows about
30
35
  def self.acceptable_attributes
31
- attribute_map.values
36
+ acceptable_attribute_map.values
32
37
  end
33
38
 
34
39
  # Attribute type mapping.
@@ -52,9 +57,10 @@ module BmcApi
52
57
  end
53
58
 
54
59
  # check to see if the attribute exists and convert string to symbol for hash key
60
+ acceptable_attribute_map = self.class.acceptable_attribute_map
55
61
  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::ServerNetworkUpdate`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
62
+ if (!acceptable_attribute_map.key?(k.to_sym))
63
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::ServerNetworkUpdate`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
58
64
  end
59
65
  h[k.to_sym] = v
60
66
  }
@@ -124,61 +130,6 @@ module BmcApi
124
130
  new(transformed_hash)
125
131
  end
126
132
 
127
- # Deserializes the data based on type
128
- # @param string type Data type
129
- # @param string value Value to be deserialized
130
- # @return [Object] Deserialized data
131
- def self._deserialize(type, value)
132
- case type.to_sym
133
- when :Time
134
- Time.parse(value)
135
- when :Date
136
- Date.parse(value)
137
- when :String
138
- value.to_s
139
- when :Integer
140
- value.to_i
141
- when :Float
142
- value.to_f
143
- when :Boolean
144
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
145
- true
146
- else
147
- false
148
- end
149
- when :Object
150
- # generic object (usually a Hash), return directly
151
- value
152
- when /\AArray<(?<inner_type>.+)>\z/
153
- inner_type = Regexp.last_match[:inner_type]
154
- value.map { |v| _deserialize(inner_type, v) }
155
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
156
- k_type = Regexp.last_match[:k_type]
157
- v_type = Regexp.last_match[:v_type]
158
- {}.tap do |hash|
159
- value.each do |k, v|
160
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
161
- end
162
- end
163
- else # model
164
- # models (e.g. Pet) or oneOf
165
- klass = BmcApi.const_get(type)
166
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
167
- end
168
- end
169
-
170
- # Returns the string representation of the object
171
- # @return [String] String presentation of the object
172
- def to_s
173
- to_hash.to_s
174
- end
175
-
176
- # to_body is an alias to to_hash (backward compatibility)
177
- # @return [Hash] Returns the object in the form of hash
178
- def to_body
179
- to_hash
180
- end
181
-
182
133
  # Returns the object in the form of hash
183
134
  # @return [Hash] Returns the object in the form of hash
184
135
  def to_hash
@@ -195,24 +146,6 @@ module BmcApi
195
146
  hash
196
147
  end
197
148
 
198
- # Outputs non-array value in the form of hash
199
- # For object, use to_hash. Otherwise, just return the value
200
- # @param [Object] value Any valid value
201
- # @return [Hash] Returns the value in the form of hash
202
- def _to_hash(value)
203
- if value.is_a?(Array)
204
- value.compact.map { |v| _to_hash(v) }
205
- elsif value.is_a?(Hash)
206
- {}.tap do |hash|
207
- value.each { |k, v| hash[k] = _to_hash(v) }
208
- end
209
- elsif value.respond_to? :to_hash
210
- value.to_hash
211
- else
212
- value
213
- end
214
- end
215
-
216
149
  end
217
150
 
218
151
  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
  # Patch bare metal server.
18
- class ServerPatch
18
+ class ServerPatch < ApiModelBase
19
19
  # Description of server.
20
20
  attr_accessor :description
21
21
 
@@ -30,9 +30,14 @@ module BmcApi
30
30
  }
31
31
  end
32
32
 
33
+ # Returns attribute mapping this model knows about
34
+ def self.acceptable_attribute_map
35
+ attribute_map
36
+ end
37
+
33
38
  # Returns all the JSON keys this model knows about
34
39
  def self.acceptable_attributes
35
- attribute_map.values
40
+ acceptable_attribute_map.values
36
41
  end
37
42
 
38
43
  # Attribute type mapping.
@@ -57,9 +62,10 @@ module BmcApi
57
62
  end
58
63
 
59
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
60
66
  attributes = attributes.each_with_object({}) { |(k, v), h|
61
- if (!self.class.attribute_map.key?(k.to_sym))
62
- fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::ServerPatch`. 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::ServerPatch`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
63
69
  end
64
70
  h[k.to_sym] = v
65
71
  }
@@ -87,7 +93,7 @@ module BmcApi
87
93
  end
88
94
 
89
95
  if !@hostname.nil? && @hostname.to_s.length < 1
90
- invalid_properties.push('invalid value for "hostname", the character length must be great than or equal to 1.')
96
+ invalid_properties.push('invalid value for "hostname", the character length must be greater than or equal to 1.')
91
97
  end
92
98
 
93
99
  pattern = Regexp.new(/[a-zA-Z0-9().-]+/)
@@ -135,7 +141,7 @@ module BmcApi
135
141
  end
136
142
 
137
143
  if hostname.to_s.length < 1
138
- fail ArgumentError, 'invalid value for "hostname", the character length must be great than or equal to 1.'
144
+ fail ArgumentError, 'invalid value for "hostname", the character length must be greater than or equal to 1.'
139
145
  end
140
146
 
141
147
  pattern = Regexp.new(/[a-zA-Z0-9().-]+/)
@@ -190,61 +196,6 @@ module BmcApi
190
196
  new(transformed_hash)
191
197
  end
192
198
 
193
- # Deserializes the data based on type
194
- # @param string type Data type
195
- # @param string value Value to be deserialized
196
- # @return [Object] Deserialized data
197
- def self._deserialize(type, value)
198
- case type.to_sym
199
- when :Time
200
- Time.parse(value)
201
- when :Date
202
- Date.parse(value)
203
- when :String
204
- value.to_s
205
- when :Integer
206
- value.to_i
207
- when :Float
208
- value.to_f
209
- when :Boolean
210
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
211
- true
212
- else
213
- false
214
- end
215
- when :Object
216
- # generic object (usually a Hash), return directly
217
- value
218
- when /\AArray<(?<inner_type>.+)>\z/
219
- inner_type = Regexp.last_match[:inner_type]
220
- value.map { |v| _deserialize(inner_type, v) }
221
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
222
- k_type = Regexp.last_match[:k_type]
223
- v_type = Regexp.last_match[:v_type]
224
- {}.tap do |hash|
225
- value.each do |k, v|
226
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
227
- end
228
- end
229
- else # model
230
- # models (e.g. Pet) or oneOf
231
- klass = BmcApi.const_get(type)
232
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
233
- end
234
- end
235
-
236
- # Returns the string representation of the object
237
- # @return [String] String presentation of the object
238
- def to_s
239
- to_hash.to_s
240
- end
241
-
242
- # to_body is an alias to to_hash (backward compatibility)
243
- # @return [Hash] Returns the object in the form of hash
244
- def to_body
245
- to_hash
246
- end
247
-
248
199
  # Returns the object in the form of hash
249
200
  # @return [Hash] Returns the object in the form of hash
250
201
  def to_hash
@@ -261,24 +212,6 @@ module BmcApi
261
212
  hash
262
213
  end
263
214
 
264
- # Outputs non-array value in the form of hash
265
- # For object, use to_hash. Otherwise, just return the value
266
- # @param [Object] value Any valid value
267
- # @return [Hash] Returns the value in the form of hash
268
- def _to_hash(value)
269
- if value.is_a?(Array)
270
- value.compact.map { |v| _to_hash(v) }
271
- elsif value.is_a?(Hash)
272
- {}.tap do |hash|
273
- value.each { |k, v| hash[k] = _to_hash(v) }
274
- end
275
- elsif value.respond_to? :to_hash
276
- value.to_hash
277
- else
278
- value
279
- end
280
- end
281
-
282
215
  end
283
216
 
284
217
  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
  # Private network details of bare metal server.
18
- class ServerPrivateNetwork
18
+ class ServerPrivateNetwork < ApiModelBase
19
19
  # The network identifier.
20
20
  attr_accessor :id
21
21
 
@@ -28,19 +28,28 @@ module BmcApi
28
28
  # (Read-only) The status of the network.
29
29
  attr_accessor :status_description
30
30
 
31
+ # (Read-only) The VLAN on which this network has been configured within the network switch.
32
+ attr_accessor :vlan_id
33
+
31
34
  # Attribute mapping from ruby-style variable name to JSON key.
32
35
  def self.attribute_map
33
36
  {
34
37
  :'id' => :'id',
35
38
  :'ips' => :'ips',
36
39
  :'dhcp' => :'dhcp',
37
- :'status_description' => :'statusDescription'
40
+ :'status_description' => :'statusDescription',
41
+ :'vlan_id' => :'vlanId'
38
42
  }
39
43
  end
40
44
 
45
+ # Returns attribute mapping this model knows about
46
+ def self.acceptable_attribute_map
47
+ attribute_map
48
+ end
49
+
41
50
  # Returns all the JSON keys this model knows about
42
51
  def self.acceptable_attributes
43
- attribute_map.values
52
+ acceptable_attribute_map.values
44
53
  end
45
54
 
46
55
  # Attribute type mapping.
@@ -49,7 +58,8 @@ module BmcApi
49
58
  :'id' => :'String',
50
59
  :'ips' => :'Array<String>',
51
60
  :'dhcp' => :'Boolean',
52
- :'status_description' => :'String'
61
+ :'status_description' => :'String',
62
+ :'vlan_id' => :'Integer'
53
63
  }
54
64
  end
55
65
 
@@ -67,9 +77,10 @@ module BmcApi
67
77
  end
68
78
 
69
79
  # check to see if the attribute exists and convert string to symbol for hash key
80
+ acceptable_attribute_map = self.class.acceptable_attribute_map
70
81
  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::ServerPrivateNetwork`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
82
+ if (!acceptable_attribute_map.key?(k.to_sym))
83
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::ServerPrivateNetwork`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
73
84
  end
74
85
  h[k.to_sym] = v
75
86
  }
@@ -95,6 +106,10 @@ module BmcApi
95
106
  if attributes.key?(:'status_description')
96
107
  self.status_description = attributes[:'status_description']
97
108
  end
109
+
110
+ if attributes.key?(:'vlan_id')
111
+ self.vlan_id = attributes[:'vlan_id']
112
+ end
98
113
  end
99
114
 
100
115
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -122,6 +137,16 @@ module BmcApi
122
137
  true
123
138
  end
124
139
 
140
+ # Custom attribute writer method with validation
141
+ # @param [Object] id Value to be assigned
142
+ def id=(id)
143
+ if id.nil?
144
+ fail ArgumentError, 'id cannot be nil'
145
+ end
146
+
147
+ @id = id
148
+ end
149
+
125
150
  # Custom attribute writer method with validation
126
151
  # @param [Object] ips Value to be assigned
127
152
  def ips=(ips)
@@ -144,7 +169,8 @@ module BmcApi
144
169
  id == o.id &&
145
170
  ips == o.ips &&
146
171
  dhcp == o.dhcp &&
147
- status_description == o.status_description
172
+ status_description == o.status_description &&
173
+ vlan_id == o.vlan_id
148
174
  end
149
175
 
150
176
  # @see the `==` method
@@ -156,7 +182,7 @@ module BmcApi
156
182
  # Calculates hash code according to all attributes.
157
183
  # @return [Integer] Hash code
158
184
  def hash
159
- [id, ips, dhcp, status_description].hash
185
+ [id, ips, dhcp, status_description, vlan_id].hash
160
186
  end
161
187
 
162
188
  # Builds the object from hash
@@ -182,61 +208,6 @@ module BmcApi
182
208
  new(transformed_hash)
183
209
  end
184
210
 
185
- # Deserializes the data based on type
186
- # @param string type Data type
187
- # @param string value Value to be deserialized
188
- # @return [Object] Deserialized data
189
- def self._deserialize(type, value)
190
- case type.to_sym
191
- when :Time
192
- Time.parse(value)
193
- when :Date
194
- Date.parse(value)
195
- when :String
196
- value.to_s
197
- when :Integer
198
- value.to_i
199
- when :Float
200
- value.to_f
201
- when :Boolean
202
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
203
- true
204
- else
205
- false
206
- end
207
- when :Object
208
- # generic object (usually a Hash), return directly
209
- value
210
- when /\AArray<(?<inner_type>.+)>\z/
211
- inner_type = Regexp.last_match[:inner_type]
212
- value.map { |v| _deserialize(inner_type, v) }
213
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
214
- k_type = Regexp.last_match[:k_type]
215
- v_type = Regexp.last_match[:v_type]
216
- {}.tap do |hash|
217
- value.each do |k, v|
218
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
219
- end
220
- end
221
- else # model
222
- # models (e.g. Pet) or oneOf
223
- klass = BmcApi.const_get(type)
224
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
225
- end
226
- end
227
-
228
- # Returns the string representation of the object
229
- # @return [String] String presentation of the object
230
- def to_s
231
- to_hash.to_s
232
- end
233
-
234
- # to_body is an alias to to_hash (backward compatibility)
235
- # @return [Hash] Returns the object in the form of hash
236
- def to_body
237
- to_hash
238
- end
239
-
240
211
  # Returns the object in the form of hash
241
212
  # @return [Hash] Returns the object in the form of hash
242
213
  def to_hash
@@ -253,24 +224,6 @@ module BmcApi
253
224
  hash
254
225
  end
255
226
 
256
- # Outputs non-array value in the form of hash
257
- # For object, use to_hash. Otherwise, just return the value
258
- # @param [Object] value Any valid value
259
- # @return [Hash] Returns the value in the form of hash
260
- def _to_hash(value)
261
- if value.is_a?(Array)
262
- value.compact.map { |v| _to_hash(v) }
263
- elsif value.is_a?(Hash)
264
- {}.tap do |hash|
265
- value.each { |k, v| hash[k] = _to_hash(v) }
266
- end
267
- elsif value.respond_to? :to_hash
268
- value.to_hash
269
- else
270
- value
271
- end
272
- end
273
-
274
227
  end
275
228
 
276
229
  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
  # Provision bare metal server.
18
- class ServerProvision
18
+ class ServerProvision < ApiModelBase
19
19
  # Hostname of server.
20
20
  attr_accessor :hostname
21
21
 
22
22
  # Description of server.
23
23
  attr_accessor :description
24
24
 
25
- # The server’s OS ID used when the server was created. Currently this field should be set to either `ubuntu/bionic`, `ubuntu/focal`, `ubuntu/jammy`, `ubuntu/jammy+pytorch`, `ubuntu/noble`, `centos/centos7`, `centos/centos8`, `windows/srv2019std`, `windows/srv2019dc`, `windows/srv2022std`, `windows/srv2022dc`, `windows/srv2025std`, `windows/srv2025dc`, `esxi/esxi70`, `esxi/esxi80`, `almalinux/almalinux8`, `almalinux/almalinux9`, `rockylinux/rockylinux8`, `rockylinux/rockylinux9`, `virtuozzo/virtuozzo7`, `oraclelinux/oraclelinux9`, `debian/bullseye`, `debian/bookworm`, `proxmox/bullseye`, `proxmox/proxmox8`, `netris/controller`, `netris/softgate_1g`, `netris/softgate_10g` or `netris/softgate_25g`.
25
+ # The server’s OS ID used when the server was created. Currently this field should be set to either `ubuntu/bionic`, `ubuntu/focal`, `ubuntu/jammy`, `ubuntu/jammy+pytorch`, `ubuntu/noble`, `centos/centos7`, `centos/centos8`, `windows/srv2019std`, `windows/srv2019dc`, `windows/srv2022std`, `windows/srv2022dc`, `windows/srv2025std`, `windows/srv2025dc`, `esxi/esxi70`, `esxi/esxi80`, `almalinux/almalinux8`, `almalinux/almalinux9`, `rockylinux/rockylinux8`, `rockylinux/rockylinux9`, `virtuozzo/virtuozzo7`, `oraclelinux/oraclelinux9`, `debian/bullseye`, `debian/bookworm`, `debian/trixie`, `proxmox/bullseye`, `proxmox/proxmox8`, `proxmox/proxmox9`,`netris/controller`, `netris/softgate_1g`, `netris/softgate_10g` or `netris/softgate_25g`.
26
26
  attr_accessor :os
27
27
 
28
28
  # Whether or not to install SSH keys marked as default in addition to any SSH keys specified in this request.
@@ -63,9 +63,14 @@ module BmcApi
63
63
  }
64
64
  end
65
65
 
66
+ # Returns attribute mapping this model knows about
67
+ def self.acceptable_attribute_map
68
+ attribute_map
69
+ end
70
+
66
71
  # Returns all the JSON keys this model knows about
67
72
  def self.acceptable_attributes
68
- attribute_map.values
73
+ acceptable_attribute_map.values
69
74
  end
70
75
 
71
76
  # Attribute type mapping.
@@ -99,9 +104,10 @@ module BmcApi
99
104
  end
100
105
 
101
106
  # check to see if the attribute exists and convert string to symbol for hash key
107
+ acceptable_attribute_map = self.class.acceptable_attribute_map
102
108
  attributes = attributes.each_with_object({}) { |(k, v), h|
103
- if (!self.class.attribute_map.key?(k.to_sym))
104
- fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::ServerProvision`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
109
+ if (!acceptable_attribute_map.key?(k.to_sym))
110
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::ServerProvision`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
105
111
  end
106
112
  h[k.to_sym] = v
107
113
  }
@@ -179,7 +185,7 @@ module BmcApi
179
185
  end
180
186
 
181
187
  if @hostname.to_s.length < 1
182
- invalid_properties.push('invalid value for "hostname", the character length must be great than or equal to 1.')
188
+ invalid_properties.push('invalid value for "hostname", the character length must be greater than or equal to 1.')
183
189
  end
184
190
 
185
191
  pattern = Regexp.new(/^(?=.*[a-zA-Z])([a-zA-Z0-9().-])+$/)
@@ -223,7 +229,7 @@ module BmcApi
223
229
  end
224
230
 
225
231
  if hostname.to_s.length < 1
226
- fail ArgumentError, 'invalid value for "hostname", the character length must be great than or equal to 1.'
232
+ fail ArgumentError, 'invalid value for "hostname", the character length must be greater than or equal to 1.'
227
233
  end
228
234
 
229
235
  pattern = Regexp.new(/^(?=.*[a-zA-Z])([a-zA-Z0-9().-])+$/)
@@ -248,6 +254,16 @@ module BmcApi
248
254
  @description = description
249
255
  end
250
256
 
257
+ # Custom attribute writer method with validation
258
+ # @param [Object] os Value to be assigned
259
+ def os=(os)
260
+ if os.nil?
261
+ fail ArgumentError, 'os cannot be nil'
262
+ end
263
+
264
+ @os = os
265
+ end
266
+
251
267
  # Checks equality by comparing each attribute.
252
268
  # @param [Object] Object to be compared
253
269
  def ==(o)
@@ -301,61 +317,6 @@ module BmcApi
301
317
  new(transformed_hash)
302
318
  end
303
319
 
304
- # Deserializes the data based on type
305
- # @param string type Data type
306
- # @param string value Value to be deserialized
307
- # @return [Object] Deserialized data
308
- def self._deserialize(type, value)
309
- case type.to_sym
310
- when :Time
311
- Time.parse(value)
312
- when :Date
313
- Date.parse(value)
314
- when :String
315
- value.to_s
316
- when :Integer
317
- value.to_i
318
- when :Float
319
- value.to_f
320
- when :Boolean
321
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
322
- true
323
- else
324
- false
325
- end
326
- when :Object
327
- # generic object (usually a Hash), return directly
328
- value
329
- when /\AArray<(?<inner_type>.+)>\z/
330
- inner_type = Regexp.last_match[:inner_type]
331
- value.map { |v| _deserialize(inner_type, v) }
332
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
333
- k_type = Regexp.last_match[:k_type]
334
- v_type = Regexp.last_match[:v_type]
335
- {}.tap do |hash|
336
- value.each do |k, v|
337
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
338
- end
339
- end
340
- else # model
341
- # models (e.g. Pet) or oneOf
342
- klass = BmcApi.const_get(type)
343
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
344
- end
345
- end
346
-
347
- # Returns the string representation of the object
348
- # @return [String] String presentation of the object
349
- def to_s
350
- to_hash.to_s
351
- end
352
-
353
- # to_body is an alias to to_hash (backward compatibility)
354
- # @return [Hash] Returns the object in the form of hash
355
- def to_body
356
- to_hash
357
- end
358
-
359
320
  # Returns the object in the form of hash
360
321
  # @return [Hash] Returns the object in the form of hash
361
322
  def to_hash
@@ -372,24 +333,6 @@ module BmcApi
372
333
  hash
373
334
  end
374
335
 
375
- # Outputs non-array value in the form of hash
376
- # For object, use to_hash. Otherwise, just return the value
377
- # @param [Object] value Any valid value
378
- # @return [Hash] Returns the value in the form of hash
379
- def _to_hash(value)
380
- if value.is_a?(Array)
381
- value.compact.map { |v| _to_hash(v) }
382
- elsif value.is_a?(Hash)
383
- {}.tap do |hash|
384
- value.each { |k, v| hash[k] = _to_hash(v) }
385
- end
386
- elsif value.respond_to? :to_hash
387
- value.to_hash
388
- else
389
- value
390
- end
391
- end
392
-
393
336
  end
394
337
 
395
338
  end