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.
- checksums.yaml +4 -4
- data/README.md +2 -0
- data/VERSION +1 -1
- data/docs/IpBlocksConfiguration.md +1 -1
- data/docs/OsConfigurationCloudInit.md +1 -1
- data/docs/OsConfigurationWindows.md +3 -1
- data/docs/PrivateNetworkConfiguration.md +1 -1
- data/docs/PublicNetworkConfiguration.md +1 -1
- data/docs/ReservationTransferDetails.md +18 -0
- data/docs/Server.md +3 -3
- data/docs/ServerCreate.md +3 -3
- data/docs/ServerNetworkUpdate.md +1 -1
- data/docs/ServerPrivateNetwork.md +3 -1
- data/docs/ServerProvision.md +1 -1
- data/docs/ServerPublicNetwork.md +5 -3
- data/docs/ServersApi.md +72 -0
- data/lib/pnap_bmc_api/api/quotas_api.rb +4 -4
- data/lib/pnap_bmc_api/api/servers_api.rb +97 -23
- data/lib/pnap_bmc_api/api/ssh_keys_api.rb +6 -6
- data/lib/pnap_bmc_api/api_client.rb +17 -14
- data/lib/pnap_bmc_api/api_error.rb +1 -1
- data/lib/pnap_bmc_api/api_model_base.rb +88 -0
- data/lib/pnap_bmc_api/configuration.rb +11 -1
- data/lib/pnap_bmc_api/models/action_result.rb +21 -78
- data/lib/pnap_bmc_api/models/delete_result.rb +31 -78
- data/lib/pnap_bmc_api/models/delete_ssh_key_result.rb +31 -78
- data/lib/pnap_bmc_api/models/error.rb +21 -78
- data/lib/pnap_bmc_api/models/esxi_datastore_configuration.rb +13 -80
- data/lib/pnap_bmc_api/models/esxi_os_configuration.rb +11 -78
- data/lib/pnap_bmc_api/models/gpu_configuration.rb +11 -78
- data/lib/pnap_bmc_api/models/ip_blocks_configuration.rb +12 -79
- data/lib/pnap_bmc_api/models/network_configuration.rb +11 -78
- data/lib/pnap_bmc_api/models/os_configuration.rb +11 -78
- data/lib/pnap_bmc_api/models/os_configuration_cloud_init.rb +11 -78
- data/lib/pnap_bmc_api/models/os_configuration_map.rb +11 -78
- data/lib/pnap_bmc_api/models/os_configuration_map_esxi.rb +11 -78
- data/lib/pnap_bmc_api/models/os_configuration_map_proxmox.rb +11 -78
- data/lib/pnap_bmc_api/models/os_configuration_netris_controller.rb +11 -78
- data/lib/pnap_bmc_api/models/os_configuration_netris_softgate.rb +11 -78
- data/lib/pnap_bmc_api/models/os_configuration_windows.rb +27 -82
- data/lib/pnap_bmc_api/models/private_network_configuration.rb +12 -79
- data/lib/pnap_bmc_api/models/public_network_configuration.rb +12 -79
- data/lib/pnap_bmc_api/models/quota.rb +61 -78
- data/lib/pnap_bmc_api/models/quota_edit_limit_request.rb +11 -78
- data/lib/pnap_bmc_api/models/quota_edit_limit_request_details.rb +21 -78
- data/lib/pnap_bmc_api/models/relinquish_ip_block.rb +11 -78
- data/lib/pnap_bmc_api/models/reservation_transfer_details.rb +166 -0
- data/lib/pnap_bmc_api/models/reset_result.rb +21 -78
- data/lib/pnap_bmc_api/models/server.rb +116 -83
- data/lib/pnap_bmc_api/models/server_create.rb +46 -83
- data/lib/pnap_bmc_api/models/server_ip_block.rb +21 -78
- data/lib/pnap_bmc_api/models/server_network_update.rb +12 -79
- data/lib/pnap_bmc_api/models/server_patch.rb +13 -80
- data/lib/pnap_bmc_api/models/server_private_network.rb +35 -82
- data/lib/pnap_bmc_api/models/server_provision.rb +24 -81
- data/lib/pnap_bmc_api/models/server_public_network.rb +36 -83
- data/lib/pnap_bmc_api/models/server_reserve.rb +21 -78
- data/lib/pnap_bmc_api/models/server_reset.rb +11 -78
- data/lib/pnap_bmc_api/models/ssh_key.rb +81 -78
- data/lib/pnap_bmc_api/models/ssh_key_create.rb +23 -80
- data/lib/pnap_bmc_api/models/ssh_key_update.rb +23 -80
- data/lib/pnap_bmc_api/models/storage_configuration.rb +11 -78
- data/lib/pnap_bmc_api/models/storage_configuration_root_partition.rb +11 -78
- data/lib/pnap_bmc_api/models/tag_assignment.rb +41 -78
- data/lib/pnap_bmc_api/models/tag_assignment_request.rb +21 -78
- data/lib/pnap_bmc_api/version.rb +1 -2
- data/lib/pnap_bmc_api.rb +3 -1
- data/pnap_bmc_api.gemspec +6 -6
- data/spec/api/quotas_api_spec.rb +1 -1
- data/spec/api/servers_api_spec.rb +14 -1
- data/spec/api/ssh_keys_api_spec.rb +1 -1
- data/spec/models/action_result_spec.rb +2 -2
- data/spec/models/delete_result_spec.rb +2 -2
- data/spec/models/delete_ssh_key_result_spec.rb +2 -2
- data/spec/models/error_spec.rb +2 -2
- data/spec/models/esxi_datastore_configuration_spec.rb +2 -2
- data/spec/models/esxi_os_configuration_spec.rb +2 -2
- data/spec/models/gpu_configuration_spec.rb +2 -2
- data/spec/models/ip_blocks_configuration_spec.rb +2 -2
- data/spec/models/network_configuration_spec.rb +2 -2
- data/spec/models/os_configuration_cloud_init_spec.rb +2 -2
- data/spec/models/os_configuration_map_esxi_spec.rb +2 -2
- data/spec/models/os_configuration_map_proxmox_spec.rb +2 -2
- data/spec/models/os_configuration_map_spec.rb +2 -2
- data/spec/models/os_configuration_netris_controller_spec.rb +2 -2
- data/spec/models/os_configuration_netris_softgate_spec.rb +2 -2
- data/spec/models/os_configuration_spec.rb +2 -2
- data/spec/models/os_configuration_windows_spec.rb +8 -2
- data/spec/models/private_network_configuration_spec.rb +2 -2
- data/spec/models/public_network_configuration_spec.rb +2 -2
- data/spec/models/quota_edit_limit_request_details_spec.rb +2 -2
- data/spec/models/quota_edit_limit_request_spec.rb +2 -2
- data/spec/models/quota_spec.rb +2 -2
- data/spec/models/relinquish_ip_block_spec.rb +2 -2
- data/spec/models/reservation_transfer_details_spec.rb +36 -0
- data/spec/models/reset_result_spec.rb +2 -2
- data/spec/models/server_create_spec.rb +2 -2
- data/spec/models/server_ip_block_spec.rb +2 -2
- data/spec/models/server_network_update_spec.rb +2 -2
- data/spec/models/server_patch_spec.rb +2 -2
- data/spec/models/server_private_network_spec.rb +8 -2
- data/spec/models/server_provision_spec.rb +2 -2
- data/spec/models/server_public_network_spec.rb +8 -2
- data/spec/models/server_reserve_spec.rb +2 -2
- data/spec/models/server_reset_spec.rb +2 -2
- data/spec/models/server_spec.rb +2 -2
- data/spec/models/ssh_key_create_spec.rb +2 -2
- data/spec/models/ssh_key_spec.rb +2 -2
- data/spec/models/ssh_key_update_spec.rb +2 -2
- data/spec/models/storage_configuration_root_partition_spec.rb +2 -2
- data/spec/models/storage_configuration_spec.rb +2 -2
- data/spec/models/tag_assignment_request_spec.rb +2 -2
- data/spec/models/tag_assignment_spec.rb +2 -2
- data/spec/spec_helper.rb +1 -1
- 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
|
-
|
|
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
|
# Result of a successful action.
|
|
18
|
-
class ActionResult
|
|
18
|
+
class ActionResult < ApiModelBase
|
|
19
19
|
# Message describing the action's result.
|
|
20
20
|
attr_accessor :result
|
|
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
|
-
|
|
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 (!
|
|
57
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::ActionResult`. Please check the name to make sure it's valid. List of attributes: " +
|
|
62
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
63
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::ActionResult`. 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] result Value to be assigned
|
|
97
|
+
def result=(result)
|
|
98
|
+
if result.nil?
|
|
99
|
+
fail ArgumentError, 'result cannot be nil'
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
@result = result
|
|
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
|
-
|
|
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
|
# Result of a successful delete action.
|
|
18
|
-
class DeleteResult
|
|
18
|
+
class DeleteResult < ApiModelBase
|
|
19
19
|
# Server has been deleted.
|
|
20
20
|
attr_accessor :result
|
|
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
|
-
|
|
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 (!
|
|
62
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::DeleteResult`. Please check the name to make sure it's valid. List of attributes: " +
|
|
67
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
68
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::DeleteResult`. 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
|
}
|
|
@@ -102,6 +108,26 @@ module BmcApi
|
|
|
102
108
|
true
|
|
103
109
|
end
|
|
104
110
|
|
|
111
|
+
# Custom attribute writer method with validation
|
|
112
|
+
# @param [Object] result Value to be assigned
|
|
113
|
+
def result=(result)
|
|
114
|
+
if result.nil?
|
|
115
|
+
fail ArgumentError, 'result cannot be nil'
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
@result = result
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
# Custom attribute writer method with validation
|
|
122
|
+
# @param [Object] server_id Value to be assigned
|
|
123
|
+
def server_id=(server_id)
|
|
124
|
+
if server_id.nil?
|
|
125
|
+
fail ArgumentError, 'server_id cannot be nil'
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
@server_id = server_id
|
|
129
|
+
end
|
|
130
|
+
|
|
105
131
|
# Checks equality by comparing each attribute.
|
|
106
132
|
# @param [Object] Object to be compared
|
|
107
133
|
def ==(o)
|
|
@@ -146,61 +172,6 @@ module BmcApi
|
|
|
146
172
|
new(transformed_hash)
|
|
147
173
|
end
|
|
148
174
|
|
|
149
|
-
# Deserializes the data based on type
|
|
150
|
-
# @param string type Data type
|
|
151
|
-
# @param string value Value to be deserialized
|
|
152
|
-
# @return [Object] Deserialized data
|
|
153
|
-
def self._deserialize(type, value)
|
|
154
|
-
case type.to_sym
|
|
155
|
-
when :Time
|
|
156
|
-
Time.parse(value)
|
|
157
|
-
when :Date
|
|
158
|
-
Date.parse(value)
|
|
159
|
-
when :String
|
|
160
|
-
value.to_s
|
|
161
|
-
when :Integer
|
|
162
|
-
value.to_i
|
|
163
|
-
when :Float
|
|
164
|
-
value.to_f
|
|
165
|
-
when :Boolean
|
|
166
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
167
|
-
true
|
|
168
|
-
else
|
|
169
|
-
false
|
|
170
|
-
end
|
|
171
|
-
when :Object
|
|
172
|
-
# generic object (usually a Hash), return directly
|
|
173
|
-
value
|
|
174
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
175
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
176
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
177
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
178
|
-
k_type = Regexp.last_match[:k_type]
|
|
179
|
-
v_type = Regexp.last_match[:v_type]
|
|
180
|
-
{}.tap do |hash|
|
|
181
|
-
value.each do |k, v|
|
|
182
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
183
|
-
end
|
|
184
|
-
end
|
|
185
|
-
else # model
|
|
186
|
-
# models (e.g. Pet) or oneOf
|
|
187
|
-
klass = BmcApi.const_get(type)
|
|
188
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
189
|
-
end
|
|
190
|
-
end
|
|
191
|
-
|
|
192
|
-
# Returns the string representation of the object
|
|
193
|
-
# @return [String] String presentation of the object
|
|
194
|
-
def to_s
|
|
195
|
-
to_hash.to_s
|
|
196
|
-
end
|
|
197
|
-
|
|
198
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
199
|
-
# @return [Hash] Returns the object in the form of hash
|
|
200
|
-
def to_body
|
|
201
|
-
to_hash
|
|
202
|
-
end
|
|
203
|
-
|
|
204
175
|
# Returns the object in the form of hash
|
|
205
176
|
# @return [Hash] Returns the object in the form of hash
|
|
206
177
|
def to_hash
|
|
@@ -217,24 +188,6 @@ module BmcApi
|
|
|
217
188
|
hash
|
|
218
189
|
end
|
|
219
190
|
|
|
220
|
-
# Outputs non-array value in the form of hash
|
|
221
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
222
|
-
# @param [Object] value Any valid value
|
|
223
|
-
# @return [Hash] Returns the value in the form of hash
|
|
224
|
-
def _to_hash(value)
|
|
225
|
-
if value.is_a?(Array)
|
|
226
|
-
value.compact.map { |v| _to_hash(v) }
|
|
227
|
-
elsif value.is_a?(Hash)
|
|
228
|
-
{}.tap do |hash|
|
|
229
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
230
|
-
end
|
|
231
|
-
elsif value.respond_to? :to_hash
|
|
232
|
-
value.to_hash
|
|
233
|
-
else
|
|
234
|
-
value
|
|
235
|
-
end
|
|
236
|
-
end
|
|
237
|
-
|
|
238
191
|
end
|
|
239
192
|
|
|
240
193
|
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
|
-
|
|
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
|
# Result of a successful delete action on a SSH key.
|
|
18
|
-
class DeleteSshKeyResult
|
|
18
|
+
class DeleteSshKeyResult < ApiModelBase
|
|
19
19
|
# Resource has been deleted.
|
|
20
20
|
attr_accessor :result
|
|
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
|
-
|
|
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 (!
|
|
62
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::DeleteSshKeyResult`. Please check the name to make sure it's valid. List of attributes: " +
|
|
67
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
68
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::DeleteSshKeyResult`. 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
|
}
|
|
@@ -102,6 +108,26 @@ module BmcApi
|
|
|
102
108
|
true
|
|
103
109
|
end
|
|
104
110
|
|
|
111
|
+
# Custom attribute writer method with validation
|
|
112
|
+
# @param [Object] result Value to be assigned
|
|
113
|
+
def result=(result)
|
|
114
|
+
if result.nil?
|
|
115
|
+
fail ArgumentError, 'result cannot be nil'
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
@result = result
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
# Custom attribute writer method with validation
|
|
122
|
+
# @param [Object] ssh_key_id Value to be assigned
|
|
123
|
+
def ssh_key_id=(ssh_key_id)
|
|
124
|
+
if ssh_key_id.nil?
|
|
125
|
+
fail ArgumentError, 'ssh_key_id cannot be nil'
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
@ssh_key_id = ssh_key_id
|
|
129
|
+
end
|
|
130
|
+
|
|
105
131
|
# Checks equality by comparing each attribute.
|
|
106
132
|
# @param [Object] Object to be compared
|
|
107
133
|
def ==(o)
|
|
@@ -146,61 +172,6 @@ module BmcApi
|
|
|
146
172
|
new(transformed_hash)
|
|
147
173
|
end
|
|
148
174
|
|
|
149
|
-
# Deserializes the data based on type
|
|
150
|
-
# @param string type Data type
|
|
151
|
-
# @param string value Value to be deserialized
|
|
152
|
-
# @return [Object] Deserialized data
|
|
153
|
-
def self._deserialize(type, value)
|
|
154
|
-
case type.to_sym
|
|
155
|
-
when :Time
|
|
156
|
-
Time.parse(value)
|
|
157
|
-
when :Date
|
|
158
|
-
Date.parse(value)
|
|
159
|
-
when :String
|
|
160
|
-
value.to_s
|
|
161
|
-
when :Integer
|
|
162
|
-
value.to_i
|
|
163
|
-
when :Float
|
|
164
|
-
value.to_f
|
|
165
|
-
when :Boolean
|
|
166
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
167
|
-
true
|
|
168
|
-
else
|
|
169
|
-
false
|
|
170
|
-
end
|
|
171
|
-
when :Object
|
|
172
|
-
# generic object (usually a Hash), return directly
|
|
173
|
-
value
|
|
174
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
175
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
176
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
177
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
178
|
-
k_type = Regexp.last_match[:k_type]
|
|
179
|
-
v_type = Regexp.last_match[:v_type]
|
|
180
|
-
{}.tap do |hash|
|
|
181
|
-
value.each do |k, v|
|
|
182
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
183
|
-
end
|
|
184
|
-
end
|
|
185
|
-
else # model
|
|
186
|
-
# models (e.g. Pet) or oneOf
|
|
187
|
-
klass = BmcApi.const_get(type)
|
|
188
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
189
|
-
end
|
|
190
|
-
end
|
|
191
|
-
|
|
192
|
-
# Returns the string representation of the object
|
|
193
|
-
# @return [String] String presentation of the object
|
|
194
|
-
def to_s
|
|
195
|
-
to_hash.to_s
|
|
196
|
-
end
|
|
197
|
-
|
|
198
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
199
|
-
# @return [Hash] Returns the object in the form of hash
|
|
200
|
-
def to_body
|
|
201
|
-
to_hash
|
|
202
|
-
end
|
|
203
|
-
|
|
204
175
|
# Returns the object in the form of hash
|
|
205
176
|
# @return [Hash] Returns the object in the form of hash
|
|
206
177
|
def to_hash
|
|
@@ -217,24 +188,6 @@ module BmcApi
|
|
|
217
188
|
hash
|
|
218
189
|
end
|
|
219
190
|
|
|
220
|
-
# Outputs non-array value in the form of hash
|
|
221
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
222
|
-
# @param [Object] value Any valid value
|
|
223
|
-
# @return [Hash] Returns the value in the form of hash
|
|
224
|
-
def _to_hash(value)
|
|
225
|
-
if value.is_a?(Array)
|
|
226
|
-
value.compact.map { |v| _to_hash(v) }
|
|
227
|
-
elsif value.is_a?(Hash)
|
|
228
|
-
{}.tap do |hash|
|
|
229
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
230
|
-
end
|
|
231
|
-
elsif value.respond_to? :to_hash
|
|
232
|
-
value.to_hash
|
|
233
|
-
else
|
|
234
|
-
value
|
|
235
|
-
end
|
|
236
|
-
end
|
|
237
|
-
|
|
238
191
|
end
|
|
239
192
|
|
|
240
193
|
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
|
-
|
|
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
|
-
|
|
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 (!
|
|
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: " +
|
|
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
|