autosde_openapi_client 1.0.0

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