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