topological_inventory-api-client 1.0.0

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