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