pnap_bmc_api 2.2.2 → 2.4.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 (125) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +6 -0
  3. data/VERSION +1 -1
  4. data/docs/IpBlocksConfiguration.md +1 -1
  5. data/docs/OsConfiguration.md +3 -1
  6. data/docs/OsConfigurationCloudInit.md +1 -1
  7. data/docs/OsConfigurationIPXE.md +20 -0
  8. data/docs/OsConfigurationIPXENativeVlanConfiguration.md +22 -0
  9. data/docs/OsConfigurationWindows.md +3 -1
  10. data/docs/PrivateNetworkConfiguration.md +1 -1
  11. data/docs/PublicNetworkConfiguration.md +1 -1
  12. data/docs/RebootRequest.md +20 -0
  13. data/docs/ReservationTransferDetails.md +18 -0
  14. data/docs/Server.md +4 -4
  15. data/docs/ServerCreate.md +3 -3
  16. data/docs/ServerNetworkUpdate.md +1 -1
  17. data/docs/ServerPrivateNetwork.md +3 -1
  18. data/docs/ServerProvision.md +1 -1
  19. data/docs/ServerPublicNetwork.md +5 -3
  20. data/docs/ServersApi.md +157 -7
  21. data/lib/pnap_bmc_api/api/quotas_api.rb +4 -4
  22. data/lib/pnap_bmc_api/api/servers_api.rb +182 -24
  23. data/lib/pnap_bmc_api/api/ssh_keys_api.rb +6 -6
  24. data/lib/pnap_bmc_api/api_client.rb +17 -14
  25. data/lib/pnap_bmc_api/api_error.rb +1 -1
  26. data/lib/pnap_bmc_api/api_model_base.rb +88 -0
  27. data/lib/pnap_bmc_api/configuration.rb +11 -1
  28. data/lib/pnap_bmc_api/models/action_result.rb +21 -78
  29. data/lib/pnap_bmc_api/models/delete_result.rb +31 -78
  30. data/lib/pnap_bmc_api/models/delete_ssh_key_result.rb +31 -78
  31. data/lib/pnap_bmc_api/models/error.rb +21 -78
  32. data/lib/pnap_bmc_api/models/esxi_datastore_configuration.rb +13 -80
  33. data/lib/pnap_bmc_api/models/esxi_os_configuration.rb +11 -78
  34. data/lib/pnap_bmc_api/models/gpu_configuration.rb +11 -78
  35. data/lib/pnap_bmc_api/models/ip_blocks_configuration.rb +12 -79
  36. data/lib/pnap_bmc_api/models/network_configuration.rb +11 -78
  37. data/lib/pnap_bmc_api/models/os_configuration.rb +24 -82
  38. data/lib/pnap_bmc_api/models/os_configuration_cloud_init.rb +11 -78
  39. data/lib/pnap_bmc_api/models/os_configuration_ipxe.rb +186 -0
  40. data/lib/pnap_bmc_api/models/os_configuration_ipxe_native_vlan_configuration.rb +224 -0
  41. data/lib/pnap_bmc_api/models/os_configuration_map.rb +11 -78
  42. data/lib/pnap_bmc_api/models/os_configuration_map_esxi.rb +11 -78
  43. data/lib/pnap_bmc_api/models/os_configuration_map_proxmox.rb +11 -78
  44. data/lib/pnap_bmc_api/models/os_configuration_netris_controller.rb +11 -78
  45. data/lib/pnap_bmc_api/models/os_configuration_netris_softgate.rb +11 -78
  46. data/lib/pnap_bmc_api/models/os_configuration_windows.rb +27 -82
  47. data/lib/pnap_bmc_api/models/private_network_configuration.rb +12 -79
  48. data/lib/pnap_bmc_api/models/public_network_configuration.rb +12 -79
  49. data/lib/pnap_bmc_api/models/quota.rb +61 -78
  50. data/lib/pnap_bmc_api/models/quota_edit_limit_request.rb +14 -81
  51. data/lib/pnap_bmc_api/models/quota_edit_limit_request_details.rb +25 -86
  52. data/lib/pnap_bmc_api/models/reboot_request.rb +212 -0
  53. data/lib/pnap_bmc_api/models/relinquish_ip_block.rb +11 -78
  54. data/lib/pnap_bmc_api/models/reservation_transfer_details.rb +166 -0
  55. data/lib/pnap_bmc_api/models/reset_result.rb +21 -78
  56. data/lib/pnap_bmc_api/models/server.rb +117 -84
  57. data/lib/pnap_bmc_api/models/server_create.rb +46 -83
  58. data/lib/pnap_bmc_api/models/server_ip_block.rb +21 -78
  59. data/lib/pnap_bmc_api/models/server_network_update.rb +12 -79
  60. data/lib/pnap_bmc_api/models/server_patch.rb +13 -80
  61. data/lib/pnap_bmc_api/models/server_private_network.rb +35 -82
  62. data/lib/pnap_bmc_api/models/server_provision.rb +24 -81
  63. data/lib/pnap_bmc_api/models/server_public_network.rb +53 -83
  64. data/lib/pnap_bmc_api/models/server_reserve.rb +21 -78
  65. data/lib/pnap_bmc_api/models/server_reset.rb +11 -78
  66. data/lib/pnap_bmc_api/models/ssh_key.rb +81 -78
  67. data/lib/pnap_bmc_api/models/ssh_key_create.rb +23 -80
  68. data/lib/pnap_bmc_api/models/ssh_key_update.rb +23 -80
  69. data/lib/pnap_bmc_api/models/storage_configuration.rb +11 -78
  70. data/lib/pnap_bmc_api/models/storage_configuration_root_partition.rb +11 -78
  71. data/lib/pnap_bmc_api/models/tag_assignment.rb +41 -78
  72. data/lib/pnap_bmc_api/models/tag_assignment_request.rb +21 -78
  73. data/lib/pnap_bmc_api/version.rb +1 -2
  74. data/lib/pnap_bmc_api.rb +6 -1
  75. data/pnap_bmc_api.gemspec +6 -6
  76. data/spec/api/quotas_api_spec.rb +1 -1
  77. data/spec/api/servers_api_spec.rb +29 -1
  78. data/spec/api/ssh_keys_api_spec.rb +1 -1
  79. data/spec/models/action_result_spec.rb +2 -2
  80. data/spec/models/delete_result_spec.rb +2 -2
  81. data/spec/models/delete_ssh_key_result_spec.rb +2 -2
  82. data/spec/models/error_spec.rb +2 -2
  83. data/spec/models/esxi_datastore_configuration_spec.rb +2 -2
  84. data/spec/models/esxi_os_configuration_spec.rb +2 -2
  85. data/spec/models/gpu_configuration_spec.rb +2 -2
  86. data/spec/models/ip_blocks_configuration_spec.rb +2 -2
  87. data/spec/models/network_configuration_spec.rb +2 -2
  88. data/spec/models/os_configuration_cloud_init_spec.rb +2 -2
  89. data/spec/models/os_configuration_ipxe_native_vlan_configuration_spec.rb +52 -0
  90. data/spec/models/os_configuration_ipxe_spec.rb +42 -0
  91. data/spec/models/os_configuration_map_esxi_spec.rb +2 -2
  92. data/spec/models/os_configuration_map_proxmox_spec.rb +2 -2
  93. data/spec/models/os_configuration_map_spec.rb +2 -2
  94. data/spec/models/os_configuration_netris_controller_spec.rb +2 -2
  95. data/spec/models/os_configuration_netris_softgate_spec.rb +2 -2
  96. data/spec/models/os_configuration_spec.rb +8 -2
  97. data/spec/models/os_configuration_windows_spec.rb +8 -2
  98. data/spec/models/private_network_configuration_spec.rb +2 -2
  99. data/spec/models/public_network_configuration_spec.rb +2 -2
  100. data/spec/models/quota_edit_limit_request_details_spec.rb +2 -2
  101. data/spec/models/quota_edit_limit_request_spec.rb +2 -2
  102. data/spec/models/quota_spec.rb +2 -2
  103. data/spec/models/reboot_request_spec.rb +46 -0
  104. data/spec/models/relinquish_ip_block_spec.rb +2 -2
  105. data/spec/models/reservation_transfer_details_spec.rb +36 -0
  106. data/spec/models/reset_result_spec.rb +2 -2
  107. data/spec/models/server_create_spec.rb +2 -2
  108. data/spec/models/server_ip_block_spec.rb +2 -2
  109. data/spec/models/server_network_update_spec.rb +2 -2
  110. data/spec/models/server_patch_spec.rb +2 -2
  111. data/spec/models/server_private_network_spec.rb +8 -2
  112. data/spec/models/server_provision_spec.rb +2 -2
  113. data/spec/models/server_public_network_spec.rb +8 -2
  114. data/spec/models/server_reserve_spec.rb +2 -2
  115. data/spec/models/server_reset_spec.rb +2 -2
  116. data/spec/models/server_spec.rb +2 -2
  117. data/spec/models/ssh_key_create_spec.rb +2 -2
  118. data/spec/models/ssh_key_spec.rb +2 -2
  119. data/spec/models/ssh_key_update_spec.rb +2 -2
  120. data/spec/models/storage_configuration_root_partition_spec.rb +2 -2
  121. data/spec/models/storage_configuration_spec.rb +2 -2
  122. data/spec/models/tag_assignment_request_spec.rb +2 -2
  123. data/spec/models/tag_assignment_spec.rb +2 -2
  124. data/spec/spec_helper.rb +1 -1
  125. metadata +60 -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
 
@@ -14,7 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module BmcApi
17
- class Error
17
+ class Error < ApiModelBase
18
18
  # The description detailing the cause of the error code.
19
19
  attr_accessor :message
20
20
 
@@ -29,9 +29,14 @@ module BmcApi
29
29
  }
30
30
  end
31
31
 
32
+ # Returns attribute mapping this model knows about
33
+ def self.acceptable_attribute_map
34
+ attribute_map
35
+ end
36
+
32
37
  # Returns all the JSON keys this model knows about
33
38
  def self.acceptable_attributes
34
- attribute_map.values
39
+ acceptable_attribute_map.values
35
40
  end
36
41
 
37
42
  # Attribute type mapping.
@@ -56,9 +61,10 @@ module BmcApi
56
61
  end
57
62
 
58
63
  # check to see if the attribute exists and convert string to symbol for hash key
64
+ acceptable_attribute_map = self.class.acceptable_attribute_map
59
65
  attributes = attributes.each_with_object({}) { |(k, v), h|
60
- if (!self.class.attribute_map.key?(k.to_sym))
61
- fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::Error`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
66
+ if (!acceptable_attribute_map.key?(k.to_sym))
67
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::Error`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
62
68
  end
63
69
  h[k.to_sym] = v
64
70
  }
@@ -96,6 +102,16 @@ module BmcApi
96
102
  true
97
103
  end
98
104
 
105
+ # Custom attribute writer method with validation
106
+ # @param [Object] message Value to be assigned
107
+ def message=(message)
108
+ if message.nil?
109
+ fail ArgumentError, 'message cannot be nil'
110
+ end
111
+
112
+ @message = message
113
+ end
114
+
99
115
  # Checks equality by comparing each attribute.
100
116
  # @param [Object] Object to be compared
101
117
  def ==(o)
@@ -140,61 +156,6 @@ module BmcApi
140
156
  new(transformed_hash)
141
157
  end
142
158
 
143
- # Deserializes the data based on type
144
- # @param string type Data type
145
- # @param string value Value to be deserialized
146
- # @return [Object] Deserialized data
147
- def self._deserialize(type, value)
148
- case type.to_sym
149
- when :Time
150
- Time.parse(value)
151
- when :Date
152
- Date.parse(value)
153
- when :String
154
- value.to_s
155
- when :Integer
156
- value.to_i
157
- when :Float
158
- value.to_f
159
- when :Boolean
160
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
161
- true
162
- else
163
- false
164
- end
165
- when :Object
166
- # generic object (usually a Hash), return directly
167
- value
168
- when /\AArray<(?<inner_type>.+)>\z/
169
- inner_type = Regexp.last_match[:inner_type]
170
- value.map { |v| _deserialize(inner_type, v) }
171
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
172
- k_type = Regexp.last_match[:k_type]
173
- v_type = Regexp.last_match[:v_type]
174
- {}.tap do |hash|
175
- value.each do |k, v|
176
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
177
- end
178
- end
179
- else # model
180
- # models (e.g. Pet) or oneOf
181
- klass = BmcApi.const_get(type)
182
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
183
- end
184
- end
185
-
186
- # Returns the string representation of the object
187
- # @return [String] String presentation of the object
188
- def to_s
189
- to_hash.to_s
190
- end
191
-
192
- # to_body is an alias to to_hash (backward compatibility)
193
- # @return [Hash] Returns the object in the form of hash
194
- def to_body
195
- to_hash
196
- end
197
-
198
159
  # Returns the object in the form of hash
199
160
  # @return [Hash] Returns the object in the form of hash
200
161
  def to_hash
@@ -211,24 +172,6 @@ module BmcApi
211
172
  hash
212
173
  end
213
174
 
214
- # Outputs non-array value in the form of hash
215
- # For object, use to_hash. Otherwise, just return the value
216
- # @param [Object] value Any valid value
217
- # @return [Hash] Returns the value in the form of hash
218
- def _to_hash(value)
219
- if value.is_a?(Array)
220
- value.compact.map { |v| _to_hash(v) }
221
- elsif value.is_a?(Hash)
222
- {}.tap do |hash|
223
- value.each { |k, v| hash[k] = _to_hash(v) }
224
- end
225
- elsif value.respond_to? :to_hash
226
- value.to_hash
227
- else
228
- value
229
- end
230
- end
231
-
232
175
  end
233
176
 
234
177
  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
  # Esxi data storage configuration.
18
- class EsxiDatastoreConfiguration
18
+ class EsxiDatastoreConfiguration < ApiModelBase
19
19
  # Datastore name
20
20
  attr_accessor :datastore_name
21
21
 
@@ -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::EsxiDatastoreConfiguration`. 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::EsxiDatastoreConfiguration`. 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
  }
@@ -80,7 +86,7 @@ module BmcApi
80
86
  end
81
87
 
82
88
  if @datastore_name.to_s.length < 1
83
- invalid_properties.push('invalid value for "datastore_name", the character length must be great than or equal to 1.')
89
+ invalid_properties.push('invalid value for "datastore_name", the character length must be greater than or equal to 1.')
84
90
  end
85
91
 
86
92
  pattern = Regexp.new(/^[a-zA-Z0-9]+$/)
@@ -114,7 +120,7 @@ module BmcApi
114
120
  end
115
121
 
116
122
  if datastore_name.to_s.length < 1
117
- fail ArgumentError, 'invalid value for "datastore_name", the character length must be great than or equal to 1.'
123
+ fail ArgumentError, 'invalid value for "datastore_name", the character length must be greater than or equal to 1.'
118
124
  end
119
125
 
120
126
  pattern = Regexp.new(/^[a-zA-Z0-9]+$/)
@@ -168,61 +174,6 @@ module BmcApi
168
174
  new(transformed_hash)
169
175
  end
170
176
 
171
- # Deserializes the data based on type
172
- # @param string type Data type
173
- # @param string value Value to be deserialized
174
- # @return [Object] Deserialized data
175
- def self._deserialize(type, value)
176
- case type.to_sym
177
- when :Time
178
- Time.parse(value)
179
- when :Date
180
- Date.parse(value)
181
- when :String
182
- value.to_s
183
- when :Integer
184
- value.to_i
185
- when :Float
186
- value.to_f
187
- when :Boolean
188
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
189
- true
190
- else
191
- false
192
- end
193
- when :Object
194
- # generic object (usually a Hash), return directly
195
- value
196
- when /\AArray<(?<inner_type>.+)>\z/
197
- inner_type = Regexp.last_match[:inner_type]
198
- value.map { |v| _deserialize(inner_type, v) }
199
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
200
- k_type = Regexp.last_match[:k_type]
201
- v_type = Regexp.last_match[:v_type]
202
- {}.tap do |hash|
203
- value.each do |k, v|
204
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
205
- end
206
- end
207
- else # model
208
- # models (e.g. Pet) or oneOf
209
- klass = BmcApi.const_get(type)
210
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
211
- end
212
- end
213
-
214
- # Returns the string representation of the object
215
- # @return [String] String presentation of the object
216
- def to_s
217
- to_hash.to_s
218
- end
219
-
220
- # to_body is an alias to to_hash (backward compatibility)
221
- # @return [Hash] Returns the object in the form of hash
222
- def to_body
223
- to_hash
224
- end
225
-
226
177
  # Returns the object in the form of hash
227
178
  # @return [Hash] Returns the object in the form of hash
228
179
  def to_hash
@@ -239,24 +190,6 @@ module BmcApi
239
190
  hash
240
191
  end
241
192
 
242
- # Outputs non-array value in the form of hash
243
- # For object, use to_hash. Otherwise, just return the value
244
- # @param [Object] value Any valid value
245
- # @return [Hash] Returns the value in the form of hash
246
- def _to_hash(value)
247
- if value.is_a?(Array)
248
- value.compact.map { |v| _to_hash(v) }
249
- elsif value.is_a?(Hash)
250
- {}.tap do |hash|
251
- value.each { |k, v| hash[k] = _to_hash(v) }
252
- end
253
- elsif value.respond_to? :to_hash
254
- value.to_hash
255
- else
256
- value
257
- end
258
- end
259
-
260
193
  end
261
194
 
262
195
  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
  # Esxi OS configuration.
18
- class EsxiOsConfiguration
18
+ class EsxiOsConfiguration < ApiModelBase
19
19
  attr_accessor :datastore_configuration
20
20
 
21
21
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -25,9 +25,14 @@ module BmcApi
25
25
  }
26
26
  end
27
27
 
28
+ # Returns attribute mapping this model knows about
29
+ def self.acceptable_attribute_map
30
+ attribute_map
31
+ end
32
+
28
33
  # Returns all the JSON keys this model knows about
29
34
  def self.acceptable_attributes
30
- attribute_map.values
35
+ acceptable_attribute_map.values
31
36
  end
32
37
 
33
38
  # Attribute type mapping.
@@ -51,9 +56,10 @@ module BmcApi
51
56
  end
52
57
 
53
58
  # check to see if the attribute exists and convert string to symbol for hash key
59
+ acceptable_attribute_map = self.class.acceptable_attribute_map
54
60
  attributes = attributes.each_with_object({}) { |(k, v), h|
55
- if (!self.class.attribute_map.key?(k.to_sym))
56
- fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::EsxiOsConfiguration`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
61
+ if (!acceptable_attribute_map.key?(k.to_sym))
62
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::EsxiOsConfiguration`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
57
63
  end
58
64
  h[k.to_sym] = v
59
65
  }
@@ -121,61 +127,6 @@ module BmcApi
121
127
  new(transformed_hash)
122
128
  end
123
129
 
124
- # Deserializes the data based on type
125
- # @param string type Data type
126
- # @param string value Value to be deserialized
127
- # @return [Object] Deserialized data
128
- def self._deserialize(type, value)
129
- case type.to_sym
130
- when :Time
131
- Time.parse(value)
132
- when :Date
133
- Date.parse(value)
134
- when :String
135
- value.to_s
136
- when :Integer
137
- value.to_i
138
- when :Float
139
- value.to_f
140
- when :Boolean
141
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
142
- true
143
- else
144
- false
145
- end
146
- when :Object
147
- # generic object (usually a Hash), return directly
148
- value
149
- when /\AArray<(?<inner_type>.+)>\z/
150
- inner_type = Regexp.last_match[:inner_type]
151
- value.map { |v| _deserialize(inner_type, v) }
152
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
153
- k_type = Regexp.last_match[:k_type]
154
- v_type = Regexp.last_match[:v_type]
155
- {}.tap do |hash|
156
- value.each do |k, v|
157
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
158
- end
159
- end
160
- else # model
161
- # models (e.g. Pet) or oneOf
162
- klass = BmcApi.const_get(type)
163
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
164
- end
165
- end
166
-
167
- # Returns the string representation of the object
168
- # @return [String] String presentation of the object
169
- def to_s
170
- to_hash.to_s
171
- end
172
-
173
- # to_body is an alias to to_hash (backward compatibility)
174
- # @return [Hash] Returns the object in the form of hash
175
- def to_body
176
- to_hash
177
- end
178
-
179
130
  # Returns the object in the form of hash
180
131
  # @return [Hash] Returns the object in the form of hash
181
132
  def to_hash
@@ -192,24 +143,6 @@ module BmcApi
192
143
  hash
193
144
  end
194
145
 
195
- # Outputs non-array value in the form of hash
196
- # For object, use to_hash. Otherwise, just return the value
197
- # @param [Object] value Any valid value
198
- # @return [Hash] Returns the value in the form of hash
199
- def _to_hash(value)
200
- if value.is_a?(Array)
201
- value.compact.map { |v| _to_hash(v) }
202
- elsif value.is_a?(Hash)
203
- {}.tap do |hash|
204
- value.each { |k, v| hash[k] = _to_hash(v) }
205
- end
206
- elsif value.respond_to? :to_hash
207
- value.to_hash
208
- else
209
- value
210
- end
211
- end
212
-
213
146
  end
214
147
 
215
148
  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
  # The GPU configuration.
18
- class GpuConfiguration
18
+ class GpuConfiguration < ApiModelBase
19
19
  # The long name of the GPU.
20
20
  attr_accessor :long_name
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::GpuConfiguration`. 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::GpuConfiguration`. 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
  }
@@ -132,61 +138,6 @@ module BmcApi
132
138
  new(transformed_hash)
133
139
  end
134
140
 
135
- # Deserializes the data based on type
136
- # @param string type Data type
137
- # @param string value Value to be deserialized
138
- # @return [Object] Deserialized data
139
- def self._deserialize(type, value)
140
- case type.to_sym
141
- when :Time
142
- Time.parse(value)
143
- when :Date
144
- Date.parse(value)
145
- when :String
146
- value.to_s
147
- when :Integer
148
- value.to_i
149
- when :Float
150
- value.to_f
151
- when :Boolean
152
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
153
- true
154
- else
155
- false
156
- end
157
- when :Object
158
- # generic object (usually a Hash), return directly
159
- value
160
- when /\AArray<(?<inner_type>.+)>\z/
161
- inner_type = Regexp.last_match[:inner_type]
162
- value.map { |v| _deserialize(inner_type, v) }
163
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
164
- k_type = Regexp.last_match[:k_type]
165
- v_type = Regexp.last_match[:v_type]
166
- {}.tap do |hash|
167
- value.each do |k, v|
168
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
169
- end
170
- end
171
- else # model
172
- # models (e.g. Pet) or oneOf
173
- klass = BmcApi.const_get(type)
174
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
175
- end
176
- end
177
-
178
- # Returns the string representation of the object
179
- # @return [String] String presentation of the object
180
- def to_s
181
- to_hash.to_s
182
- end
183
-
184
- # to_body is an alias to to_hash (backward compatibility)
185
- # @return [Hash] Returns the object in the form of hash
186
- def to_body
187
- to_hash
188
- end
189
-
190
141
  # Returns the object in the form of hash
191
142
  # @return [Hash] Returns the object in the form of hash
192
143
  def to_hash
@@ -203,24 +154,6 @@ module BmcApi
203
154
  hash
204
155
  end
205
156
 
206
- # Outputs non-array value in the form of hash
207
- # For object, use to_hash. Otherwise, just return the value
208
- # @param [Object] value Any valid value
209
- # @return [Hash] Returns the value in the form of hash
210
- def _to_hash(value)
211
- if value.is_a?(Array)
212
- value.compact.map { |v| _to_hash(v) }
213
- elsif value.is_a?(Hash)
214
- {}.tap do |hash|
215
- value.each { |k, v| hash[k] = _to_hash(v) }
216
- end
217
- elsif value.respond_to? :to_hash
218
- value.to_hash
219
- else
220
- value
221
- end
222
- end
223
-
224
157
  end
225
158
 
226
159
  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,11 +15,11 @@ require 'time'
15
15
 
16
16
  module BmcApi
17
17
  # The IP blocks to assign to this server. <b>This is an exclusive allocation</b>, i.e. the IP blocks cannot be shared with other servers. If IpBlocksConfiguration is not defined, the purchase of a new IP block is determined by the networkType field.
18
- class IpBlocksConfiguration
18
+ class IpBlocksConfiguration < ApiModelBase
19
19
  # (Write-only) Determines the approach for configuring IP blocks for the server being provisioned. If PURCHASE_NEW is selected, the smallest supported range, depending on the operating system, is allocated to the server.
20
20
  attr_accessor :configuration_type
21
21
 
22
- # Used to specify the previously purchased IP blocks to assign to this server upon provisioning. Used alongside the USER_DEFINED configurationType.
22
+ # Used for specifying the previously purchased IPv4 blocks to assign to this server upon provisioning. Used alongside the USER_DEFINED configurationType.
23
23
  attr_accessor :ip_blocks
24
24
 
25
25
  class EnumAttributeValidator
@@ -52,9 +52,14 @@ module BmcApi
52
52
  }
53
53
  end
54
54
 
55
+ # Returns attribute mapping this model knows about
56
+ def self.acceptable_attribute_map
57
+ attribute_map
58
+ end
59
+
55
60
  # Returns all the JSON keys this model knows about
56
61
  def self.acceptable_attributes
57
- attribute_map.values
62
+ acceptable_attribute_map.values
58
63
  end
59
64
 
60
65
  # Attribute type mapping.
@@ -79,9 +84,10 @@ module BmcApi
79
84
  end
80
85
 
81
86
  # check to see if the attribute exists and convert string to symbol for hash key
87
+ acceptable_attribute_map = self.class.acceptable_attribute_map
82
88
  attributes = attributes.each_with_object({}) { |(k, v), h|
83
- if (!self.class.attribute_map.key?(k.to_sym))
84
- fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::IpBlocksConfiguration`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
89
+ if (!acceptable_attribute_map.key?(k.to_sym))
90
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::IpBlocksConfiguration`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
85
91
  end
86
92
  h[k.to_sym] = v
87
93
  }
@@ -189,61 +195,6 @@ module BmcApi
189
195
  new(transformed_hash)
190
196
  end
191
197
 
192
- # Deserializes the data based on type
193
- # @param string type Data type
194
- # @param string value Value to be deserialized
195
- # @return [Object] Deserialized data
196
- def self._deserialize(type, value)
197
- case type.to_sym
198
- when :Time
199
- Time.parse(value)
200
- when :Date
201
- Date.parse(value)
202
- when :String
203
- value.to_s
204
- when :Integer
205
- value.to_i
206
- when :Float
207
- value.to_f
208
- when :Boolean
209
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
210
- true
211
- else
212
- false
213
- end
214
- when :Object
215
- # generic object (usually a Hash), return directly
216
- value
217
- when /\AArray<(?<inner_type>.+)>\z/
218
- inner_type = Regexp.last_match[:inner_type]
219
- value.map { |v| _deserialize(inner_type, v) }
220
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
221
- k_type = Regexp.last_match[:k_type]
222
- v_type = Regexp.last_match[:v_type]
223
- {}.tap do |hash|
224
- value.each do |k, v|
225
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
226
- end
227
- end
228
- else # model
229
- # models (e.g. Pet) or oneOf
230
- klass = BmcApi.const_get(type)
231
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
232
- end
233
- end
234
-
235
- # Returns the string representation of the object
236
- # @return [String] String presentation of the object
237
- def to_s
238
- to_hash.to_s
239
- end
240
-
241
- # to_body is an alias to to_hash (backward compatibility)
242
- # @return [Hash] Returns the object in the form of hash
243
- def to_body
244
- to_hash
245
- end
246
-
247
198
  # Returns the object in the form of hash
248
199
  # @return [Hash] Returns the object in the form of hash
249
200
  def to_hash
@@ -260,24 +211,6 @@ module BmcApi
260
211
  hash
261
212
  end
262
213
 
263
- # Outputs non-array value in the form of hash
264
- # For object, use to_hash. Otherwise, just return the value
265
- # @param [Object] value Any valid value
266
- # @return [Hash] Returns the value in the form of hash
267
- def _to_hash(value)
268
- if value.is_a?(Array)
269
- value.compact.map { |v| _to_hash(v) }
270
- elsif value.is_a?(Hash)
271
- {}.tap do |hash|
272
- value.each { |k, v| hash[k] = _to_hash(v) }
273
- end
274
- elsif value.respond_to? :to_hash
275
- value.to_hash
276
- else
277
- value
278
- end
279
- end
280
-
281
214
  end
282
215
 
283
216
  end