topological_inventory-api-client 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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,504 @@
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 ServiceInstance
17
+ attr_accessor :archived_at
18
+
19
+ attr_accessor :created_at
20
+
21
+ attr_accessor :external_url
22
+
23
+ # Extra information about this object in JSON format
24
+ attr_accessor :extra
25
+
26
+ # ID of the resource
27
+ attr_accessor :id
28
+
29
+ attr_accessor :last_seen_at
30
+
31
+ attr_accessor :name
32
+
33
+ # ID of the resource
34
+ attr_accessor :root_service_instance_id
35
+
36
+ # ID of the resource
37
+ attr_accessor :service_inventory_id
38
+
39
+ # ID of the resource
40
+ attr_accessor :service_offering_id
41
+
42
+ # ID of the resource
43
+ attr_accessor :service_plan_id
44
+
45
+ attr_accessor :source_created_at
46
+
47
+ attr_accessor :source_deleted_at
48
+
49
+ # ID of the resource
50
+ attr_accessor :source_id
51
+
52
+ attr_accessor :source_ref
53
+
54
+ # ID of the resource
55
+ attr_accessor :source_region_id
56
+
57
+ # ID of the resource
58
+ attr_accessor :subscription_id
59
+
60
+ attr_accessor :updated_at
61
+
62
+ # Attribute mapping from ruby-style variable name to JSON key.
63
+ def self.attribute_map
64
+ {
65
+ :'archived_at' => :'archived_at',
66
+ :'created_at' => :'created_at',
67
+ :'external_url' => :'external_url',
68
+ :'extra' => :'extra',
69
+ :'id' => :'id',
70
+ :'last_seen_at' => :'last_seen_at',
71
+ :'name' => :'name',
72
+ :'root_service_instance_id' => :'root_service_instance_id',
73
+ :'service_inventory_id' => :'service_inventory_id',
74
+ :'service_offering_id' => :'service_offering_id',
75
+ :'service_plan_id' => :'service_plan_id',
76
+ :'source_created_at' => :'source_created_at',
77
+ :'source_deleted_at' => :'source_deleted_at',
78
+ :'source_id' => :'source_id',
79
+ :'source_ref' => :'source_ref',
80
+ :'source_region_id' => :'source_region_id',
81
+ :'subscription_id' => :'subscription_id',
82
+ :'updated_at' => :'updated_at'
83
+ }
84
+ end
85
+
86
+ # Attribute type mapping.
87
+ def self.openapi_types
88
+ {
89
+ :'archived_at' => :'DateTime',
90
+ :'created_at' => :'DateTime',
91
+ :'external_url' => :'String',
92
+ :'extra' => :'Object',
93
+ :'id' => :'String',
94
+ :'last_seen_at' => :'DateTime',
95
+ :'name' => :'String',
96
+ :'root_service_instance_id' => :'String',
97
+ :'service_inventory_id' => :'String',
98
+ :'service_offering_id' => :'String',
99
+ :'service_plan_id' => :'String',
100
+ :'source_created_at' => :'DateTime',
101
+ :'source_deleted_at' => :'DateTime',
102
+ :'source_id' => :'String',
103
+ :'source_ref' => :'String',
104
+ :'source_region_id' => :'String',
105
+ :'subscription_id' => :'String',
106
+ :'updated_at' => :'DateTime'
107
+ }
108
+ end
109
+
110
+ # List of attributes with nullable: true
111
+ def self.openapi_nullable
112
+ Set.new([
113
+ ])
114
+ end
115
+
116
+ # Initializes the object
117
+ # @param [Hash] attributes Model attributes in the form of hash
118
+ def initialize(attributes = {})
119
+ if (!attributes.is_a?(Hash))
120
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TopologicalInventoryApiClient::ServiceInstance` initialize method"
121
+ end
122
+
123
+ # check to see if the attribute exists and convert string to symbol for hash key
124
+ attributes = attributes.each_with_object({}) { |(k, v), h|
125
+ if (!self.class.attribute_map.key?(k.to_sym))
126
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TopologicalInventoryApiClient::ServiceInstance`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
127
+ end
128
+ h[k.to_sym] = v
129
+ }
130
+
131
+ if attributes.key?(:'archived_at')
132
+ self.archived_at = attributes[:'archived_at']
133
+ end
134
+
135
+ if attributes.key?(:'created_at')
136
+ self.created_at = attributes[:'created_at']
137
+ end
138
+
139
+ if attributes.key?(:'external_url')
140
+ self.external_url = attributes[:'external_url']
141
+ end
142
+
143
+ if attributes.key?(:'extra')
144
+ self.extra = attributes[:'extra']
145
+ end
146
+
147
+ if attributes.key?(:'id')
148
+ self.id = attributes[:'id']
149
+ end
150
+
151
+ if attributes.key?(:'last_seen_at')
152
+ self.last_seen_at = attributes[:'last_seen_at']
153
+ end
154
+
155
+ if attributes.key?(:'name')
156
+ self.name = attributes[:'name']
157
+ end
158
+
159
+ if attributes.key?(:'root_service_instance_id')
160
+ self.root_service_instance_id = attributes[:'root_service_instance_id']
161
+ end
162
+
163
+ if attributes.key?(:'service_inventory_id')
164
+ self.service_inventory_id = attributes[:'service_inventory_id']
165
+ end
166
+
167
+ if attributes.key?(:'service_offering_id')
168
+ self.service_offering_id = attributes[:'service_offering_id']
169
+ end
170
+
171
+ if attributes.key?(:'service_plan_id')
172
+ self.service_plan_id = attributes[:'service_plan_id']
173
+ end
174
+
175
+ if attributes.key?(:'source_created_at')
176
+ self.source_created_at = attributes[:'source_created_at']
177
+ end
178
+
179
+ if attributes.key?(:'source_deleted_at')
180
+ self.source_deleted_at = attributes[:'source_deleted_at']
181
+ end
182
+
183
+ if attributes.key?(:'source_id')
184
+ self.source_id = attributes[:'source_id']
185
+ end
186
+
187
+ if attributes.key?(:'source_ref')
188
+ self.source_ref = attributes[:'source_ref']
189
+ end
190
+
191
+ if attributes.key?(:'source_region_id')
192
+ self.source_region_id = attributes[:'source_region_id']
193
+ end
194
+
195
+ if attributes.key?(:'subscription_id')
196
+ self.subscription_id = attributes[:'subscription_id']
197
+ end
198
+
199
+ if attributes.key?(:'updated_at')
200
+ self.updated_at = attributes[:'updated_at']
201
+ end
202
+ end
203
+
204
+ # Show invalid properties with the reasons. Usually used together with valid?
205
+ # @return Array for valid properties with the reasons
206
+ def list_invalid_properties
207
+ invalid_properties = Array.new
208
+ pattern = Regexp.new(/^\d+$/)
209
+ if !@id.nil? && @id !~ pattern
210
+ invalid_properties.push("invalid value for \"id\", must conform to the pattern #{pattern}.")
211
+ end
212
+
213
+ pattern = Regexp.new(/^\d+$/)
214
+ if !@root_service_instance_id.nil? && @root_service_instance_id !~ pattern
215
+ invalid_properties.push("invalid value for \"root_service_instance_id\", must conform to the pattern #{pattern}.")
216
+ end
217
+
218
+ pattern = Regexp.new(/^\d+$/)
219
+ if !@service_inventory_id.nil? && @service_inventory_id !~ pattern
220
+ invalid_properties.push("invalid value for \"service_inventory_id\", must conform to the pattern #{pattern}.")
221
+ end
222
+
223
+ pattern = Regexp.new(/^\d+$/)
224
+ if !@service_offering_id.nil? && @service_offering_id !~ pattern
225
+ invalid_properties.push("invalid value for \"service_offering_id\", must conform to the pattern #{pattern}.")
226
+ end
227
+
228
+ pattern = Regexp.new(/^\d+$/)
229
+ if !@service_plan_id.nil? && @service_plan_id !~ pattern
230
+ invalid_properties.push("invalid value for \"service_plan_id\", must conform to the pattern #{pattern}.")
231
+ end
232
+
233
+ pattern = Regexp.new(/^\d+$/)
234
+ if !@source_id.nil? && @source_id !~ pattern
235
+ invalid_properties.push("invalid value for \"source_id\", must conform to the pattern #{pattern}.")
236
+ end
237
+
238
+ pattern = Regexp.new(/^\d+$/)
239
+ if !@source_region_id.nil? && @source_region_id !~ pattern
240
+ invalid_properties.push("invalid value for \"source_region_id\", must conform to the pattern #{pattern}.")
241
+ end
242
+
243
+ pattern = Regexp.new(/^\d+$/)
244
+ if !@subscription_id.nil? && @subscription_id !~ pattern
245
+ invalid_properties.push("invalid value for \"subscription_id\", must conform to the pattern #{pattern}.")
246
+ end
247
+
248
+ invalid_properties
249
+ end
250
+
251
+ # Check to see if the all the properties in the model are valid
252
+ # @return true if the model is valid
253
+ def valid?
254
+ return false if !@id.nil? && @id !~ Regexp.new(/^\d+$/)
255
+ return false if !@root_service_instance_id.nil? && @root_service_instance_id !~ Regexp.new(/^\d+$/)
256
+ return false if !@service_inventory_id.nil? && @service_inventory_id !~ Regexp.new(/^\d+$/)
257
+ return false if !@service_offering_id.nil? && @service_offering_id !~ Regexp.new(/^\d+$/)
258
+ return false if !@service_plan_id.nil? && @service_plan_id !~ Regexp.new(/^\d+$/)
259
+ return false if !@source_id.nil? && @source_id !~ Regexp.new(/^\d+$/)
260
+ return false if !@source_region_id.nil? && @source_region_id !~ Regexp.new(/^\d+$/)
261
+ return false if !@subscription_id.nil? && @subscription_id !~ Regexp.new(/^\d+$/)
262
+ true
263
+ end
264
+
265
+ # Custom attribute writer method with validation
266
+ # @param [Object] id Value to be assigned
267
+ def id=(id)
268
+ pattern = Regexp.new(/^\d+$/)
269
+ if !id.nil? && id !~ pattern
270
+ fail ArgumentError, "invalid value for \"id\", must conform to the pattern #{pattern}."
271
+ end
272
+
273
+ @id = id
274
+ end
275
+
276
+ # Custom attribute writer method with validation
277
+ # @param [Object] root_service_instance_id Value to be assigned
278
+ def root_service_instance_id=(root_service_instance_id)
279
+ pattern = Regexp.new(/^\d+$/)
280
+ if !root_service_instance_id.nil? && root_service_instance_id !~ pattern
281
+ fail ArgumentError, "invalid value for \"root_service_instance_id\", must conform to the pattern #{pattern}."
282
+ end
283
+
284
+ @root_service_instance_id = root_service_instance_id
285
+ end
286
+
287
+ # Custom attribute writer method with validation
288
+ # @param [Object] service_inventory_id Value to be assigned
289
+ def service_inventory_id=(service_inventory_id)
290
+ pattern = Regexp.new(/^\d+$/)
291
+ if !service_inventory_id.nil? && service_inventory_id !~ pattern
292
+ fail ArgumentError, "invalid value for \"service_inventory_id\", must conform to the pattern #{pattern}."
293
+ end
294
+
295
+ @service_inventory_id = service_inventory_id
296
+ end
297
+
298
+ # Custom attribute writer method with validation
299
+ # @param [Object] service_offering_id Value to be assigned
300
+ def service_offering_id=(service_offering_id)
301
+ pattern = Regexp.new(/^\d+$/)
302
+ if !service_offering_id.nil? && service_offering_id !~ pattern
303
+ fail ArgumentError, "invalid value for \"service_offering_id\", must conform to the pattern #{pattern}."
304
+ end
305
+
306
+ @service_offering_id = service_offering_id
307
+ end
308
+
309
+ # Custom attribute writer method with validation
310
+ # @param [Object] service_plan_id Value to be assigned
311
+ def service_plan_id=(service_plan_id)
312
+ pattern = Regexp.new(/^\d+$/)
313
+ if !service_plan_id.nil? && service_plan_id !~ pattern
314
+ fail ArgumentError, "invalid value for \"service_plan_id\", must conform to the pattern #{pattern}."
315
+ end
316
+
317
+ @service_plan_id = service_plan_id
318
+ end
319
+
320
+ # Custom attribute writer method with validation
321
+ # @param [Object] source_id Value to be assigned
322
+ def source_id=(source_id)
323
+ pattern = Regexp.new(/^\d+$/)
324
+ if !source_id.nil? && source_id !~ pattern
325
+ fail ArgumentError, "invalid value for \"source_id\", must conform to the pattern #{pattern}."
326
+ end
327
+
328
+ @source_id = source_id
329
+ end
330
+
331
+ # Custom attribute writer method with validation
332
+ # @param [Object] source_region_id Value to be assigned
333
+ def source_region_id=(source_region_id)
334
+ pattern = Regexp.new(/^\d+$/)
335
+ if !source_region_id.nil? && source_region_id !~ pattern
336
+ fail ArgumentError, "invalid value for \"source_region_id\", must conform to the pattern #{pattern}."
337
+ end
338
+
339
+ @source_region_id = source_region_id
340
+ end
341
+
342
+ # Custom attribute writer method with validation
343
+ # @param [Object] subscription_id Value to be assigned
344
+ def subscription_id=(subscription_id)
345
+ pattern = Regexp.new(/^\d+$/)
346
+ if !subscription_id.nil? && subscription_id !~ pattern
347
+ fail ArgumentError, "invalid value for \"subscription_id\", must conform to the pattern #{pattern}."
348
+ end
349
+
350
+ @subscription_id = subscription_id
351
+ end
352
+
353
+ # Checks equality by comparing each attribute.
354
+ # @param [Object] Object to be compared
355
+ def ==(o)
356
+ return true if self.equal?(o)
357
+ self.class == o.class &&
358
+ archived_at == o.archived_at &&
359
+ created_at == o.created_at &&
360
+ external_url == o.external_url &&
361
+ extra == o.extra &&
362
+ id == o.id &&
363
+ last_seen_at == o.last_seen_at &&
364
+ name == o.name &&
365
+ root_service_instance_id == o.root_service_instance_id &&
366
+ service_inventory_id == o.service_inventory_id &&
367
+ service_offering_id == o.service_offering_id &&
368
+ service_plan_id == o.service_plan_id &&
369
+ source_created_at == o.source_created_at &&
370
+ source_deleted_at == o.source_deleted_at &&
371
+ source_id == o.source_id &&
372
+ source_ref == o.source_ref &&
373
+ source_region_id == o.source_region_id &&
374
+ subscription_id == o.subscription_id &&
375
+ updated_at == o.updated_at
376
+ end
377
+
378
+ # @see the `==` method
379
+ # @param [Object] Object to be compared
380
+ def eql?(o)
381
+ self == o
382
+ end
383
+
384
+ # Calculates hash code according to all attributes.
385
+ # @return [Integer] Hash code
386
+ def hash
387
+ [archived_at, created_at, external_url, extra, id, last_seen_at, name, root_service_instance_id, service_inventory_id, service_offering_id, service_plan_id, source_created_at, source_deleted_at, source_id, source_ref, source_region_id, subscription_id, updated_at].hash
388
+ end
389
+
390
+ # Builds the object from hash
391
+ # @param [Hash] attributes Model attributes in the form of hash
392
+ # @return [Object] Returns the model itself
393
+ def self.build_from_hash(attributes)
394
+ new.build_from_hash(attributes)
395
+ end
396
+
397
+ # Builds the object from hash
398
+ # @param [Hash] attributes Model attributes in the form of hash
399
+ # @return [Object] Returns the model itself
400
+ def build_from_hash(attributes)
401
+ return nil unless attributes.is_a?(Hash)
402
+ self.class.openapi_types.each_pair do |key, type|
403
+ if type =~ /\AArray<(.*)>/i
404
+ # check to ensure the input is an array given that the attribute
405
+ # is documented as an array but the input is not
406
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
407
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
408
+ end
409
+ elsif !attributes[self.class.attribute_map[key]].nil?
410
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
411
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
412
+ end
413
+
414
+ self
415
+ end
416
+
417
+ # Deserializes the data based on type
418
+ # @param string type Data type
419
+ # @param string value Value to be deserialized
420
+ # @return [Object] Deserialized data
421
+ def _deserialize(type, value)
422
+ case type.to_sym
423
+ when :DateTime
424
+ DateTime.parse(value)
425
+ when :Date
426
+ Date.parse(value)
427
+ when :String
428
+ value.to_s
429
+ when :Integer
430
+ value.to_i
431
+ when :Float
432
+ value.to_f
433
+ when :Boolean
434
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
435
+ true
436
+ else
437
+ false
438
+ end
439
+ when :Object
440
+ # generic object (usually a Hash), return directly
441
+ value
442
+ when /\AArray<(?<inner_type>.+)>\z/
443
+ inner_type = Regexp.last_match[:inner_type]
444
+ value.map { |v| _deserialize(inner_type, v) }
445
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
446
+ k_type = Regexp.last_match[:k_type]
447
+ v_type = Regexp.last_match[:v_type]
448
+ {}.tap do |hash|
449
+ value.each do |k, v|
450
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
451
+ end
452
+ end
453
+ else # model
454
+ TopologicalInventoryApiClient.const_get(type).build_from_hash(value)
455
+ end
456
+ end
457
+
458
+ # Returns the string representation of the object
459
+ # @return [String] String presentation of the object
460
+ def to_s
461
+ to_hash.to_s
462
+ end
463
+
464
+ # to_body is an alias to to_hash (backward compatibility)
465
+ # @return [Hash] Returns the object in the form of hash
466
+ def to_body
467
+ to_hash
468
+ end
469
+
470
+ # Returns the object in the form of hash
471
+ # @return [Hash] Returns the object in the form of hash
472
+ def to_hash
473
+ hash = {}
474
+ self.class.attribute_map.each_pair do |attr, param|
475
+ value = self.send(attr)
476
+ if value.nil?
477
+ is_nullable = self.class.openapi_nullable.include?(attr)
478
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
479
+ end
480
+
481
+ hash[param] = _to_hash(value)
482
+ end
483
+ hash
484
+ end
485
+
486
+ # Outputs non-array value in the form of hash
487
+ # For object, use to_hash. Otherwise, just return the value
488
+ # @param [Object] value Any valid value
489
+ # @return [Hash] Returns the value in the form of hash
490
+ def _to_hash(value)
491
+ if value.is_a?(Array)
492
+ value.compact.map { |v| _to_hash(v) }
493
+ elsif value.is_a?(Hash)
494
+ {}.tap do |hash|
495
+ value.each { |k, v| hash[k] = _to_hash(v) }
496
+ end
497
+ elsif value.respond_to? :to_hash
498
+ value.to_hash
499
+ else
500
+ value
501
+ end
502
+ end
503
+ end
504
+ end