autosde_openapi_client 1.0.0 → 1.0.21

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