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