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,280 @@
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
+ # Job
18
+ class Job
19
+ # date_finished
20
+ attr_accessor :date_finished
21
+
22
+ # date_started
23
+ attr_accessor :date_started
24
+
25
+ # status
26
+ attr_accessor :status
27
+
28
+ # task_args
29
+ attr_accessor :task_args
30
+
31
+ # task_id
32
+ attr_accessor :task_id
33
+
34
+ # task_kwargs
35
+ attr_accessor :task_kwargs
36
+
37
+ # task_name
38
+ attr_accessor :task_name
39
+
40
+ # Attribute mapping from ruby-style variable name to JSON key.
41
+ def self.attribute_map
42
+ {
43
+ :'date_finished' => :'date_finished',
44
+ :'date_started' => :'date_started',
45
+ :'status' => :'status',
46
+ :'task_args' => :'task_args',
47
+ :'task_id' => :'task_id',
48
+ :'task_kwargs' => :'task_kwargs',
49
+ :'task_name' => :'task_name'
50
+ }
51
+ end
52
+
53
+ # Returns all the JSON keys this model knows about
54
+ def self.acceptable_attributes
55
+ attribute_map.values
56
+ end
57
+
58
+ # Attribute type mapping.
59
+ def self.openapi_types
60
+ {
61
+ :'date_finished' => :'Time',
62
+ :'date_started' => :'Time',
63
+ :'status' => :'String',
64
+ :'task_args' => :'String',
65
+ :'task_id' => :'String',
66
+ :'task_kwargs' => :'String',
67
+ :'task_name' => :'String'
68
+ }
69
+ end
70
+
71
+ # List of attributes with nullable: true
72
+ def self.openapi_nullable
73
+ Set.new([
74
+ ])
75
+ end
76
+
77
+ # Initializes the object
78
+ # @param [Hash] attributes Model attributes in the form of hash
79
+ def initialize(attributes = {})
80
+ if (!attributes.is_a?(Hash))
81
+ fail ArgumentError, "The input argument (attributes) must be a hash in `AutosdeOpenapiClient::Job` initialize method"
82
+ end
83
+
84
+ # check to see if the attribute exists and convert string to symbol for hash key
85
+ attributes = attributes.each_with_object({}) { |(k, v), h|
86
+ if (!self.class.attribute_map.key?(k.to_sym))
87
+ fail ArgumentError, "`#{k}` is not a valid attribute in `AutosdeOpenapiClient::Job`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
88
+ end
89
+ h[k.to_sym] = v
90
+ }
91
+
92
+ if attributes.key?(:'date_finished')
93
+ self.date_finished = attributes[:'date_finished']
94
+ end
95
+
96
+ if attributes.key?(:'date_started')
97
+ self.date_started = attributes[:'date_started']
98
+ end
99
+
100
+ if attributes.key?(:'status')
101
+ self.status = attributes[:'status']
102
+ end
103
+
104
+ if attributes.key?(:'task_args')
105
+ self.task_args = attributes[:'task_args']
106
+ end
107
+
108
+ if attributes.key?(:'task_id')
109
+ self.task_id = attributes[:'task_id']
110
+ end
111
+
112
+ if attributes.key?(:'task_kwargs')
113
+ self.task_kwargs = attributes[:'task_kwargs']
114
+ end
115
+
116
+ if attributes.key?(:'task_name')
117
+ self.task_name = attributes[:'task_name']
118
+ end
119
+ end
120
+
121
+ # Show invalid properties with the reasons. Usually used together with valid?
122
+ # @return Array for valid properties with the reasons
123
+ def list_invalid_properties
124
+ invalid_properties = Array.new
125
+ invalid_properties
126
+ end
127
+
128
+ # Check to see if the all the properties in the model are valid
129
+ # @return true if the model is valid
130
+ def valid?
131
+ true
132
+ end
133
+
134
+ # Checks equality by comparing each attribute.
135
+ # @param [Object] Object to be compared
136
+ def ==(o)
137
+ return true if self.equal?(o)
138
+ self.class == o.class &&
139
+ date_finished == o.date_finished &&
140
+ date_started == o.date_started &&
141
+ status == o.status &&
142
+ task_args == o.task_args &&
143
+ task_id == o.task_id &&
144
+ task_kwargs == o.task_kwargs &&
145
+ task_name == o.task_name
146
+ end
147
+
148
+ # @see the `==` method
149
+ # @param [Object] Object to be compared
150
+ def eql?(o)
151
+ self == o
152
+ end
153
+
154
+ # Calculates hash code according to all attributes.
155
+ # @return [Integer] Hash code
156
+ def hash
157
+ [date_finished, date_started, status, task_args, task_id, task_kwargs, task_name].hash
158
+ end
159
+
160
+ # Builds the object from hash
161
+ # @param [Hash] attributes Model attributes in the form of hash
162
+ # @return [Object] Returns the model itself
163
+ def self.build_from_hash(attributes)
164
+ new.build_from_hash(attributes)
165
+ end
166
+
167
+ # Builds the object from hash
168
+ # @param [Hash] attributes Model attributes in the form of hash
169
+ # @return [Object] Returns the model itself
170
+ def build_from_hash(attributes)
171
+ return nil unless attributes.is_a?(Hash)
172
+ self.class.openapi_types.each_pair do |key, type|
173
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
174
+ self.send("#{key}=", nil)
175
+ elsif type =~ /\AArray<(.*)>/i
176
+ # check to ensure the input is an array given that the attribute
177
+ # is documented as an array but the input is not
178
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
179
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
180
+ end
181
+ elsif !attributes[self.class.attribute_map[key]].nil?
182
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
183
+ end
184
+ end
185
+
186
+ self
187
+ end
188
+
189
+ # Deserializes the data based on type
190
+ # @param string type Data type
191
+ # @param string value Value to be deserialized
192
+ # @return [Object] Deserialized data
193
+ def _deserialize(type, value)
194
+ case type.to_sym
195
+ when :Time
196
+ Time.parse(value)
197
+ when :Date
198
+ Date.parse(value)
199
+ when :String
200
+ value.to_s
201
+ when :Integer
202
+ value.to_i
203
+ when :Float
204
+ value.to_f
205
+ when :Boolean
206
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
207
+ true
208
+ else
209
+ false
210
+ end
211
+ when :Object
212
+ # generic object (usually a Hash), return directly
213
+ value
214
+ when /\AArray<(?<inner_type>.+)>\z/
215
+ inner_type = Regexp.last_match[:inner_type]
216
+ value.map { |v| _deserialize(inner_type, v) }
217
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
218
+ k_type = Regexp.last_match[:k_type]
219
+ v_type = Regexp.last_match[:v_type]
220
+ {}.tap do |hash|
221
+ value.each do |k, v|
222
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
223
+ end
224
+ end
225
+ else # model
226
+ # models (e.g. Pet) or oneOf
227
+ klass = AutosdeOpenapiClient.const_get(type)
228
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
229
+ end
230
+ end
231
+
232
+ # Returns the string representation of the object
233
+ # @return [String] String presentation of the object
234
+ def to_s
235
+ to_hash.to_s
236
+ end
237
+
238
+ # to_body is an alias to to_hash (backward compatibility)
239
+ # @return [Hash] Returns the object in the form of hash
240
+ def to_body
241
+ to_hash
242
+ end
243
+
244
+ # Returns the object in the form of hash
245
+ # @return [Hash] Returns the object in the form of hash
246
+ def to_hash
247
+ hash = {}
248
+ self.class.attribute_map.each_pair do |attr, param|
249
+ value = self.send(attr)
250
+ if value.nil?
251
+ is_nullable = self.class.openapi_nullable.include?(attr)
252
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
253
+ end
254
+
255
+ hash[param] = _to_hash(value)
256
+ end
257
+ hash
258
+ end
259
+
260
+ # Outputs non-array value in the form of hash
261
+ # For object, use to_hash. Otherwise, just return the value
262
+ # @param [Object] value Any valid value
263
+ # @return [Hash] Returns the value in the form of hash
264
+ def _to_hash(value)
265
+ if value.is_a?(Array)
266
+ value.compact.map { |v| _to_hash(v) }
267
+ elsif value.is_a?(Hash)
268
+ {}.tap do |hash|
269
+ value.each { |k, v| hash[k] = _to_hash(v) }
270
+ end
271
+ elsif value.respond_to? :to_hash
272
+ value.to_hash
273
+ else
274
+ value
275
+ end
276
+ end
277
+
278
+ end
279
+
280
+ end
@@ -0,0 +1,230 @@
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
+ # JobCreate
18
+ class JobCreate
19
+ # task_args
20
+ attr_accessor :task_args
21
+
22
+ # task_name
23
+ attr_accessor :task_name
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+ :'task_args' => :'task_args',
29
+ :'task_name' => :'task_name'
30
+ }
31
+ end
32
+
33
+ # Returns all the JSON keys this model knows about
34
+ def self.acceptable_attributes
35
+ attribute_map.values
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.openapi_types
40
+ {
41
+ :'task_args' => :'String',
42
+ :'task_name' => :'String'
43
+ }
44
+ end
45
+
46
+ # List of attributes with nullable: true
47
+ def self.openapi_nullable
48
+ Set.new([
49
+ ])
50
+ end
51
+
52
+ # Initializes the object
53
+ # @param [Hash] attributes Model attributes in the form of hash
54
+ def initialize(attributes = {})
55
+ if (!attributes.is_a?(Hash))
56
+ fail ArgumentError, "The input argument (attributes) must be a hash in `AutosdeOpenapiClient::JobCreate` initialize method"
57
+ end
58
+
59
+ # check to see if the attribute exists and convert string to symbol for hash key
60
+ attributes = attributes.each_with_object({}) { |(k, v), h|
61
+ if (!self.class.attribute_map.key?(k.to_sym))
62
+ fail ArgumentError, "`#{k}` is not a valid attribute in `AutosdeOpenapiClient::JobCreate`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
63
+ end
64
+ h[k.to_sym] = v
65
+ }
66
+
67
+ if attributes.key?(:'task_args')
68
+ self.task_args = attributes[:'task_args']
69
+ end
70
+
71
+ if attributes.key?(:'task_name')
72
+ self.task_name = attributes[:'task_name']
73
+ end
74
+ end
75
+
76
+ # Show invalid properties with the reasons. Usually used together with valid?
77
+ # @return Array for valid properties with the reasons
78
+ def list_invalid_properties
79
+ invalid_properties = Array.new
80
+ invalid_properties
81
+ end
82
+
83
+ # Check to see if the all the properties in the model are valid
84
+ # @return true if the model is valid
85
+ def valid?
86
+ true
87
+ end
88
+
89
+ # Checks equality by comparing each attribute.
90
+ # @param [Object] Object to be compared
91
+ def ==(o)
92
+ return true if self.equal?(o)
93
+ self.class == o.class &&
94
+ task_args == o.task_args &&
95
+ task_name == o.task_name
96
+ end
97
+
98
+ # @see the `==` method
99
+ # @param [Object] Object to be compared
100
+ def eql?(o)
101
+ self == o
102
+ end
103
+
104
+ # Calculates hash code according to all attributes.
105
+ # @return [Integer] Hash code
106
+ def hash
107
+ [task_args, task_name].hash
108
+ end
109
+
110
+ # Builds the object from hash
111
+ # @param [Hash] attributes Model attributes in the form of hash
112
+ # @return [Object] Returns the model itself
113
+ def self.build_from_hash(attributes)
114
+ new.build_from_hash(attributes)
115
+ end
116
+
117
+ # Builds the object from hash
118
+ # @param [Hash] attributes Model attributes in the form of hash
119
+ # @return [Object] Returns the model itself
120
+ def build_from_hash(attributes)
121
+ return nil unless attributes.is_a?(Hash)
122
+ self.class.openapi_types.each_pair do |key, type|
123
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
124
+ self.send("#{key}=", nil)
125
+ elsif type =~ /\AArray<(.*)>/i
126
+ # check to ensure the input is an array given that the attribute
127
+ # is documented as an array but the input is not
128
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
129
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
130
+ end
131
+ elsif !attributes[self.class.attribute_map[key]].nil?
132
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
133
+ end
134
+ end
135
+
136
+ self
137
+ end
138
+
139
+ # Deserializes the data based on type
140
+ # @param string type Data type
141
+ # @param string value Value to be deserialized
142
+ # @return [Object] Deserialized data
143
+ def _deserialize(type, value)
144
+ case type.to_sym
145
+ when :Time
146
+ Time.parse(value)
147
+ when :Date
148
+ Date.parse(value)
149
+ when :String
150
+ value.to_s
151
+ when :Integer
152
+ value.to_i
153
+ when :Float
154
+ value.to_f
155
+ when :Boolean
156
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
157
+ true
158
+ else
159
+ false
160
+ end
161
+ when :Object
162
+ # generic object (usually a Hash), return directly
163
+ value
164
+ when /\AArray<(?<inner_type>.+)>\z/
165
+ inner_type = Regexp.last_match[:inner_type]
166
+ value.map { |v| _deserialize(inner_type, v) }
167
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
168
+ k_type = Regexp.last_match[:k_type]
169
+ v_type = Regexp.last_match[:v_type]
170
+ {}.tap do |hash|
171
+ value.each do |k, v|
172
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
173
+ end
174
+ end
175
+ else # model
176
+ # models (e.g. Pet) or oneOf
177
+ klass = AutosdeOpenapiClient.const_get(type)
178
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
179
+ end
180
+ end
181
+
182
+ # Returns the string representation of the object
183
+ # @return [String] String presentation of the object
184
+ def to_s
185
+ to_hash.to_s
186
+ end
187
+
188
+ # to_body is an alias to to_hash (backward compatibility)
189
+ # @return [Hash] Returns the object in the form of hash
190
+ def to_body
191
+ to_hash
192
+ end
193
+
194
+ # Returns the object in the form of hash
195
+ # @return [Hash] Returns the object in the form of hash
196
+ def to_hash
197
+ hash = {}
198
+ self.class.attribute_map.each_pair do |attr, param|
199
+ value = self.send(attr)
200
+ if value.nil?
201
+ is_nullable = self.class.openapi_nullable.include?(attr)
202
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
203
+ end
204
+
205
+ hash[param] = _to_hash(value)
206
+ end
207
+ hash
208
+ end
209
+
210
+ # Outputs non-array value in the form of hash
211
+ # For object, use to_hash. Otherwise, just return the value
212
+ # @param [Object] value Any valid value
213
+ # @return [Hash] Returns the value in the form of hash
214
+ def _to_hash(value)
215
+ if value.is_a?(Array)
216
+ value.compact.map { |v| _to_hash(v) }
217
+ elsif value.is_a?(Hash)
218
+ {}.tap do |hash|
219
+ value.each { |k, v| hash[k] = _to_hash(v) }
220
+ end
221
+ elsif value.respond_to? :to_hash
222
+ value.to_hash
223
+ else
224
+ value
225
+ end
226
+ end
227
+
228
+ end
229
+
230
+ end