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
 
@@ -15,11 +15,11 @@ require 'time'
15
15
 
16
16
  module BmcApi
17
17
  # Public network details of bare metal server.
18
- class ServerPublicNetwork
18
+ class ServerPublicNetwork < ApiModelBase
19
19
  # The network identifier.
20
20
  attr_accessor :id
21
21
 
22
- # Configurable/configured IPs on the server.<br> At least 1 IP address is required. Valid IP format is single IP addresses. All IPs must be within the network's range.<br> Setting the `computeSlaacIp` field to `true` allows you to provide an empty array of IPs.<br> Additionally, setting the `force` query parameter to `true` allows you to:<ul> <li> Assign no specific IP addresses by designating an empty array of IPs. Note that at least one IP is required for the gateway address to be selected from this network. <li> Assign one or more IP addresses which are already configured on other resource(s) in network.</ul>
22
+ # Configurable/configured IPs on the server.<br> At least 1 IP address is required. 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 `computeSlaacIp` field to `true` allows you to provide an empty array of IPs.<br> Referencing network as OS native network allows you to provide an empty array of IPs.<br> Additionally, setting the `force` query parameter to `true` allows you to:<ul> <li> Assign no specific IP addresses by designating an empty array of IPs. Note that at least one IP is required for the gateway address to be selected from this network. <li> Assign one or more IP addresses which are already configured on other resource(s) in network.</ul>
23
23
  attr_accessor :ips
24
24
 
25
25
  # (Read-only) The status of the assignment to the network.
@@ -28,19 +28,28 @@ module BmcApi
28
28
  # (Write-only) Requests Stateless Address Autoconfiguration (SLAAC). Applicable for Network which contains IPv6 block(s).
29
29
  attr_accessor :compute_slaac_ip
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
  :'status_description' => :'statusDescription',
37
- :'compute_slaac_ip' => :'computeSlaacIp'
40
+ :'compute_slaac_ip' => :'computeSlaacIp',
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
  :'status_description' => :'String',
52
- :'compute_slaac_ip' => :'Boolean'
61
+ :'compute_slaac_ip' => :'Boolean',
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::ServerPublicNetwork`. 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::ServerPublicNetwork`. 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
  }
@@ -84,6 +95,8 @@ module BmcApi
84
95
  if (value = attributes[:'ips']).is_a?(Array)
85
96
  self.ips = value
86
97
  end
98
+ else
99
+ self.ips = nil
87
100
  end
88
101
 
89
102
  if attributes.key?(:'status_description')
@@ -93,6 +106,10 @@ module BmcApi
93
106
  if attributes.key?(:'compute_slaac_ip')
94
107
  self.compute_slaac_ip = attributes[:'compute_slaac_ip']
95
108
  end
109
+
110
+ if attributes.key?(:'vlan_id')
111
+ self.vlan_id = attributes[:'vlan_id']
112
+ end
96
113
  end
97
114
 
98
115
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -104,6 +121,10 @@ module BmcApi
104
121
  invalid_properties.push('invalid value for "id", id cannot be nil.')
105
122
  end
106
123
 
124
+ if @ips.nil?
125
+ invalid_properties.push('invalid value for "ips", ips cannot be nil.')
126
+ end
127
+
107
128
  invalid_properties
108
129
  end
109
130
 
@@ -112,9 +133,30 @@ module BmcApi
112
133
  def valid?
113
134
  warn '[DEPRECATED] the `valid?` method is obsolete'
114
135
  return false if @id.nil?
136
+ return false if @ips.nil?
115
137
  true
116
138
  end
117
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
+
150
+ # Custom attribute writer method with validation
151
+ # @param [Object] ips Value to be assigned
152
+ def ips=(ips)
153
+ if ips.nil?
154
+ fail ArgumentError, 'ips cannot be nil'
155
+ end
156
+
157
+ @ips = ips
158
+ end
159
+
118
160
  # Checks equality by comparing each attribute.
119
161
  # @param [Object] Object to be compared
120
162
  def ==(o)
@@ -123,7 +165,8 @@ module BmcApi
123
165
  id == o.id &&
124
166
  ips == o.ips &&
125
167
  status_description == o.status_description &&
126
- compute_slaac_ip == o.compute_slaac_ip
168
+ compute_slaac_ip == o.compute_slaac_ip &&
169
+ vlan_id == o.vlan_id
127
170
  end
128
171
 
129
172
  # @see the `==` method
@@ -135,7 +178,7 @@ module BmcApi
135
178
  # Calculates hash code according to all attributes.
136
179
  # @return [Integer] Hash code
137
180
  def hash
138
- [id, ips, status_description, compute_slaac_ip].hash
181
+ [id, ips, status_description, compute_slaac_ip, vlan_id].hash
139
182
  end
140
183
 
141
184
  # Builds the object from hash
@@ -161,61 +204,6 @@ module BmcApi
161
204
  new(transformed_hash)
162
205
  end
163
206
 
164
- # Deserializes the data based on type
165
- # @param string type Data type
166
- # @param string value Value to be deserialized
167
- # @return [Object] Deserialized data
168
- def self._deserialize(type, value)
169
- case type.to_sym
170
- when :Time
171
- Time.parse(value)
172
- when :Date
173
- Date.parse(value)
174
- when :String
175
- value.to_s
176
- when :Integer
177
- value.to_i
178
- when :Float
179
- value.to_f
180
- when :Boolean
181
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
182
- true
183
- else
184
- false
185
- end
186
- when :Object
187
- # generic object (usually a Hash), return directly
188
- value
189
- when /\AArray<(?<inner_type>.+)>\z/
190
- inner_type = Regexp.last_match[:inner_type]
191
- value.map { |v| _deserialize(inner_type, v) }
192
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
193
- k_type = Regexp.last_match[:k_type]
194
- v_type = Regexp.last_match[:v_type]
195
- {}.tap do |hash|
196
- value.each do |k, v|
197
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
198
- end
199
- end
200
- else # model
201
- # models (e.g. Pet) or oneOf
202
- klass = BmcApi.const_get(type)
203
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
204
- end
205
- end
206
-
207
- # Returns the string representation of the object
208
- # @return [String] String presentation of the object
209
- def to_s
210
- to_hash.to_s
211
- end
212
-
213
- # to_body is an alias to to_hash (backward compatibility)
214
- # @return [Hash] Returns the object in the form of hash
215
- def to_body
216
- to_hash
217
- end
218
-
219
207
  # Returns the object in the form of hash
220
208
  # @return [Hash] Returns the object in the form of hash
221
209
  def to_hash
@@ -232,24 +220,6 @@ module BmcApi
232
220
  hash
233
221
  end
234
222
 
235
- # Outputs non-array value in the form of hash
236
- # For object, use to_hash. Otherwise, just return the value
237
- # @param [Object] value Any valid value
238
- # @return [Hash] Returns the value in the form of hash
239
- def _to_hash(value)
240
- if value.is_a?(Array)
241
- value.compact.map { |v| _to_hash(v) }
242
- elsif value.is_a?(Hash)
243
- {}.tap do |hash|
244
- value.each { |k, v| hash[k] = _to_hash(v) }
245
- end
246
- elsif value.respond_to? :to_hash
247
- value.to_hash
248
- else
249
- value
250
- end
251
- end
252
-
253
223
  end
254
224
 
255
225
  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
  # Bare metal server reservation.
18
- class ServerReserve
18
+ class ServerReserve < ApiModelBase
19
19
  # Server pricing model. Currently this field should be set to `ONE_MONTH_RESERVATION`, `TWELVE_MONTHS_RESERVATION`, `TWENTY_FOUR_MONTHS_RESERVATION` or `THIRTY_SIX_MONTHS_RESERVATION`.
20
20
  attr_accessor :pricing_model
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::ServerReserve`. 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::ServerReserve`. 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
  }
@@ -86,6 +92,16 @@ module BmcApi
86
92
  true
87
93
  end
88
94
 
95
+ # Custom attribute writer method with validation
96
+ # @param [Object] pricing_model Value to be assigned
97
+ def pricing_model=(pricing_model)
98
+ if pricing_model.nil?
99
+ fail ArgumentError, 'pricing_model cannot be nil'
100
+ end
101
+
102
+ @pricing_model = pricing_model
103
+ end
104
+
89
105
  # Checks equality by comparing each attribute.
90
106
  # @param [Object] Object to be compared
91
107
  def ==(o)
@@ -129,61 +145,6 @@ module BmcApi
129
145
  new(transformed_hash)
130
146
  end
131
147
 
132
- # Deserializes the data based on type
133
- # @param string type Data type
134
- # @param string value Value to be deserialized
135
- # @return [Object] Deserialized data
136
- def self._deserialize(type, value)
137
- case type.to_sym
138
- when :Time
139
- Time.parse(value)
140
- when :Date
141
- Date.parse(value)
142
- when :String
143
- value.to_s
144
- when :Integer
145
- value.to_i
146
- when :Float
147
- value.to_f
148
- when :Boolean
149
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
150
- true
151
- else
152
- false
153
- end
154
- when :Object
155
- # generic object (usually a Hash), return directly
156
- value
157
- when /\AArray<(?<inner_type>.+)>\z/
158
- inner_type = Regexp.last_match[:inner_type]
159
- value.map { |v| _deserialize(inner_type, v) }
160
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
161
- k_type = Regexp.last_match[:k_type]
162
- v_type = Regexp.last_match[:v_type]
163
- {}.tap do |hash|
164
- value.each do |k, v|
165
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
166
- end
167
- end
168
- else # model
169
- # models (e.g. Pet) or oneOf
170
- klass = BmcApi.const_get(type)
171
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
172
- end
173
- end
174
-
175
- # Returns the string representation of the object
176
- # @return [String] String presentation of the object
177
- def to_s
178
- to_hash.to_s
179
- end
180
-
181
- # to_body is an alias to to_hash (backward compatibility)
182
- # @return [Hash] Returns the object in the form of hash
183
- def to_body
184
- to_hash
185
- end
186
-
187
148
  # Returns the object in the form of hash
188
149
  # @return [Hash] Returns the object in the form of hash
189
150
  def to_hash
@@ -200,24 +161,6 @@ module BmcApi
200
161
  hash
201
162
  end
202
163
 
203
- # Outputs non-array value in the form of hash
204
- # For object, use to_hash. Otherwise, just return the value
205
- # @param [Object] value Any valid value
206
- # @return [Hash] Returns the value in the form of hash
207
- def _to_hash(value)
208
- if value.is_a?(Array)
209
- value.compact.map { |v| _to_hash(v) }
210
- elsif value.is_a?(Hash)
211
- {}.tap do |hash|
212
- value.each { |k, v| hash[k] = _to_hash(v) }
213
- end
214
- elsif value.respond_to? :to_hash
215
- value.to_hash
216
- else
217
- value
218
- end
219
- end
220
-
221
164
  end
222
165
 
223
166
  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
  # Reset bare metal server.
18
- class ServerReset
18
+ class ServerReset < ApiModelBase
19
19
  # Whether or not to install SSH keys marked as default in addition to any SSH keys specified in this request.
20
20
  attr_accessor :install_default_ssh_keys
21
21
 
@@ -37,9 +37,14 @@ module BmcApi
37
37
  }
38
38
  end
39
39
 
40
+ # Returns attribute mapping this model knows about
41
+ def self.acceptable_attribute_map
42
+ attribute_map
43
+ end
44
+
40
45
  # Returns all the JSON keys this model knows about
41
46
  def self.acceptable_attributes
42
- attribute_map.values
47
+ acceptable_attribute_map.values
43
48
  end
44
49
 
45
50
  # Attribute type mapping.
@@ -66,9 +71,10 @@ module BmcApi
66
71
  end
67
72
 
68
73
  # check to see if the attribute exists and convert string to symbol for hash key
74
+ acceptable_attribute_map = self.class.acceptable_attribute_map
69
75
  attributes = attributes.each_with_object({}) { |(k, v), h|
70
- if (!self.class.attribute_map.key?(k.to_sym))
71
- fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::ServerReset`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
76
+ if (!acceptable_attribute_map.key?(k.to_sym))
77
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::ServerReset`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
72
78
  end
73
79
  h[k.to_sym] = v
74
80
  }
@@ -157,61 +163,6 @@ module BmcApi
157
163
  new(transformed_hash)
158
164
  end
159
165
 
160
- # Deserializes the data based on type
161
- # @param string type Data type
162
- # @param string value Value to be deserialized
163
- # @return [Object] Deserialized data
164
- def self._deserialize(type, value)
165
- case type.to_sym
166
- when :Time
167
- Time.parse(value)
168
- when :Date
169
- Date.parse(value)
170
- when :String
171
- value.to_s
172
- when :Integer
173
- value.to_i
174
- when :Float
175
- value.to_f
176
- when :Boolean
177
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
178
- true
179
- else
180
- false
181
- end
182
- when :Object
183
- # generic object (usually a Hash), return directly
184
- value
185
- when /\AArray<(?<inner_type>.+)>\z/
186
- inner_type = Regexp.last_match[:inner_type]
187
- value.map { |v| _deserialize(inner_type, v) }
188
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
189
- k_type = Regexp.last_match[:k_type]
190
- v_type = Regexp.last_match[:v_type]
191
- {}.tap do |hash|
192
- value.each do |k, v|
193
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
194
- end
195
- end
196
- else # model
197
- # models (e.g. Pet) or oneOf
198
- klass = BmcApi.const_get(type)
199
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
200
- end
201
- end
202
-
203
- # Returns the string representation of the object
204
- # @return [String] String presentation of the object
205
- def to_s
206
- to_hash.to_s
207
- end
208
-
209
- # to_body is an alias to to_hash (backward compatibility)
210
- # @return [Hash] Returns the object in the form of hash
211
- def to_body
212
- to_hash
213
- end
214
-
215
166
  # Returns the object in the form of hash
216
167
  # @return [Hash] Returns the object in the form of hash
217
168
  def to_hash
@@ -228,24 +179,6 @@ module BmcApi
228
179
  hash
229
180
  end
230
181
 
231
- # Outputs non-array value in the form of hash
232
- # For object, use to_hash. Otherwise, just return the value
233
- # @param [Object] value Any valid value
234
- # @return [Hash] Returns the value in the form of hash
235
- def _to_hash(value)
236
- if value.is_a?(Array)
237
- value.compact.map { |v| _to_hash(v) }
238
- elsif value.is_a?(Hash)
239
- {}.tap do |hash|
240
- value.each { |k, v| hash[k] = _to_hash(v) }
241
- end
242
- elsif value.respond_to? :to_hash
243
- value.to_hash
244
- else
245
- value
246
- end
247
- end
248
-
249
182
  end
250
183
 
251
184
  end