topological_inventory-api-client 2.0.0 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (190) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +70 -0
  3. data/README.md +3 -3
  4. data/docs/DefaultApi.md +789 -301
  5. data/docs/ServiceCredential.md +41 -0
  6. data/docs/ServiceCredentialType.md +41 -0
  7. data/docs/ServiceCredentialTypesCollection.md +21 -0
  8. data/docs/ServiceCredentialsCollection.md +21 -0
  9. data/docs/ServiceInstance.md +0 -2
  10. data/docs/ServiceInstanceNode.md +0 -2
  11. data/docs/ServiceOffering.md +0 -2
  12. data/docs/ServiceOfferingNode.md +0 -2
  13. data/lib/topological_inventory-api-client/api/default_api.rb +1042 -384
  14. data/lib/topological_inventory-api-client/api_client.rb +2 -2
  15. data/lib/topological_inventory-api-client/api_error.rb +2 -2
  16. data/lib/topological_inventory-api-client/configuration.rb +8 -8
  17. data/lib/topological_inventory-api-client/models/applied_inventories_parameters_service_plan.rb +2 -2
  18. data/lib/topological_inventory-api-client/models/availabilities_collection.rb +2 -2
  19. data/lib/topological_inventory-api-client/models/availability.rb +2 -2
  20. data/lib/topological_inventory-api-client/models/cluster.rb +2 -2
  21. data/lib/topological_inventory-api-client/models/clusters_collection.rb +2 -2
  22. data/lib/topological_inventory-api-client/models/collection_links.rb +2 -2
  23. data/lib/topological_inventory-api-client/models/collection_metadata.rb +2 -2
  24. data/lib/topological_inventory-api-client/models/container.rb +2 -2
  25. data/lib/topological_inventory-api-client/models/container_group.rb +2 -2
  26. data/lib/topological_inventory-api-client/models/container_groups_collection.rb +2 -2
  27. data/lib/topological_inventory-api-client/models/container_image.rb +2 -2
  28. data/lib/topological_inventory-api-client/models/container_images_collection.rb +2 -2
  29. data/lib/topological_inventory-api-client/models/container_node.rb +2 -2
  30. data/lib/topological_inventory-api-client/models/container_nodes_collection.rb +2 -2
  31. data/lib/topological_inventory-api-client/models/container_project.rb +2 -2
  32. data/lib/topological_inventory-api-client/models/container_projects_collection.rb +2 -2
  33. data/lib/topological_inventory-api-client/models/container_resource_quota.rb +2 -2
  34. data/lib/topological_inventory-api-client/models/container_resource_quota_collection.rb +2 -2
  35. data/lib/topological_inventory-api-client/models/container_template.rb +2 -2
  36. data/lib/topological_inventory-api-client/models/container_templates_collection.rb +2 -2
  37. data/lib/topological_inventory-api-client/models/containers_collection.rb +2 -2
  38. data/lib/topological_inventory-api-client/models/datastore.rb +2 -2
  39. data/lib/topological_inventory-api-client/models/datastores_collection.rb +2 -2
  40. data/lib/topological_inventory-api-client/models/error_not_found.rb +2 -2
  41. data/lib/topological_inventory-api-client/models/error_not_found_errors.rb +2 -2
  42. data/lib/topological_inventory-api-client/models/flavor.rb +2 -2
  43. data/lib/topological_inventory-api-client/models/flavors_collection.rb +2 -2
  44. data/lib/topological_inventory-api-client/models/graph_ql_request.rb +2 -2
  45. data/lib/topological_inventory-api-client/models/graph_ql_response.rb +2 -2
  46. data/lib/topological_inventory-api-client/models/host.rb +2 -2
  47. data/lib/topological_inventory-api-client/models/hosts_collection.rb +2 -2
  48. data/lib/topological_inventory-api-client/models/inline_response200.rb +2 -2
  49. data/lib/topological_inventory-api-client/models/ipaddress.rb +2 -2
  50. data/lib/topological_inventory-api-client/models/ipaddresses_collection.rb +2 -2
  51. data/lib/topological_inventory-api-client/models/network.rb +2 -2
  52. data/lib/topological_inventory-api-client/models/network_adapter.rb +2 -2
  53. data/lib/topological_inventory-api-client/models/network_adapters_collection.rb +2 -2
  54. data/lib/topological_inventory-api-client/models/networks_collection.rb +2 -2
  55. data/lib/topological_inventory-api-client/models/orchestration_stack.rb +2 -2
  56. data/lib/topological_inventory-api-client/models/orchestration_stacks_collection.rb +2 -2
  57. data/lib/topological_inventory-api-client/models/order_parameters_service_offering.rb +2 -2
  58. data/lib/topological_inventory-api-client/models/order_parameters_service_plan.rb +2 -2
  59. data/lib/topological_inventory-api-client/models/security_group.rb +2 -2
  60. data/lib/topological_inventory-api-client/models/security_groups_collection.rb +2 -2
  61. data/lib/topological_inventory-api-client/models/service_credential.rb +368 -0
  62. data/lib/topological_inventory-api-client/models/service_credential_type.rb +350 -0
  63. data/lib/topological_inventory-api-client/models/service_credential_types_collection.rb +226 -0
  64. data/lib/topological_inventory-api-client/models/service_credentials_collection.rb +226 -0
  65. data/lib/topological_inventory-api-client/models/service_instance.rb +3 -30
  66. data/lib/topological_inventory-api-client/models/service_instance_node.rb +3 -30
  67. data/lib/topological_inventory-api-client/models/service_instance_nodes_collection.rb +2 -2
  68. data/lib/topological_inventory-api-client/models/service_instances_collection.rb +2 -2
  69. data/lib/topological_inventory-api-client/models/service_inventories_collection.rb +2 -2
  70. data/lib/topological_inventory-api-client/models/service_inventory.rb +2 -2
  71. data/lib/topological_inventory-api-client/models/service_offering.rb +3 -30
  72. data/lib/topological_inventory-api-client/models/service_offering_icon.rb +2 -2
  73. data/lib/topological_inventory-api-client/models/service_offering_icons_collection.rb +2 -2
  74. data/lib/topological_inventory-api-client/models/service_offering_node.rb +3 -30
  75. data/lib/topological_inventory-api-client/models/service_offering_nodes_collection.rb +2 -2
  76. data/lib/topological_inventory-api-client/models/service_offerings_collection.rb +2 -2
  77. data/lib/topological_inventory-api-client/models/service_plan.rb +2 -2
  78. data/lib/topological_inventory-api-client/models/service_plans_collection.rb +2 -2
  79. data/lib/topological_inventory-api-client/models/source.rb +2 -2
  80. data/lib/topological_inventory-api-client/models/source_region.rb +2 -2
  81. data/lib/topological_inventory-api-client/models/source_regions_collection.rb +2 -2
  82. data/lib/topological_inventory-api-client/models/sources_collection.rb +2 -2
  83. data/lib/topological_inventory-api-client/models/subnet.rb +2 -2
  84. data/lib/topological_inventory-api-client/models/subnets_collection.rb +2 -2
  85. data/lib/topological_inventory-api-client/models/subscription.rb +2 -2
  86. data/lib/topological_inventory-api-client/models/subscriptions_collection.rb +2 -2
  87. data/lib/topological_inventory-api-client/models/tag.rb +2 -2
  88. data/lib/topological_inventory-api-client/models/tags_collection.rb +2 -2
  89. data/lib/topological_inventory-api-client/models/task.rb +2 -2
  90. data/lib/topological_inventory-api-client/models/tasks_collection.rb +2 -2
  91. data/lib/topological_inventory-api-client/models/tenant.rb +2 -2
  92. data/lib/topological_inventory-api-client/models/vm.rb +2 -2
  93. data/lib/topological_inventory-api-client/models/vms_collection.rb +2 -2
  94. data/lib/topological_inventory-api-client/models/volume.rb +2 -2
  95. data/lib/topological_inventory-api-client/models/volume_attachment.rb +2 -2
  96. data/lib/topological_inventory-api-client/models/volume_attachments_collection.rb +2 -2
  97. data/lib/topological_inventory-api-client/models/volume_type.rb +2 -2
  98. data/lib/topological_inventory-api-client/models/volume_types_collection.rb +2 -2
  99. data/lib/topological_inventory-api-client/models/volumes_collection.rb +2 -2
  100. data/lib/topological_inventory-api-client/version.rb +3 -3
  101. data/lib/topological_inventory-api-client.rb +6 -2
  102. data/spec/api/default_api_spec.rb +270 -152
  103. data/spec/api_client_spec.rb +2 -2
  104. data/spec/configuration_spec.rb +5 -5
  105. data/spec/models/applied_inventories_parameters_service_plan_spec.rb +2 -2
  106. data/spec/models/availabilities_collection_spec.rb +2 -2
  107. data/spec/models/availability_spec.rb +2 -2
  108. data/spec/models/cluster_spec.rb +2 -2
  109. data/spec/models/clusters_collection_spec.rb +2 -2
  110. data/spec/models/collection_links_spec.rb +2 -2
  111. data/spec/models/collection_metadata_spec.rb +2 -2
  112. data/spec/models/container_group_spec.rb +2 -2
  113. data/spec/models/container_groups_collection_spec.rb +2 -2
  114. data/spec/models/container_image_spec.rb +2 -2
  115. data/spec/models/container_images_collection_spec.rb +2 -2
  116. data/spec/models/container_node_spec.rb +2 -2
  117. data/spec/models/container_nodes_collection_spec.rb +2 -2
  118. data/spec/models/container_project_spec.rb +2 -2
  119. data/spec/models/container_projects_collection_spec.rb +2 -2
  120. data/spec/models/container_resource_quota_collection_spec.rb +2 -2
  121. data/spec/models/container_resource_quota_spec.rb +2 -2
  122. data/spec/models/container_spec.rb +2 -2
  123. data/spec/models/container_template_spec.rb +2 -2
  124. data/spec/models/container_templates_collection_spec.rb +2 -2
  125. data/spec/models/containers_collection_spec.rb +2 -2
  126. data/spec/models/datastore_spec.rb +2 -2
  127. data/spec/models/datastores_collection_spec.rb +2 -2
  128. data/spec/models/error_not_found_errors_spec.rb +2 -2
  129. data/spec/models/error_not_found_spec.rb +2 -2
  130. data/spec/models/flavor_spec.rb +2 -2
  131. data/spec/models/flavors_collection_spec.rb +2 -2
  132. data/spec/models/graph_ql_request_spec.rb +2 -2
  133. data/spec/models/graph_ql_response_spec.rb +2 -2
  134. data/spec/models/host_spec.rb +2 -2
  135. data/spec/models/hosts_collection_spec.rb +2 -2
  136. data/spec/models/inline_response200_spec.rb +2 -2
  137. data/spec/models/ipaddress_spec.rb +2 -2
  138. data/spec/models/ipaddresses_collection_spec.rb +2 -2
  139. data/spec/models/network_adapter_spec.rb +2 -2
  140. data/spec/models/network_adapters_collection_spec.rb +2 -2
  141. data/spec/models/network_spec.rb +2 -2
  142. data/spec/models/networks_collection_spec.rb +2 -2
  143. data/spec/models/orchestration_stack_spec.rb +2 -2
  144. data/spec/models/orchestration_stacks_collection_spec.rb +2 -2
  145. data/spec/models/order_parameters_service_offering_spec.rb +2 -2
  146. data/spec/models/order_parameters_service_plan_spec.rb +2 -2
  147. data/spec/models/security_group_spec.rb +2 -2
  148. data/spec/models/security_groups_collection_spec.rb +2 -2
  149. data/spec/models/service_credential_spec.rb +113 -0
  150. data/spec/models/service_credential_type_spec.rb +113 -0
  151. data/spec/models/service_credential_types_collection_spec.rb +53 -0
  152. data/spec/models/service_credentials_collection_spec.rb +53 -0
  153. data/spec/models/service_instance_node_spec.rb +2 -8
  154. data/spec/models/service_instance_nodes_collection_spec.rb +2 -2
  155. data/spec/models/service_instance_spec.rb +2 -8
  156. data/spec/models/service_instances_collection_spec.rb +2 -2
  157. data/spec/models/service_inventories_collection_spec.rb +2 -2
  158. data/spec/models/service_inventory_spec.rb +2 -2
  159. data/spec/models/service_offering_icon_spec.rb +2 -2
  160. data/spec/models/service_offering_icons_collection_spec.rb +2 -2
  161. data/spec/models/service_offering_node_spec.rb +2 -8
  162. data/spec/models/service_offering_nodes_collection_spec.rb +2 -2
  163. data/spec/models/service_offering_spec.rb +2 -8
  164. data/spec/models/service_offerings_collection_spec.rb +2 -2
  165. data/spec/models/service_plan_spec.rb +2 -2
  166. data/spec/models/service_plans_collection_spec.rb +2 -2
  167. data/spec/models/source_region_spec.rb +2 -2
  168. data/spec/models/source_regions_collection_spec.rb +2 -2
  169. data/spec/models/source_spec.rb +2 -2
  170. data/spec/models/sources_collection_spec.rb +2 -2
  171. data/spec/models/subnet_spec.rb +2 -2
  172. data/spec/models/subnets_collection_spec.rb +2 -2
  173. data/spec/models/subscription_spec.rb +2 -2
  174. data/spec/models/subscriptions_collection_spec.rb +2 -2
  175. data/spec/models/tag_spec.rb +2 -2
  176. data/spec/models/tags_collection_spec.rb +2 -2
  177. data/spec/models/task_spec.rb +2 -2
  178. data/spec/models/tasks_collection_spec.rb +2 -2
  179. data/spec/models/tenant_spec.rb +2 -2
  180. data/spec/models/vm_spec.rb +2 -2
  181. data/spec/models/vms_collection_spec.rb +2 -2
  182. data/spec/models/volume_attachment_spec.rb +2 -2
  183. data/spec/models/volume_attachments_collection_spec.rb +2 -2
  184. data/spec/models/volume_spec.rb +2 -2
  185. data/spec/models/volume_type_spec.rb +2 -2
  186. data/spec/models/volume_types_collection_spec.rb +2 -2
  187. data/spec/models/volumes_collection_spec.rb +2 -2
  188. data/spec/spec_helper.rb +2 -2
  189. data/topological_inventory-api-client.gemspec +2 -2
  190. metadata +86 -69
@@ -3,10 +3,10 @@
3
3
 
4
4
  #Topological Inventory
5
5
 
6
- The version of the OpenAPI document: 2.0.0
6
+ The version of the OpenAPI document: 3.0.0
7
7
  Contact: support@redhat.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.2.1
9
+ OpenAPI Generator version: 4.2.3
10
10
 
11
11
  =end
12
12
 
@@ -3,10 +3,10 @@
3
3
 
4
4
  #Topological Inventory
5
5
 
6
- The version of the OpenAPI document: 2.0.0
6
+ The version of the OpenAPI document: 3.0.0
7
7
  Contact: support@redhat.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.2.1
9
+ OpenAPI Generator version: 4.2.3
10
10
 
11
11
  =end
12
12
 
@@ -3,10 +3,10 @@
3
3
 
4
4
  #Topological Inventory
5
5
 
6
- The version of the OpenAPI document: 2.0.0
6
+ The version of the OpenAPI document: 3.0.0
7
7
  Contact: support@redhat.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.2.1
9
+ OpenAPI Generator version: 4.2.3
10
10
 
11
11
  =end
12
12
 
@@ -0,0 +1,368 @@
1
+ =begin
2
+ #Topological Inventory
3
+
4
+ #Topological Inventory
5
+
6
+ The version of the OpenAPI document: 3.0.0
7
+ Contact: support@redhat.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.2.3
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module TopologicalInventoryApiClient
16
+ class ServiceCredential
17
+ attr_accessor :archived_at
18
+
19
+ attr_accessor :created_at
20
+
21
+ attr_accessor :description
22
+
23
+ # ID of the resource
24
+ attr_accessor :id
25
+
26
+ attr_accessor :last_seen_at
27
+
28
+ attr_accessor :name
29
+
30
+ # ID of the resource
31
+ attr_accessor :service_credential_type_id
32
+
33
+ attr_accessor :source_created_at
34
+
35
+ # ID of the resource
36
+ attr_accessor :source_id
37
+
38
+ attr_accessor :source_ref
39
+
40
+ attr_accessor :source_updated_at
41
+
42
+ attr_accessor :type_name
43
+
44
+ attr_accessor :updated_at
45
+
46
+ # Attribute mapping from ruby-style variable name to JSON key.
47
+ def self.attribute_map
48
+ {
49
+ :'archived_at' => :'archived_at',
50
+ :'created_at' => :'created_at',
51
+ :'description' => :'description',
52
+ :'id' => :'id',
53
+ :'last_seen_at' => :'last_seen_at',
54
+ :'name' => :'name',
55
+ :'service_credential_type_id' => :'service_credential_type_id',
56
+ :'source_created_at' => :'source_created_at',
57
+ :'source_id' => :'source_id',
58
+ :'source_ref' => :'source_ref',
59
+ :'source_updated_at' => :'source_updated_at',
60
+ :'type_name' => :'type_name',
61
+ :'updated_at' => :'updated_at'
62
+ }
63
+ end
64
+
65
+ # Attribute type mapping.
66
+ def self.openapi_types
67
+ {
68
+ :'archived_at' => :'DateTime',
69
+ :'created_at' => :'DateTime',
70
+ :'description' => :'String',
71
+ :'id' => :'String',
72
+ :'last_seen_at' => :'DateTime',
73
+ :'name' => :'String',
74
+ :'service_credential_type_id' => :'String',
75
+ :'source_created_at' => :'DateTime',
76
+ :'source_id' => :'String',
77
+ :'source_ref' => :'String',
78
+ :'source_updated_at' => :'DateTime',
79
+ :'type_name' => :'String',
80
+ :'updated_at' => :'DateTime'
81
+ }
82
+ end
83
+
84
+ # List of attributes with nullable: true
85
+ def self.openapi_nullable
86
+ Set.new([
87
+ ])
88
+ end
89
+
90
+ # Initializes the object
91
+ # @param [Hash] attributes Model attributes in the form of hash
92
+ def initialize(attributes = {})
93
+ if (!attributes.is_a?(Hash))
94
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TopologicalInventoryApiClient::ServiceCredential` initialize method"
95
+ end
96
+
97
+ # check to see if the attribute exists and convert string to symbol for hash key
98
+ attributes = attributes.each_with_object({}) { |(k, v), h|
99
+ if (!self.class.attribute_map.key?(k.to_sym))
100
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TopologicalInventoryApiClient::ServiceCredential`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
101
+ end
102
+ h[k.to_sym] = v
103
+ }
104
+
105
+ if attributes.key?(:'archived_at')
106
+ self.archived_at = attributes[:'archived_at']
107
+ end
108
+
109
+ if attributes.key?(:'created_at')
110
+ self.created_at = attributes[:'created_at']
111
+ end
112
+
113
+ if attributes.key?(:'description')
114
+ self.description = attributes[:'description']
115
+ end
116
+
117
+ if attributes.key?(:'id')
118
+ self.id = attributes[:'id']
119
+ end
120
+
121
+ if attributes.key?(:'last_seen_at')
122
+ self.last_seen_at = attributes[:'last_seen_at']
123
+ end
124
+
125
+ if attributes.key?(:'name')
126
+ self.name = attributes[:'name']
127
+ end
128
+
129
+ if attributes.key?(:'service_credential_type_id')
130
+ self.service_credential_type_id = attributes[:'service_credential_type_id']
131
+ end
132
+
133
+ if attributes.key?(:'source_created_at')
134
+ self.source_created_at = attributes[:'source_created_at']
135
+ end
136
+
137
+ if attributes.key?(:'source_id')
138
+ self.source_id = attributes[:'source_id']
139
+ end
140
+
141
+ if attributes.key?(:'source_ref')
142
+ self.source_ref = attributes[:'source_ref']
143
+ end
144
+
145
+ if attributes.key?(:'source_updated_at')
146
+ self.source_updated_at = attributes[:'source_updated_at']
147
+ end
148
+
149
+ if attributes.key?(:'type_name')
150
+ self.type_name = attributes[:'type_name']
151
+ end
152
+
153
+ if attributes.key?(:'updated_at')
154
+ self.updated_at = attributes[:'updated_at']
155
+ end
156
+ end
157
+
158
+ # Show invalid properties with the reasons. Usually used together with valid?
159
+ # @return Array for valid properties with the reasons
160
+ def list_invalid_properties
161
+ invalid_properties = Array.new
162
+ pattern = Regexp.new(/^\d+$/)
163
+ if !@id.nil? && @id !~ pattern
164
+ invalid_properties.push("invalid value for \"id\", must conform to the pattern #{pattern}.")
165
+ end
166
+
167
+ pattern = Regexp.new(/^\d+$/)
168
+ if !@service_credential_type_id.nil? && @service_credential_type_id !~ pattern
169
+ invalid_properties.push("invalid value for \"service_credential_type_id\", must conform to the pattern #{pattern}.")
170
+ end
171
+
172
+ pattern = Regexp.new(/^\d+$/)
173
+ if !@source_id.nil? && @source_id !~ pattern
174
+ invalid_properties.push("invalid value for \"source_id\", must conform to the pattern #{pattern}.")
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
+ return false if !@id.nil? && @id !~ Regexp.new(/^\d+$/)
184
+ return false if !@service_credential_type_id.nil? && @service_credential_type_id !~ Regexp.new(/^\d+$/)
185
+ return false if !@source_id.nil? && @source_id !~ Regexp.new(/^\d+$/)
186
+ true
187
+ end
188
+
189
+ # Custom attribute writer method with validation
190
+ # @param [Object] id Value to be assigned
191
+ def id=(id)
192
+ pattern = Regexp.new(/^\d+$/)
193
+ if !id.nil? && id !~ pattern
194
+ fail ArgumentError, "invalid value for \"id\", must conform to the pattern #{pattern}."
195
+ end
196
+
197
+ @id = id
198
+ end
199
+
200
+ # Custom attribute writer method with validation
201
+ # @param [Object] service_credential_type_id Value to be assigned
202
+ def service_credential_type_id=(service_credential_type_id)
203
+ pattern = Regexp.new(/^\d+$/)
204
+ if !service_credential_type_id.nil? && service_credential_type_id !~ pattern
205
+ fail ArgumentError, "invalid value for \"service_credential_type_id\", must conform to the pattern #{pattern}."
206
+ end
207
+
208
+ @service_credential_type_id = service_credential_type_id
209
+ end
210
+
211
+ # Custom attribute writer method with validation
212
+ # @param [Object] source_id Value to be assigned
213
+ def source_id=(source_id)
214
+ pattern = Regexp.new(/^\d+$/)
215
+ if !source_id.nil? && source_id !~ pattern
216
+ fail ArgumentError, "invalid value for \"source_id\", must conform to the pattern #{pattern}."
217
+ end
218
+
219
+ @source_id = source_id
220
+ end
221
+
222
+ # Checks equality by comparing each attribute.
223
+ # @param [Object] Object to be compared
224
+ def ==(o)
225
+ return true if self.equal?(o)
226
+ self.class == o.class &&
227
+ archived_at == o.archived_at &&
228
+ created_at == o.created_at &&
229
+ description == o.description &&
230
+ id == o.id &&
231
+ last_seen_at == o.last_seen_at &&
232
+ name == o.name &&
233
+ service_credential_type_id == o.service_credential_type_id &&
234
+ source_created_at == o.source_created_at &&
235
+ source_id == o.source_id &&
236
+ source_ref == o.source_ref &&
237
+ source_updated_at == o.source_updated_at &&
238
+ type_name == o.type_name &&
239
+ updated_at == o.updated_at
240
+ end
241
+
242
+ # @see the `==` method
243
+ # @param [Object] Object to be compared
244
+ def eql?(o)
245
+ self == o
246
+ end
247
+
248
+ # Calculates hash code according to all attributes.
249
+ # @return [Integer] Hash code
250
+ def hash
251
+ [archived_at, created_at, description, id, last_seen_at, name, service_credential_type_id, source_created_at, source_id, source_ref, source_updated_at, type_name, updated_at].hash
252
+ end
253
+
254
+ # Builds the object from hash
255
+ # @param [Hash] attributes Model attributes in the form of hash
256
+ # @return [Object] Returns the model itself
257
+ def self.build_from_hash(attributes)
258
+ new.build_from_hash(attributes)
259
+ end
260
+
261
+ # Builds the object from hash
262
+ # @param [Hash] attributes Model attributes in the form of hash
263
+ # @return [Object] Returns the model itself
264
+ def build_from_hash(attributes)
265
+ return nil unless attributes.is_a?(Hash)
266
+ self.class.openapi_types.each_pair do |key, type|
267
+ if type =~ /\AArray<(.*)>/i
268
+ # check to ensure the input is an array given that the attribute
269
+ # is documented as an array but the input is not
270
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
271
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
272
+ end
273
+ elsif !attributes[self.class.attribute_map[key]].nil?
274
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
275
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
276
+ end
277
+
278
+ self
279
+ end
280
+
281
+ # Deserializes the data based on type
282
+ # @param string type Data type
283
+ # @param string value Value to be deserialized
284
+ # @return [Object] Deserialized data
285
+ def _deserialize(type, value)
286
+ case type.to_sym
287
+ when :DateTime
288
+ DateTime.parse(value)
289
+ when :Date
290
+ Date.parse(value)
291
+ when :String
292
+ value.to_s
293
+ when :Integer
294
+ value.to_i
295
+ when :Float
296
+ value.to_f
297
+ when :Boolean
298
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
299
+ true
300
+ else
301
+ false
302
+ end
303
+ when :Object
304
+ # generic object (usually a Hash), return directly
305
+ value
306
+ when /\AArray<(?<inner_type>.+)>\z/
307
+ inner_type = Regexp.last_match[:inner_type]
308
+ value.map { |v| _deserialize(inner_type, v) }
309
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
310
+ k_type = Regexp.last_match[:k_type]
311
+ v_type = Regexp.last_match[:v_type]
312
+ {}.tap do |hash|
313
+ value.each do |k, v|
314
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
315
+ end
316
+ end
317
+ else # model
318
+ TopologicalInventoryApiClient.const_get(type).build_from_hash(value)
319
+ end
320
+ end
321
+
322
+ # Returns the string representation of the object
323
+ # @return [String] String presentation of the object
324
+ def to_s
325
+ to_hash.to_s
326
+ end
327
+
328
+ # to_body is an alias to to_hash (backward compatibility)
329
+ # @return [Hash] Returns the object in the form of hash
330
+ def to_body
331
+ to_hash
332
+ end
333
+
334
+ # Returns the object in the form of hash
335
+ # @return [Hash] Returns the object in the form of hash
336
+ def to_hash
337
+ hash = {}
338
+ self.class.attribute_map.each_pair do |attr, param|
339
+ value = self.send(attr)
340
+ if value.nil?
341
+ is_nullable = self.class.openapi_nullable.include?(attr)
342
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
343
+ end
344
+
345
+ hash[param] = _to_hash(value)
346
+ end
347
+ hash
348
+ end
349
+
350
+ # Outputs non-array value in the form of hash
351
+ # For object, use to_hash. Otherwise, just return the value
352
+ # @param [Object] value Any valid value
353
+ # @return [Hash] Returns the value in the form of hash
354
+ def _to_hash(value)
355
+ if value.is_a?(Array)
356
+ value.compact.map { |v| _to_hash(v) }
357
+ elsif value.is_a?(Hash)
358
+ {}.tap do |hash|
359
+ value.each { |k, v| hash[k] = _to_hash(v) }
360
+ end
361
+ elsif value.respond_to? :to_hash
362
+ value.to_hash
363
+ else
364
+ value
365
+ end
366
+ end
367
+ end
368
+ end