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,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> 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
  }
@@ -93,6 +104,10 @@ module BmcApi
93
104
  if attributes.key?(:'compute_slaac_ip')
94
105
  self.compute_slaac_ip = attributes[:'compute_slaac_ip']
95
106
  end
107
+
108
+ if attributes.key?(:'vlan_id')
109
+ self.vlan_id = attributes[:'vlan_id']
110
+ end
96
111
  end
97
112
 
98
113
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -115,6 +130,16 @@ module BmcApi
115
130
  true
116
131
  end
117
132
 
133
+ # Custom attribute writer method with validation
134
+ # @param [Object] id Value to be assigned
135
+ def id=(id)
136
+ if id.nil?
137
+ fail ArgumentError, 'id cannot be nil'
138
+ end
139
+
140
+ @id = id
141
+ end
142
+
118
143
  # Checks equality by comparing each attribute.
119
144
  # @param [Object] Object to be compared
120
145
  def ==(o)
@@ -123,7 +148,8 @@ module BmcApi
123
148
  id == o.id &&
124
149
  ips == o.ips &&
125
150
  status_description == o.status_description &&
126
- compute_slaac_ip == o.compute_slaac_ip
151
+ compute_slaac_ip == o.compute_slaac_ip &&
152
+ vlan_id == o.vlan_id
127
153
  end
128
154
 
129
155
  # @see the `==` method
@@ -135,7 +161,7 @@ module BmcApi
135
161
  # Calculates hash code according to all attributes.
136
162
  # @return [Integer] Hash code
137
163
  def hash
138
- [id, ips, status_description, compute_slaac_ip].hash
164
+ [id, ips, status_description, compute_slaac_ip, vlan_id].hash
139
165
  end
140
166
 
141
167
  # Builds the object from hash
@@ -161,61 +187,6 @@ module BmcApi
161
187
  new(transformed_hash)
162
188
  end
163
189
 
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
190
  # Returns the object in the form of hash
220
191
  # @return [Hash] Returns the object in the form of hash
221
192
  def to_hash
@@ -232,24 +203,6 @@ module BmcApi
232
203
  hash
233
204
  end
234
205
 
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
206
  end
254
207
 
255
208
  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
@@ -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
  # SSH Key.
18
- class SshKey
18
+ class SshKey < ApiModelBase
19
19
  # The unique identifier of the SSH Key.
20
20
  attr_accessor :id
21
21
 
@@ -50,9 +50,14 @@ module BmcApi
50
50
  }
51
51
  end
52
52
 
53
+ # Returns attribute mapping this model knows about
54
+ def self.acceptable_attribute_map
55
+ attribute_map
56
+ end
57
+
53
58
  # Returns all the JSON keys this model knows about
54
59
  def self.acceptable_attributes
55
- attribute_map.values
60
+ acceptable_attribute_map.values
56
61
  end
57
62
 
58
63
  # Attribute type mapping.
@@ -82,9 +87,10 @@ module BmcApi
82
87
  end
83
88
 
84
89
  # check to see if the attribute exists and convert string to symbol for hash key
90
+ acceptable_attribute_map = self.class.acceptable_attribute_map
85
91
  attributes = attributes.each_with_object({}) { |(k, v), h|
86
- if (!self.class.attribute_map.key?(k.to_sym))
87
- fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::SshKey`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
92
+ if (!acceptable_attribute_map.key?(k.to_sym))
93
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::SshKey`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
88
94
  end
89
95
  h[k.to_sym] = v
90
96
  }
@@ -182,6 +188,76 @@ module BmcApi
182
188
  true
183
189
  end
184
190
 
191
+ # Custom attribute writer method with validation
192
+ # @param [Object] id Value to be assigned
193
+ def id=(id)
194
+ if id.nil?
195
+ fail ArgumentError, 'id cannot be nil'
196
+ end
197
+
198
+ @id = id
199
+ end
200
+
201
+ # Custom attribute writer method with validation
202
+ # @param [Object] default Value to be assigned
203
+ def default=(default)
204
+ if default.nil?
205
+ fail ArgumentError, 'default cannot be nil'
206
+ end
207
+
208
+ @default = default
209
+ end
210
+
211
+ # Custom attribute writer method with validation
212
+ # @param [Object] name Value to be assigned
213
+ def name=(name)
214
+ if name.nil?
215
+ fail ArgumentError, 'name cannot be nil'
216
+ end
217
+
218
+ @name = name
219
+ end
220
+
221
+ # Custom attribute writer method with validation
222
+ # @param [Object] key Value to be assigned
223
+ def key=(key)
224
+ if key.nil?
225
+ fail ArgumentError, 'key cannot be nil'
226
+ end
227
+
228
+ @key = key
229
+ end
230
+
231
+ # Custom attribute writer method with validation
232
+ # @param [Object] fingerprint Value to be assigned
233
+ def fingerprint=(fingerprint)
234
+ if fingerprint.nil?
235
+ fail ArgumentError, 'fingerprint cannot be nil'
236
+ end
237
+
238
+ @fingerprint = fingerprint
239
+ end
240
+
241
+ # Custom attribute writer method with validation
242
+ # @param [Object] created_on Value to be assigned
243
+ def created_on=(created_on)
244
+ if created_on.nil?
245
+ fail ArgumentError, 'created_on cannot be nil'
246
+ end
247
+
248
+ @created_on = created_on
249
+ end
250
+
251
+ # Custom attribute writer method with validation
252
+ # @param [Object] last_updated_on Value to be assigned
253
+ def last_updated_on=(last_updated_on)
254
+ if last_updated_on.nil?
255
+ fail ArgumentError, 'last_updated_on cannot be nil'
256
+ end
257
+
258
+ @last_updated_on = last_updated_on
259
+ end
260
+
185
261
  # Checks equality by comparing each attribute.
186
262
  # @param [Object] Object to be compared
187
263
  def ==(o)
@@ -231,61 +307,6 @@ module BmcApi
231
307
  new(transformed_hash)
232
308
  end
233
309
 
234
- # Deserializes the data based on type
235
- # @param string type Data type
236
- # @param string value Value to be deserialized
237
- # @return [Object] Deserialized data
238
- def self._deserialize(type, value)
239
- case type.to_sym
240
- when :Time
241
- Time.parse(value)
242
- when :Date
243
- Date.parse(value)
244
- when :String
245
- value.to_s
246
- when :Integer
247
- value.to_i
248
- when :Float
249
- value.to_f
250
- when :Boolean
251
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
252
- true
253
- else
254
- false
255
- end
256
- when :Object
257
- # generic object (usually a Hash), return directly
258
- value
259
- when /\AArray<(?<inner_type>.+)>\z/
260
- inner_type = Regexp.last_match[:inner_type]
261
- value.map { |v| _deserialize(inner_type, v) }
262
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
263
- k_type = Regexp.last_match[:k_type]
264
- v_type = Regexp.last_match[:v_type]
265
- {}.tap do |hash|
266
- value.each do |k, v|
267
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
268
- end
269
- end
270
- else # model
271
- # models (e.g. Pet) or oneOf
272
- klass = BmcApi.const_get(type)
273
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
274
- end
275
- end
276
-
277
- # Returns the string representation of the object
278
- # @return [String] String presentation of the object
279
- def to_s
280
- to_hash.to_s
281
- end
282
-
283
- # to_body is an alias to to_hash (backward compatibility)
284
- # @return [Hash] Returns the object in the form of hash
285
- def to_body
286
- to_hash
287
- end
288
-
289
310
  # Returns the object in the form of hash
290
311
  # @return [Hash] Returns the object in the form of hash
291
312
  def to_hash
@@ -302,24 +323,6 @@ module BmcApi
302
323
  hash
303
324
  end
304
325
 
305
- # Outputs non-array value in the form of hash
306
- # For object, use to_hash. Otherwise, just return the value
307
- # @param [Object] value Any valid value
308
- # @return [Hash] Returns the value in the form of hash
309
- def _to_hash(value)
310
- if value.is_a?(Array)
311
- value.compact.map { |v| _to_hash(v) }
312
- elsif value.is_a?(Hash)
313
- {}.tap do |hash|
314
- value.each { |k, v| hash[k] = _to_hash(v) }
315
- end
316
- elsif value.respond_to? :to_hash
317
- value.to_hash
318
- else
319
- value
320
- end
321
- end
322
-
323
326
  end
324
327
 
325
328
  end