autosde_openapi_client 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +9 -0
- data/README.md +207 -0
- data/Rakefile +10 -0
- data/autosde_openapi_client.gemspec +39 -0
- data/docs/AbstractCapability.md +19 -0
- data/docs/AbstractCapabilityApi.md +204 -0
- data/docs/Account.md +21 -0
- data/docs/AccountApi.md +256 -0
- data/docs/AccountPostRequest.md +19 -0
- data/docs/AccountPostResponse.md +23 -0
- data/docs/Address.md +31 -0
- data/docs/AddressApi.md +204 -0
- data/docs/AddressCreate.md +31 -0
- data/docs/AuthResponse.md +17 -0
- data/docs/Authentication.md +19 -0
- data/docs/AuthenticationApi.md +53 -0
- data/docs/AutoSDEProject.md +55 -0
- data/docs/AutoSDEProjectApi.md +204 -0
- data/docs/AutoSDERole.md +19 -0
- data/docs/AutoSDERoleApi.md +204 -0
- data/docs/CapabilityTranslation.md +35 -0
- data/docs/CapabilityTranslationApi.md +204 -0
- data/docs/CapabilityTranslationCreate.md +31 -0
- data/docs/Host.md +29 -0
- data/docs/HostApi.md +204 -0
- data/docs/HostCreate.md +39 -0
- data/docs/HostVolumeConnection.md +23 -0
- data/docs/HostVolumeConnectionApi.md +204 -0
- data/docs/HostVolumeConnectionCreate.md +21 -0
- data/docs/NativeCapability.md +23 -0
- data/docs/NativeCapabilityApi.md +204 -0
- data/docs/Profile.md +25 -0
- data/docs/ProfileApi.md +204 -0
- data/docs/ProvisioningStrategy.md +19 -0
- data/docs/ProvisioningStrategyApi.md +204 -0
- data/docs/Service.md +35 -0
- data/docs/ServiceAbstractCapabilityValue.md +21 -0
- data/docs/ServiceApi.md +256 -0
- data/docs/ServiceCreate.md +33 -0
- data/docs/ServiceResourceAttachment.md +23 -0
- data/docs/ServiceResourceAttachmentApi.md +204 -0
- data/docs/StorageResource.md +33 -0
- data/docs/StorageResourceApi.md +256 -0
- data/docs/StorageResourceCreate.md +31 -0
- data/docs/StorageResourceResponse.md +33 -0
- data/docs/StorageSystem.md +29 -0
- data/docs/StorageSystemApi.md +204 -0
- data/docs/StorageSystemCreate.md +49 -0
- data/docs/SystemType.md +25 -0
- data/docs/SystemTypeApi.md +204 -0
- data/docs/SystemTypeCreate.md +27 -0
- data/docs/Volume.md +31 -0
- data/docs/VolumeApi.md +256 -0
- data/docs/VolumeCreate.md +27 -0
- data/docs/VolumeResponse.md +31 -0
- data/docs/VolumeSafeDelete.md +21 -0
- data/docs/VolumeSafeDeleteApi.md +204 -0
- data/docs/VolumeSafeDeleteCreate.md +17 -0
- data/docs/VolumeUpdate.md +17 -0
- data/git_push.sh +58 -0
- data/lib/autosde_openapi_client.rb +94 -0
- data/lib/autosde_openapi_client/api/abstract_capability_api.rb +250 -0
- data/lib/autosde_openapi_client/api/account_api.rb +316 -0
- data/lib/autosde_openapi_client/api/address_api.rb +250 -0
- data/lib/autosde_openapi_client/api/authentication_api.rb +82 -0
- data/lib/autosde_openapi_client/api/auto_sde_project_api.rb +250 -0
- data/lib/autosde_openapi_client/api/auto_sde_role_api.rb +250 -0
- data/lib/autosde_openapi_client/api/capability_translation_api.rb +250 -0
- data/lib/autosde_openapi_client/api/host_api.rb +250 -0
- data/lib/autosde_openapi_client/api/host_volume_connection_api.rb +250 -0
- data/lib/autosde_openapi_client/api/native_capability_api.rb +250 -0
- data/lib/autosde_openapi_client/api/profile_api.rb +250 -0
- data/lib/autosde_openapi_client/api/provisioning_strategy_api.rb +250 -0
- data/lib/autosde_openapi_client/api/service_api.rb +316 -0
- data/lib/autosde_openapi_client/api/service_resource_attachment_api.rb +250 -0
- data/lib/autosde_openapi_client/api/storage_resource_api.rb +316 -0
- data/lib/autosde_openapi_client/api/storage_system_api.rb +250 -0
- data/lib/autosde_openapi_client/api/system_type_api.rb +250 -0
- data/lib/autosde_openapi_client/api/volume_api.rb +316 -0
- data/lib/autosde_openapi_client/api/volume_safe_delete_api.rb +250 -0
- data/lib/autosde_openapi_client/api_client.rb +388 -0
- data/lib/autosde_openapi_client/api_error.rb +57 -0
- data/lib/autosde_openapi_client/configuration.rb +266 -0
- data/lib/autosde_openapi_client/models/abstract_capability.rb +218 -0
- data/lib/autosde_openapi_client/models/account.rb +228 -0
- data/lib/autosde_openapi_client/models/account_post_request.rb +218 -0
- data/lib/autosde_openapi_client/models/account_post_response.rb +238 -0
- data/lib/autosde_openapi_client/models/address.rb +328 -0
- data/lib/autosde_openapi_client/models/address_create.rb +330 -0
- data/lib/autosde_openapi_client/models/auth_response.rb +208 -0
- data/lib/autosde_openapi_client/models/authentication.rb +218 -0
- data/lib/autosde_openapi_client/models/auto_sde_project.rb +398 -0
- data/lib/autosde_openapi_client/models/auto_sde_role.rb +218 -0
- data/lib/autosde_openapi_client/models/capability_translation.rb +328 -0
- data/lib/autosde_openapi_client/models/capability_translation_create.rb +310 -0
- data/lib/autosde_openapi_client/models/host.rb +321 -0
- data/lib/autosde_openapi_client/models/host_create.rb +382 -0
- data/lib/autosde_openapi_client/models/host_volume_connection.rb +275 -0
- data/lib/autosde_openapi_client/models/host_volume_connection_create.rb +265 -0
- data/lib/autosde_openapi_client/models/native_capability.rb +239 -0
- data/lib/autosde_openapi_client/models/profile.rb +283 -0
- data/lib/autosde_openapi_client/models/provisioning_strategy.rb +257 -0
- data/lib/autosde_openapi_client/models/service.rb +339 -0
- data/lib/autosde_openapi_client/models/service_abstract_capability_value.rb +227 -0
- data/lib/autosde_openapi_client/models/service_create.rb +327 -0
- data/lib/autosde_openapi_client/models/service_resource_attachment.rb +238 -0
- data/lib/autosde_openapi_client/models/storage_resource.rb +342 -0
- data/lib/autosde_openapi_client/models/storage_resource_create.rb +333 -0
- data/lib/autosde_openapi_client/models/storage_resource_response.rb +343 -0
- data/lib/autosde_openapi_client/models/storage_system.rb +333 -0
- data/lib/autosde_openapi_client/models/storage_system_create.rb +448 -0
- data/lib/autosde_openapi_client/models/system_type.rb +321 -0
- data/lib/autosde_openapi_client/models/system_type_create.rb +333 -0
- data/lib/autosde_openapi_client/models/volume.rb +316 -0
- data/lib/autosde_openapi_client/models/volume_create.rb +299 -0
- data/lib/autosde_openapi_client/models/volume_response.rb +318 -0
- data/lib/autosde_openapi_client/models/volume_safe_delete.rb +227 -0
- data/lib/autosde_openapi_client/models/volume_safe_delete_create.rb +207 -0
- data/lib/autosde_openapi_client/models/volume_update.rb +208 -0
- data/lib/autosde_openapi_client/version.rb +15 -0
- data/site_manager_oas.json +3992 -0
- data/spec/api/abstract_capability_api_spec.rb +74 -0
- data/spec/api/account_api_spec.rb +85 -0
- data/spec/api/address_api_spec.rb +74 -0
- data/spec/api/authentication_api_spec.rb +45 -0
- data/spec/api/auto_sde_project_api_spec.rb +74 -0
- data/spec/api/auto_sde_role_api_spec.rb +74 -0
- data/spec/api/capability_translation_api_spec.rb +74 -0
- data/spec/api/host_api_spec.rb +74 -0
- data/spec/api/host_volume_connection_api_spec.rb +74 -0
- data/spec/api/native_capability_api_spec.rb +74 -0
- data/spec/api/profile_api_spec.rb +74 -0
- data/spec/api/provisioning_strategy_api_spec.rb +74 -0
- data/spec/api/service_api_spec.rb +85 -0
- data/spec/api/service_resource_attachment_api_spec.rb +74 -0
- data/spec/api/storage_resource_api_spec.rb +85 -0
- data/spec/api/storage_system_api_spec.rb +74 -0
- data/spec/api/system_type_api_spec.rb +74 -0
- data/spec/api/volume_api_spec.rb +85 -0
- data/spec/api/volume_safe_delete_api_spec.rb +74 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/abstract_capability_spec.rb +47 -0
- data/spec/models/account_post_request_spec.rb +47 -0
- data/spec/models/account_post_response_spec.rb +59 -0
- data/spec/models/account_spec.rb +53 -0
- data/spec/models/address_create_spec.rb +91 -0
- data/spec/models/address_spec.rb +91 -0
- data/spec/models/auth_response_spec.rb +41 -0
- data/spec/models/authentication_spec.rb +47 -0
- data/spec/models/auto_sde_project_spec.rb +155 -0
- data/spec/models/auto_sde_role_spec.rb +47 -0
- data/spec/models/capability_translation_create_spec.rb +83 -0
- data/spec/models/capability_translation_spec.rb +95 -0
- data/spec/models/host_create_spec.rb +119 -0
- data/spec/models/host_spec.rb +85 -0
- data/spec/models/host_volume_connection_create_spec.rb +57 -0
- data/spec/models/host_volume_connection_spec.rb +63 -0
- data/spec/models/native_capability_spec.rb +59 -0
- data/spec/models/profile_spec.rb +69 -0
- data/spec/models/provisioning_strategy_spec.rb +51 -0
- data/spec/models/service_abstract_capability_value_spec.rb +53 -0
- data/spec/models/service_create_spec.rb +93 -0
- data/spec/models/service_resource_attachment_spec.rb +59 -0
- data/spec/models/service_spec.rb +99 -0
- data/spec/models/storage_resource_create_spec.rb +91 -0
- data/spec/models/storage_resource_response_spec.rb +97 -0
- data/spec/models/storage_resource_spec.rb +97 -0
- data/spec/models/storage_system_create_spec.rb +149 -0
- data/spec/models/storage_system_spec.rb +85 -0
- data/spec/models/system_type_create_spec.rb +79 -0
- data/spec/models/system_type_spec.rb +73 -0
- data/spec/models/volume_create_spec.rb +75 -0
- data/spec/models/volume_response_spec.rb +87 -0
- data/spec/models/volume_safe_delete_create_spec.rb +41 -0
- data/spec/models/volume_safe_delete_spec.rb +53 -0
- data/spec/models/volume_spec.rb +87 -0
- data/spec/models/volume_update_spec.rb +41 -0
- data/spec/spec_helper.rb +111 -0
- metadata +340 -0
@@ -0,0 +1,299 @@
|
|
1
|
+
=begin
|
2
|
+
#Site Manager API
|
3
|
+
|
4
|
+
#Site Manager API
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
7
|
+
Contact: autosde@il.ibm.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.3.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module OpenapiClient
|
16
|
+
# TODO add description
|
17
|
+
class VolumeCreate
|
18
|
+
# compliant
|
19
|
+
attr_accessor :compliant
|
20
|
+
|
21
|
+
# component_state
|
22
|
+
attr_accessor :component_state
|
23
|
+
|
24
|
+
# name
|
25
|
+
attr_accessor :name
|
26
|
+
|
27
|
+
# !!uuid of service
|
28
|
+
attr_accessor :service
|
29
|
+
|
30
|
+
# size
|
31
|
+
attr_accessor :size
|
32
|
+
|
33
|
+
# uuid
|
34
|
+
attr_accessor :uuid
|
35
|
+
|
36
|
+
class EnumAttributeValidator
|
37
|
+
attr_reader :datatype
|
38
|
+
attr_reader :allowable_values
|
39
|
+
|
40
|
+
def initialize(datatype, allowable_values)
|
41
|
+
@allowable_values = allowable_values.map do |value|
|
42
|
+
case datatype.to_s
|
43
|
+
when /Integer/i
|
44
|
+
value.to_i
|
45
|
+
when /Float/i
|
46
|
+
value.to_f
|
47
|
+
else
|
48
|
+
value
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
def valid?(value)
|
54
|
+
!value || allowable_values.include?(value)
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
59
|
+
def self.attribute_map
|
60
|
+
{
|
61
|
+
:'compliant' => :'compliant',
|
62
|
+
:'component_state' => :'component_state',
|
63
|
+
:'name' => :'name',
|
64
|
+
:'service' => :'service',
|
65
|
+
:'size' => :'size',
|
66
|
+
:'uuid' => :'uuid'
|
67
|
+
}
|
68
|
+
end
|
69
|
+
|
70
|
+
# Attribute type mapping.
|
71
|
+
def self.openapi_types
|
72
|
+
{
|
73
|
+
:'compliant' => :'Boolean',
|
74
|
+
:'component_state' => :'String',
|
75
|
+
:'name' => :'String',
|
76
|
+
:'service' => :'String',
|
77
|
+
:'size' => :'Integer',
|
78
|
+
:'uuid' => :'String'
|
79
|
+
}
|
80
|
+
end
|
81
|
+
|
82
|
+
# List of attributes with nullable: true
|
83
|
+
def self.openapi_nullable
|
84
|
+
Set.new([
|
85
|
+
])
|
86
|
+
end
|
87
|
+
|
88
|
+
# Initializes the object
|
89
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
90
|
+
def initialize(attributes = {})
|
91
|
+
if (!attributes.is_a?(Hash))
|
92
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::VolumeCreate` initialize method"
|
93
|
+
end
|
94
|
+
|
95
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
96
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
97
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
98
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::VolumeCreate`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
99
|
+
end
|
100
|
+
h[k.to_sym] = v
|
101
|
+
}
|
102
|
+
|
103
|
+
if attributes.key?(:'compliant')
|
104
|
+
self.compliant = attributes[:'compliant']
|
105
|
+
else
|
106
|
+
self.compliant = false
|
107
|
+
end
|
108
|
+
|
109
|
+
if attributes.key?(:'component_state')
|
110
|
+
self.component_state = attributes[:'component_state']
|
111
|
+
end
|
112
|
+
|
113
|
+
if attributes.key?(:'name')
|
114
|
+
self.name = attributes[:'name']
|
115
|
+
end
|
116
|
+
|
117
|
+
if attributes.key?(:'service')
|
118
|
+
self.service = attributes[:'service']
|
119
|
+
end
|
120
|
+
|
121
|
+
if attributes.key?(:'size')
|
122
|
+
self.size = attributes[:'size']
|
123
|
+
end
|
124
|
+
|
125
|
+
if attributes.key?(:'uuid')
|
126
|
+
self.uuid = attributes[:'uuid']
|
127
|
+
end
|
128
|
+
end
|
129
|
+
|
130
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
131
|
+
# @return Array for valid properties with the reasons
|
132
|
+
def list_invalid_properties
|
133
|
+
invalid_properties = Array.new
|
134
|
+
if !@component_state.nil? && @component_state.to_s.length > 32
|
135
|
+
invalid_properties.push('invalid value for "component_state", the character length must be smaller than or equal to 32.')
|
136
|
+
end
|
137
|
+
|
138
|
+
invalid_properties
|
139
|
+
end
|
140
|
+
|
141
|
+
# Check to see if the all the properties in the model are valid
|
142
|
+
# @return true if the model is valid
|
143
|
+
def valid?
|
144
|
+
component_state_validator = EnumAttributeValidator.new('String', ["PENDING_CREATION", "CREATED", "DELETED", "PENDING_DELETION", "MODIFICATION", "PENDING_MODIFICATION"])
|
145
|
+
return false unless component_state_validator.valid?(@component_state)
|
146
|
+
return false if !@component_state.nil? && @component_state.to_s.length > 32
|
147
|
+
true
|
148
|
+
end
|
149
|
+
|
150
|
+
# Custom attribute writer method checking allowed values (enum).
|
151
|
+
# @param [Object] component_state Object to be assigned
|
152
|
+
def component_state=(component_state)
|
153
|
+
validator = EnumAttributeValidator.new('String', ["PENDING_CREATION", "CREATED", "DELETED", "PENDING_DELETION", "MODIFICATION", "PENDING_MODIFICATION"])
|
154
|
+
unless validator.valid?(component_state)
|
155
|
+
fail ArgumentError, "invalid value for \"component_state\", must be one of #{validator.allowable_values}."
|
156
|
+
end
|
157
|
+
@component_state = component_state
|
158
|
+
end
|
159
|
+
|
160
|
+
# Checks equality by comparing each attribute.
|
161
|
+
# @param [Object] Object to be compared
|
162
|
+
def ==(o)
|
163
|
+
return true if self.equal?(o)
|
164
|
+
self.class == o.class &&
|
165
|
+
compliant == o.compliant &&
|
166
|
+
component_state == o.component_state &&
|
167
|
+
name == o.name &&
|
168
|
+
service == o.service &&
|
169
|
+
size == o.size &&
|
170
|
+
uuid == o.uuid
|
171
|
+
end
|
172
|
+
|
173
|
+
# @see the `==` method
|
174
|
+
# @param [Object] Object to be compared
|
175
|
+
def eql?(o)
|
176
|
+
self == o
|
177
|
+
end
|
178
|
+
|
179
|
+
# Calculates hash code according to all attributes.
|
180
|
+
# @return [Integer] Hash code
|
181
|
+
def hash
|
182
|
+
[compliant, component_state, name, service, size, uuid].hash
|
183
|
+
end
|
184
|
+
|
185
|
+
# Builds the object from hash
|
186
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
187
|
+
# @return [Object] Returns the model itself
|
188
|
+
def self.build_from_hash(attributes)
|
189
|
+
new.build_from_hash(attributes)
|
190
|
+
end
|
191
|
+
|
192
|
+
# Builds the object from hash
|
193
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
194
|
+
# @return [Object] Returns the model itself
|
195
|
+
def build_from_hash(attributes)
|
196
|
+
return nil unless attributes.is_a?(Hash)
|
197
|
+
self.class.openapi_types.each_pair do |key, type|
|
198
|
+
if type =~ /\AArray<(.*)>/i
|
199
|
+
# check to ensure the input is an array given that the attribute
|
200
|
+
# is documented as an array but the input is not
|
201
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
202
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
203
|
+
end
|
204
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
205
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
206
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
207
|
+
end
|
208
|
+
|
209
|
+
self
|
210
|
+
end
|
211
|
+
|
212
|
+
# Deserializes the data based on type
|
213
|
+
# @param string type Data type
|
214
|
+
# @param string value Value to be deserialized
|
215
|
+
# @return [Object] Deserialized data
|
216
|
+
def _deserialize(type, value)
|
217
|
+
case type.to_sym
|
218
|
+
when :DateTime
|
219
|
+
DateTime.parse(value)
|
220
|
+
when :Date
|
221
|
+
Date.parse(value)
|
222
|
+
when :String
|
223
|
+
value.to_s
|
224
|
+
when :Integer
|
225
|
+
value.to_i
|
226
|
+
when :Float
|
227
|
+
value.to_f
|
228
|
+
when :Boolean
|
229
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
230
|
+
true
|
231
|
+
else
|
232
|
+
false
|
233
|
+
end
|
234
|
+
when :Object
|
235
|
+
# generic object (usually a Hash), return directly
|
236
|
+
value
|
237
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
238
|
+
inner_type = Regexp.last_match[:inner_type]
|
239
|
+
value.map { |v| _deserialize(inner_type, v) }
|
240
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
241
|
+
k_type = Regexp.last_match[:k_type]
|
242
|
+
v_type = Regexp.last_match[:v_type]
|
243
|
+
{}.tap do |hash|
|
244
|
+
value.each do |k, v|
|
245
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
246
|
+
end
|
247
|
+
end
|
248
|
+
else # model
|
249
|
+
OpenapiClient.const_get(type).build_from_hash(value)
|
250
|
+
end
|
251
|
+
end
|
252
|
+
|
253
|
+
# Returns the string representation of the object
|
254
|
+
# @return [String] String presentation of the object
|
255
|
+
def to_s
|
256
|
+
to_hash.to_s
|
257
|
+
end
|
258
|
+
|
259
|
+
# to_body is an alias to to_hash (backward compatibility)
|
260
|
+
# @return [Hash] Returns the object in the form of hash
|
261
|
+
def to_body
|
262
|
+
to_hash
|
263
|
+
end
|
264
|
+
|
265
|
+
# Returns the object in the form of hash
|
266
|
+
# @return [Hash] Returns the object in the form of hash
|
267
|
+
def to_hash
|
268
|
+
hash = {}
|
269
|
+
self.class.attribute_map.each_pair do |attr, param|
|
270
|
+
value = self.send(attr)
|
271
|
+
if value.nil?
|
272
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
273
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
274
|
+
end
|
275
|
+
|
276
|
+
hash[param] = _to_hash(value)
|
277
|
+
end
|
278
|
+
hash
|
279
|
+
end
|
280
|
+
|
281
|
+
# Outputs non-array value in the form of hash
|
282
|
+
# For object, use to_hash. Otherwise, just return the value
|
283
|
+
# @param [Object] value Any valid value
|
284
|
+
# @return [Hash] Returns the value in the form of hash
|
285
|
+
def _to_hash(value)
|
286
|
+
if value.is_a?(Array)
|
287
|
+
value.compact.map { |v| _to_hash(v) }
|
288
|
+
elsif value.is_a?(Hash)
|
289
|
+
{}.tap do |hash|
|
290
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
291
|
+
end
|
292
|
+
elsif value.respond_to? :to_hash
|
293
|
+
value.to_hash
|
294
|
+
else
|
295
|
+
value
|
296
|
+
end
|
297
|
+
end
|
298
|
+
end
|
299
|
+
end
|
@@ -0,0 +1,318 @@
|
|
1
|
+
=begin
|
2
|
+
#Site Manager API
|
3
|
+
|
4
|
+
#Site Manager API
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
7
|
+
Contact: autosde@il.ibm.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.3.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module OpenapiClient
|
16
|
+
# TODO add description
|
17
|
+
class VolumeResponse
|
18
|
+
# compliant
|
19
|
+
attr_accessor :compliant
|
20
|
+
|
21
|
+
# component_state
|
22
|
+
attr_accessor :component_state
|
23
|
+
|
24
|
+
attr_accessor :historical_service
|
25
|
+
|
26
|
+
# name
|
27
|
+
attr_accessor :name
|
28
|
+
|
29
|
+
# !!uuid of service
|
30
|
+
attr_accessor :service
|
31
|
+
|
32
|
+
# size
|
33
|
+
attr_accessor :size
|
34
|
+
|
35
|
+
# !!uuid of storage_resource
|
36
|
+
attr_accessor :storage_resource
|
37
|
+
|
38
|
+
# uuid
|
39
|
+
attr_accessor :uuid
|
40
|
+
|
41
|
+
class EnumAttributeValidator
|
42
|
+
attr_reader :datatype
|
43
|
+
attr_reader :allowable_values
|
44
|
+
|
45
|
+
def initialize(datatype, allowable_values)
|
46
|
+
@allowable_values = allowable_values.map do |value|
|
47
|
+
case datatype.to_s
|
48
|
+
when /Integer/i
|
49
|
+
value.to_i
|
50
|
+
when /Float/i
|
51
|
+
value.to_f
|
52
|
+
else
|
53
|
+
value
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
def valid?(value)
|
59
|
+
!value || allowable_values.include?(value)
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
64
|
+
def self.attribute_map
|
65
|
+
{
|
66
|
+
:'compliant' => :'compliant',
|
67
|
+
:'component_state' => :'component_state',
|
68
|
+
:'historical_service' => :'historical_service',
|
69
|
+
:'name' => :'name',
|
70
|
+
:'service' => :'service',
|
71
|
+
:'size' => :'size',
|
72
|
+
:'storage_resource' => :'storage_resource',
|
73
|
+
:'uuid' => :'uuid'
|
74
|
+
}
|
75
|
+
end
|
76
|
+
|
77
|
+
# Attribute type mapping.
|
78
|
+
def self.openapi_types
|
79
|
+
{
|
80
|
+
:'compliant' => :'Boolean',
|
81
|
+
:'component_state' => :'String',
|
82
|
+
:'historical_service' => :'Service',
|
83
|
+
:'name' => :'String',
|
84
|
+
:'service' => :'String',
|
85
|
+
:'size' => :'Integer',
|
86
|
+
:'storage_resource' => :'String',
|
87
|
+
:'uuid' => :'String'
|
88
|
+
}
|
89
|
+
end
|
90
|
+
|
91
|
+
# List of attributes with nullable: true
|
92
|
+
def self.openapi_nullable
|
93
|
+
Set.new([
|
94
|
+
])
|
95
|
+
end
|
96
|
+
|
97
|
+
# Initializes the object
|
98
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
99
|
+
def initialize(attributes = {})
|
100
|
+
if (!attributes.is_a?(Hash))
|
101
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::VolumeResponse` initialize method"
|
102
|
+
end
|
103
|
+
|
104
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
105
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
106
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
107
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::VolumeResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
108
|
+
end
|
109
|
+
h[k.to_sym] = v
|
110
|
+
}
|
111
|
+
|
112
|
+
if attributes.key?(:'compliant')
|
113
|
+
self.compliant = attributes[:'compliant']
|
114
|
+
else
|
115
|
+
self.compliant = false
|
116
|
+
end
|
117
|
+
|
118
|
+
if attributes.key?(:'component_state')
|
119
|
+
self.component_state = attributes[:'component_state']
|
120
|
+
end
|
121
|
+
|
122
|
+
if attributes.key?(:'historical_service')
|
123
|
+
self.historical_service = attributes[:'historical_service']
|
124
|
+
end
|
125
|
+
|
126
|
+
if attributes.key?(:'name')
|
127
|
+
self.name = attributes[:'name']
|
128
|
+
end
|
129
|
+
|
130
|
+
if attributes.key?(:'service')
|
131
|
+
self.service = attributes[:'service']
|
132
|
+
end
|
133
|
+
|
134
|
+
if attributes.key?(:'size')
|
135
|
+
self.size = attributes[:'size']
|
136
|
+
end
|
137
|
+
|
138
|
+
if attributes.key?(:'storage_resource')
|
139
|
+
self.storage_resource = attributes[:'storage_resource']
|
140
|
+
end
|
141
|
+
|
142
|
+
if attributes.key?(:'uuid')
|
143
|
+
self.uuid = attributes[:'uuid']
|
144
|
+
end
|
145
|
+
end
|
146
|
+
|
147
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
148
|
+
# @return Array for valid properties with the reasons
|
149
|
+
def list_invalid_properties
|
150
|
+
invalid_properties = Array.new
|
151
|
+
if !@component_state.nil? && @component_state.to_s.length > 32
|
152
|
+
invalid_properties.push('invalid value for "component_state", the character length must be smaller than or equal to 32.')
|
153
|
+
end
|
154
|
+
|
155
|
+
invalid_properties
|
156
|
+
end
|
157
|
+
|
158
|
+
# Check to see if the all the properties in the model are valid
|
159
|
+
# @return true if the model is valid
|
160
|
+
def valid?
|
161
|
+
component_state_validator = EnumAttributeValidator.new('String', ["PENDING_CREATION", "CREATED", "DELETED", "PENDING_DELETION", "MODIFICATION", "PENDING_MODIFICATION"])
|
162
|
+
return false unless component_state_validator.valid?(@component_state)
|
163
|
+
return false if !@component_state.nil? && @component_state.to_s.length > 32
|
164
|
+
true
|
165
|
+
end
|
166
|
+
|
167
|
+
# Custom attribute writer method checking allowed values (enum).
|
168
|
+
# @param [Object] component_state Object to be assigned
|
169
|
+
def component_state=(component_state)
|
170
|
+
validator = EnumAttributeValidator.new('String', ["PENDING_CREATION", "CREATED", "DELETED", "PENDING_DELETION", "MODIFICATION", "PENDING_MODIFICATION"])
|
171
|
+
unless validator.valid?(component_state)
|
172
|
+
fail ArgumentError, "invalid value for \"component_state\", must be one of #{validator.allowable_values}."
|
173
|
+
end
|
174
|
+
@component_state = component_state
|
175
|
+
end
|
176
|
+
|
177
|
+
# Checks equality by comparing each attribute.
|
178
|
+
# @param [Object] Object to be compared
|
179
|
+
def ==(o)
|
180
|
+
return true if self.equal?(o)
|
181
|
+
self.class == o.class &&
|
182
|
+
compliant == o.compliant &&
|
183
|
+
component_state == o.component_state &&
|
184
|
+
historical_service == o.historical_service &&
|
185
|
+
name == o.name &&
|
186
|
+
service == o.service &&
|
187
|
+
size == o.size &&
|
188
|
+
storage_resource == o.storage_resource &&
|
189
|
+
uuid == o.uuid
|
190
|
+
end
|
191
|
+
|
192
|
+
# @see the `==` method
|
193
|
+
# @param [Object] Object to be compared
|
194
|
+
def eql?(o)
|
195
|
+
self == o
|
196
|
+
end
|
197
|
+
|
198
|
+
# Calculates hash code according to all attributes.
|
199
|
+
# @return [Integer] Hash code
|
200
|
+
def hash
|
201
|
+
[compliant, component_state, historical_service, name, service, size, storage_resource, uuid].hash
|
202
|
+
end
|
203
|
+
|
204
|
+
# Builds the object from hash
|
205
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
206
|
+
# @return [Object] Returns the model itself
|
207
|
+
def self.build_from_hash(attributes)
|
208
|
+
new.build_from_hash(attributes)
|
209
|
+
end
|
210
|
+
|
211
|
+
# Builds the object from hash
|
212
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
213
|
+
# @return [Object] Returns the model itself
|
214
|
+
def build_from_hash(attributes)
|
215
|
+
return nil unless attributes.is_a?(Hash)
|
216
|
+
self.class.openapi_types.each_pair do |key, type|
|
217
|
+
if type =~ /\AArray<(.*)>/i
|
218
|
+
# check to ensure the input is an array given that the attribute
|
219
|
+
# is documented as an array but the input is not
|
220
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
221
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
222
|
+
end
|
223
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
224
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
225
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
226
|
+
end
|
227
|
+
|
228
|
+
self
|
229
|
+
end
|
230
|
+
|
231
|
+
# Deserializes the data based on type
|
232
|
+
# @param string type Data type
|
233
|
+
# @param string value Value to be deserialized
|
234
|
+
# @return [Object] Deserialized data
|
235
|
+
def _deserialize(type, value)
|
236
|
+
case type.to_sym
|
237
|
+
when :DateTime
|
238
|
+
DateTime.parse(value)
|
239
|
+
when :Date
|
240
|
+
Date.parse(value)
|
241
|
+
when :String
|
242
|
+
value.to_s
|
243
|
+
when :Integer
|
244
|
+
value.to_i
|
245
|
+
when :Float
|
246
|
+
value.to_f
|
247
|
+
when :Boolean
|
248
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
249
|
+
true
|
250
|
+
else
|
251
|
+
false
|
252
|
+
end
|
253
|
+
when :Object
|
254
|
+
# generic object (usually a Hash), return directly
|
255
|
+
value
|
256
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
257
|
+
inner_type = Regexp.last_match[:inner_type]
|
258
|
+
value.map { |v| _deserialize(inner_type, v) }
|
259
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
260
|
+
k_type = Regexp.last_match[:k_type]
|
261
|
+
v_type = Regexp.last_match[:v_type]
|
262
|
+
{}.tap do |hash|
|
263
|
+
value.each do |k, v|
|
264
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
265
|
+
end
|
266
|
+
end
|
267
|
+
else # model
|
268
|
+
OpenapiClient.const_get(type).build_from_hash(value)
|
269
|
+
end
|
270
|
+
end
|
271
|
+
|
272
|
+
# Returns the string representation of the object
|
273
|
+
# @return [String] String presentation of the object
|
274
|
+
def to_s
|
275
|
+
to_hash.to_s
|
276
|
+
end
|
277
|
+
|
278
|
+
# to_body is an alias to to_hash (backward compatibility)
|
279
|
+
# @return [Hash] Returns the object in the form of hash
|
280
|
+
def to_body
|
281
|
+
to_hash
|
282
|
+
end
|
283
|
+
|
284
|
+
# Returns the object in the form of hash
|
285
|
+
# @return [Hash] Returns the object in the form of hash
|
286
|
+
def to_hash
|
287
|
+
hash = {}
|
288
|
+
self.class.attribute_map.each_pair do |attr, param|
|
289
|
+
value = self.send(attr)
|
290
|
+
if value.nil?
|
291
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
292
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
293
|
+
end
|
294
|
+
|
295
|
+
hash[param] = _to_hash(value)
|
296
|
+
end
|
297
|
+
hash
|
298
|
+
end
|
299
|
+
|
300
|
+
# Outputs non-array value in the form of hash
|
301
|
+
# For object, use to_hash. Otherwise, just return the value
|
302
|
+
# @param [Object] value Any valid value
|
303
|
+
# @return [Hash] Returns the value in the form of hash
|
304
|
+
def _to_hash(value)
|
305
|
+
if value.is_a?(Array)
|
306
|
+
value.compact.map { |v| _to_hash(v) }
|
307
|
+
elsif value.is_a?(Hash)
|
308
|
+
{}.tap do |hash|
|
309
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
310
|
+
end
|
311
|
+
elsif value.respond_to? :to_hash
|
312
|
+
value.to_hash
|
313
|
+
else
|
314
|
+
value
|
315
|
+
end
|
316
|
+
end
|
317
|
+
end
|
318
|
+
end
|