eilam_test 1.1.12

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