topological_inventory-ingress_api-client 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (86) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +18 -0
  3. data/docs/Inventory.md +11 -1
  4. data/docs/InventoryCollectionServiceCredentialType.md +21 -0
  5. data/docs/InventoryCollectionServiceInstanceNodeServiceCredential.md +21 -0
  6. data/docs/InventoryCollectionServiceInstanceServiceCredential.md +21 -0
  7. data/docs/InventoryCollectionServiceOfferingNodeServiceCredential.md +21 -0
  8. data/docs/InventoryCollectionServiceOfferingServiceCredential.md +21 -0
  9. data/docs/ServiceCredential.md +2 -0
  10. data/docs/ServiceCredentialAllOf.md +2 -0
  11. data/docs/ServiceCredentialType.md +33 -0
  12. data/docs/ServiceCredentialTypeAllOf.md +33 -0
  13. data/docs/ServiceCredentialTypeReference.md +21 -0
  14. data/docs/ServiceInstance.md +0 -2
  15. data/docs/ServiceInstanceAllOf.md +0 -2
  16. data/docs/ServiceInstanceNode.md +0 -2
  17. data/docs/ServiceInstanceNodeAllOf.md +0 -2
  18. data/docs/ServiceInstanceNodeReference.md +21 -0
  19. data/docs/ServiceInstanceNodeServiceCredential.md +19 -0
  20. data/docs/ServiceInstanceNodeServiceCredentialAllOf.md +19 -0
  21. data/docs/ServiceInstanceServiceCredential.md +19 -0
  22. data/docs/ServiceInstanceServiceCredentialAllOf.md +19 -0
  23. data/docs/ServiceOffering.md +0 -2
  24. data/docs/ServiceOfferingAllOf.md +0 -2
  25. data/docs/ServiceOfferingNode.md +0 -2
  26. data/docs/ServiceOfferingNodeAllOf.md +0 -2
  27. data/docs/ServiceOfferingNodeReference.md +21 -0
  28. data/docs/ServiceOfferingNodeServiceCredential.md +19 -0
  29. data/docs/ServiceOfferingNodeServiceCredentialAllOf.md +19 -0
  30. data/docs/ServiceOfferingServiceCredential.md +19 -0
  31. data/docs/ServiceOfferingServiceCredentialAllOf.md +19 -0
  32. data/lib/topological_inventory-ingress_api-client.rb +18 -0
  33. data/lib/topological_inventory-ingress_api-client/models/inventory.rb +66 -20
  34. data/lib/topological_inventory-ingress_api-client/models/inventory_collection_service_credential_type.rb +233 -0
  35. data/lib/topological_inventory-ingress_api-client/models/inventory_collection_service_instance_node_service_credential.rb +233 -0
  36. data/lib/topological_inventory-ingress_api-client/models/inventory_collection_service_instance_service_credential.rb +233 -0
  37. data/lib/topological_inventory-ingress_api-client/models/inventory_collection_service_offering_node_service_credential.rb +233 -0
  38. data/lib/topological_inventory-ingress_api-client/models/inventory_collection_service_offering_service_credential.rb +233 -0
  39. data/lib/topological_inventory-ingress_api-client/models/service_credential.rb +11 -1
  40. data/lib/topological_inventory-ingress_api-client/models/service_credential_all_of.rb +11 -1
  41. data/lib/topological_inventory-ingress_api-client/models/service_credential_type.rb +299 -0
  42. data/lib/topological_inventory-ingress_api-client/models/service_credential_type_all_of.rb +291 -0
  43. data/lib/topological_inventory-ingress_api-client/models/service_credential_type_reference.rb +281 -0
  44. data/lib/topological_inventory-ingress_api-client/models/service_instance.rb +1 -11
  45. data/lib/topological_inventory-ingress_api-client/models/service_instance_all_of.rb +1 -11
  46. data/lib/topological_inventory-ingress_api-client/models/service_instance_node.rb +1 -11
  47. data/lib/topological_inventory-ingress_api-client/models/service_instance_node_all_of.rb +1 -11
  48. data/lib/topological_inventory-ingress_api-client/models/service_instance_node_reference.rb +281 -0
  49. data/lib/topological_inventory-ingress_api-client/models/service_instance_node_service_credential.rb +233 -0
  50. data/lib/topological_inventory-ingress_api-client/models/service_instance_node_service_credential_all_of.rb +225 -0
  51. data/lib/topological_inventory-ingress_api-client/models/service_instance_service_credential.rb +233 -0
  52. data/lib/topological_inventory-ingress_api-client/models/service_instance_service_credential_all_of.rb +225 -0
  53. data/lib/topological_inventory-ingress_api-client/models/service_offering.rb +1 -11
  54. data/lib/topological_inventory-ingress_api-client/models/service_offering_all_of.rb +1 -11
  55. data/lib/topological_inventory-ingress_api-client/models/service_offering_node.rb +1 -11
  56. data/lib/topological_inventory-ingress_api-client/models/service_offering_node_all_of.rb +1 -11
  57. data/lib/topological_inventory-ingress_api-client/models/service_offering_node_reference.rb +281 -0
  58. data/lib/topological_inventory-ingress_api-client/models/service_offering_node_service_credential.rb +233 -0
  59. data/lib/topological_inventory-ingress_api-client/models/service_offering_node_service_credential_all_of.rb +225 -0
  60. data/lib/topological_inventory-ingress_api-client/models/service_offering_service_credential.rb +233 -0
  61. data/lib/topological_inventory-ingress_api-client/models/service_offering_service_credential_all_of.rb +225 -0
  62. data/lib/topological_inventory-ingress_api-client/version.rb +1 -1
  63. data/spec/models/inventory_collection_service_credential_type_spec.rb +53 -0
  64. data/spec/models/inventory_collection_service_instance_node_service_credential_spec.rb +53 -0
  65. data/spec/models/inventory_collection_service_instance_service_credential_spec.rb +53 -0
  66. data/spec/models/inventory_collection_service_offering_node_service_credential_spec.rb +53 -0
  67. data/spec/models/inventory_collection_service_offering_service_credential_spec.rb +53 -0
  68. data/spec/models/service_credential_all_of_spec.rb +6 -0
  69. data/spec/models/service_credential_type_all_of_spec.rb +89 -0
  70. data/spec/models/service_credential_type_reference_spec.rb +53 -0
  71. data/spec/models/service_credential_type_spec.rb +89 -0
  72. data/spec/models/service_instance_all_of_spec.rb +0 -6
  73. data/spec/models/service_instance_node_all_of_spec.rb +0 -6
  74. data/spec/models/service_instance_node_reference_spec.rb +53 -0
  75. data/spec/models/service_instance_node_service_credential_all_of_spec.rb +47 -0
  76. data/spec/models/service_instance_node_service_credential_spec.rb +47 -0
  77. data/spec/models/service_instance_service_credential_all_of_spec.rb +47 -0
  78. data/spec/models/service_instance_service_credential_spec.rb +47 -0
  79. data/spec/models/service_offering_all_of_spec.rb +0 -6
  80. data/spec/models/service_offering_node_all_of_spec.rb +0 -6
  81. data/spec/models/service_offering_node_reference_spec.rb +53 -0
  82. data/spec/models/service_offering_node_service_credential_all_of_spec.rb +47 -0
  83. data/spec/models/service_offering_node_service_credential_spec.rb +47 -0
  84. data/spec/models/service_offering_service_credential_all_of_spec.rb +47 -0
  85. data/spec/models/service_offering_service_credential_spec.rb +47 -0
  86. metadata +246 -174
@@ -0,0 +1,233 @@
1
+ =begin
2
+ #Topological Inventory Ingress API
3
+
4
+ #Topological Inventory Ingress API
5
+
6
+ The version of the OpenAPI document: 0.0.2
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 TopologicalInventoryIngressApiClient
16
+ class InventoryCollectionServiceOfferingNodeServiceCredential
17
+ attr_accessor :name
18
+
19
+ attr_accessor :data
20
+
21
+ attr_accessor :partial_data
22
+
23
+ # Attribute mapping from ruby-style variable name to JSON key.
24
+ def self.attribute_map
25
+ {
26
+ :'name' => :'name',
27
+ :'data' => :'data',
28
+ :'partial_data' => :'partial_data'
29
+ }
30
+ end
31
+
32
+ # Attribute type mapping.
33
+ def self.openapi_types
34
+ {
35
+ :'name' => :'String',
36
+ :'data' => :'Array<ServiceOfferingNodeServiceCredential>',
37
+ :'partial_data' => :'Array<ServiceOfferingNodeServiceCredential>'
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 `TopologicalInventoryIngressApiClient::InventoryCollectionServiceOfferingNodeServiceCredential` 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 `TopologicalInventoryIngressApiClient::InventoryCollectionServiceOfferingNodeServiceCredential`. 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?(:'name')
63
+ self.name = attributes[:'name']
64
+ end
65
+
66
+ if attributes.key?(:'data')
67
+ if (value = attributes[:'data']).is_a?(Array)
68
+ self.data = value
69
+ end
70
+ end
71
+
72
+ if attributes.key?(:'partial_data')
73
+ if (value = attributes[:'partial_data']).is_a?(Array)
74
+ self.partial_data = value
75
+ end
76
+ end
77
+ end
78
+
79
+ # Show invalid properties with the reasons. Usually used together with valid?
80
+ # @return Array for valid properties with the reasons
81
+ def list_invalid_properties
82
+ invalid_properties = Array.new
83
+ if @name.nil?
84
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
85
+ end
86
+
87
+ invalid_properties
88
+ end
89
+
90
+ # Check to see if the all the properties in the model are valid
91
+ # @return true if the model is valid
92
+ def valid?
93
+ return false if @name.nil?
94
+ true
95
+ end
96
+
97
+ # Checks equality by comparing each attribute.
98
+ # @param [Object] Object to be compared
99
+ def ==(o)
100
+ return true if self.equal?(o)
101
+ self.class == o.class &&
102
+ name == o.name &&
103
+ data == o.data &&
104
+ partial_data == o.partial_data
105
+ end
106
+
107
+ # @see the `==` method
108
+ # @param [Object] Object to be compared
109
+ def eql?(o)
110
+ self == o
111
+ end
112
+
113
+ # Calculates hash code according to all attributes.
114
+ # @return [Integer] Hash code
115
+ def hash
116
+ [name, data, partial_data].hash
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 self.build_from_hash(attributes)
123
+ new.build_from_hash(attributes)
124
+ end
125
+
126
+ # Builds the object from hash
127
+ # @param [Hash] attributes Model attributes in the form of hash
128
+ # @return [Object] Returns the model itself
129
+ def build_from_hash(attributes)
130
+ return nil unless attributes.is_a?(Hash)
131
+ self.class.openapi_types.each_pair do |key, type|
132
+ if type =~ /\AArray<(.*)>/i
133
+ # check to ensure the input is an array given that the attribute
134
+ # is documented as an array but the input is not
135
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
136
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
137
+ end
138
+ elsif !attributes[self.class.attribute_map[key]].nil?
139
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
140
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
141
+ end
142
+
143
+ self
144
+ end
145
+
146
+ # Deserializes the data based on type
147
+ # @param string type Data type
148
+ # @param string value Value to be deserialized
149
+ # @return [Object] Deserialized data
150
+ def _deserialize(type, value)
151
+ case type.to_sym
152
+ when :DateTime
153
+ DateTime.parse(value)
154
+ when :Date
155
+ Date.parse(value)
156
+ when :String
157
+ value.to_s
158
+ when :Integer
159
+ value.to_i
160
+ when :Float
161
+ value.to_f
162
+ when :Boolean
163
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
164
+ true
165
+ else
166
+ false
167
+ end
168
+ when :Object
169
+ # generic object (usually a Hash), return directly
170
+ value
171
+ when /\AArray<(?<inner_type>.+)>\z/
172
+ inner_type = Regexp.last_match[:inner_type]
173
+ value.map { |v| _deserialize(inner_type, v) }
174
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
175
+ k_type = Regexp.last_match[:k_type]
176
+ v_type = Regexp.last_match[:v_type]
177
+ {}.tap do |hash|
178
+ value.each do |k, v|
179
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
180
+ end
181
+ end
182
+ else # model
183
+ TopologicalInventoryIngressApiClient.const_get(type).build_from_hash(value)
184
+ end
185
+ end
186
+
187
+ # Returns the string representation of the object
188
+ # @return [String] String presentation of the object
189
+ def to_s
190
+ to_hash.to_s
191
+ end
192
+
193
+ # to_body is an alias to to_hash (backward compatibility)
194
+ # @return [Hash] Returns the object in the form of hash
195
+ def to_body
196
+ to_hash
197
+ end
198
+
199
+ # Returns the object in the form of hash
200
+ # @return [Hash] Returns the object in the form of hash
201
+ def to_hash
202
+ hash = {}
203
+ self.class.attribute_map.each_pair do |attr, param|
204
+ value = self.send(attr)
205
+ if value.nil?
206
+ is_nullable = self.class.openapi_nullable.include?(attr)
207
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
208
+ end
209
+
210
+ hash[param] = _to_hash(value)
211
+ end
212
+ hash
213
+ end
214
+
215
+ # Outputs non-array value in the form of hash
216
+ # For object, use to_hash. Otherwise, just return the value
217
+ # @param [Object] value Any valid value
218
+ # @return [Hash] Returns the value in the form of hash
219
+ def _to_hash(value)
220
+ if value.is_a?(Array)
221
+ value.compact.map { |v| _to_hash(v) }
222
+ elsif value.is_a?(Hash)
223
+ {}.tap do |hash|
224
+ value.each { |k, v| hash[k] = _to_hash(v) }
225
+ end
226
+ elsif value.respond_to? :to_hash
227
+ value.to_hash
228
+ else
229
+ value
230
+ end
231
+ end
232
+ end
233
+ end
@@ -0,0 +1,233 @@
1
+ =begin
2
+ #Topological Inventory Ingress API
3
+
4
+ #Topological Inventory Ingress API
5
+
6
+ The version of the OpenAPI document: 0.0.2
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 TopologicalInventoryIngressApiClient
16
+ class InventoryCollectionServiceOfferingServiceCredential
17
+ attr_accessor :name
18
+
19
+ attr_accessor :data
20
+
21
+ attr_accessor :partial_data
22
+
23
+ # Attribute mapping from ruby-style variable name to JSON key.
24
+ def self.attribute_map
25
+ {
26
+ :'name' => :'name',
27
+ :'data' => :'data',
28
+ :'partial_data' => :'partial_data'
29
+ }
30
+ end
31
+
32
+ # Attribute type mapping.
33
+ def self.openapi_types
34
+ {
35
+ :'name' => :'String',
36
+ :'data' => :'Array<ServiceOfferingServiceCredential>',
37
+ :'partial_data' => :'Array<ServiceOfferingServiceCredential>'
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 `TopologicalInventoryIngressApiClient::InventoryCollectionServiceOfferingServiceCredential` 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 `TopologicalInventoryIngressApiClient::InventoryCollectionServiceOfferingServiceCredential`. 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?(:'name')
63
+ self.name = attributes[:'name']
64
+ end
65
+
66
+ if attributes.key?(:'data')
67
+ if (value = attributes[:'data']).is_a?(Array)
68
+ self.data = value
69
+ end
70
+ end
71
+
72
+ if attributes.key?(:'partial_data')
73
+ if (value = attributes[:'partial_data']).is_a?(Array)
74
+ self.partial_data = value
75
+ end
76
+ end
77
+ end
78
+
79
+ # Show invalid properties with the reasons. Usually used together with valid?
80
+ # @return Array for valid properties with the reasons
81
+ def list_invalid_properties
82
+ invalid_properties = Array.new
83
+ if @name.nil?
84
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
85
+ end
86
+
87
+ invalid_properties
88
+ end
89
+
90
+ # Check to see if the all the properties in the model are valid
91
+ # @return true if the model is valid
92
+ def valid?
93
+ return false if @name.nil?
94
+ true
95
+ end
96
+
97
+ # Checks equality by comparing each attribute.
98
+ # @param [Object] Object to be compared
99
+ def ==(o)
100
+ return true if self.equal?(o)
101
+ self.class == o.class &&
102
+ name == o.name &&
103
+ data == o.data &&
104
+ partial_data == o.partial_data
105
+ end
106
+
107
+ # @see the `==` method
108
+ # @param [Object] Object to be compared
109
+ def eql?(o)
110
+ self == o
111
+ end
112
+
113
+ # Calculates hash code according to all attributes.
114
+ # @return [Integer] Hash code
115
+ def hash
116
+ [name, data, partial_data].hash
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 self.build_from_hash(attributes)
123
+ new.build_from_hash(attributes)
124
+ end
125
+
126
+ # Builds the object from hash
127
+ # @param [Hash] attributes Model attributes in the form of hash
128
+ # @return [Object] Returns the model itself
129
+ def build_from_hash(attributes)
130
+ return nil unless attributes.is_a?(Hash)
131
+ self.class.openapi_types.each_pair do |key, type|
132
+ if type =~ /\AArray<(.*)>/i
133
+ # check to ensure the input is an array given that the attribute
134
+ # is documented as an array but the input is not
135
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
136
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
137
+ end
138
+ elsif !attributes[self.class.attribute_map[key]].nil?
139
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
140
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
141
+ end
142
+
143
+ self
144
+ end
145
+
146
+ # Deserializes the data based on type
147
+ # @param string type Data type
148
+ # @param string value Value to be deserialized
149
+ # @return [Object] Deserialized data
150
+ def _deserialize(type, value)
151
+ case type.to_sym
152
+ when :DateTime
153
+ DateTime.parse(value)
154
+ when :Date
155
+ Date.parse(value)
156
+ when :String
157
+ value.to_s
158
+ when :Integer
159
+ value.to_i
160
+ when :Float
161
+ value.to_f
162
+ when :Boolean
163
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
164
+ true
165
+ else
166
+ false
167
+ end
168
+ when :Object
169
+ # generic object (usually a Hash), return directly
170
+ value
171
+ when /\AArray<(?<inner_type>.+)>\z/
172
+ inner_type = Regexp.last_match[:inner_type]
173
+ value.map { |v| _deserialize(inner_type, v) }
174
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
175
+ k_type = Regexp.last_match[:k_type]
176
+ v_type = Regexp.last_match[:v_type]
177
+ {}.tap do |hash|
178
+ value.each do |k, v|
179
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
180
+ end
181
+ end
182
+ else # model
183
+ TopologicalInventoryIngressApiClient.const_get(type).build_from_hash(value)
184
+ end
185
+ end
186
+
187
+ # Returns the string representation of the object
188
+ # @return [String] String presentation of the object
189
+ def to_s
190
+ to_hash.to_s
191
+ end
192
+
193
+ # to_body is an alias to to_hash (backward compatibility)
194
+ # @return [Hash] Returns the object in the form of hash
195
+ def to_body
196
+ to_hash
197
+ end
198
+
199
+ # Returns the object in the form of hash
200
+ # @return [Hash] Returns the object in the form of hash
201
+ def to_hash
202
+ hash = {}
203
+ self.class.attribute_map.each_pair do |attr, param|
204
+ value = self.send(attr)
205
+ if value.nil?
206
+ is_nullable = self.class.openapi_nullable.include?(attr)
207
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
208
+ end
209
+
210
+ hash[param] = _to_hash(value)
211
+ end
212
+ hash
213
+ end
214
+
215
+ # Outputs non-array value in the form of hash
216
+ # For object, use to_hash. Otherwise, just return the value
217
+ # @param [Object] value Any valid value
218
+ # @return [Hash] Returns the value in the form of hash
219
+ def _to_hash(value)
220
+ if value.is_a?(Array)
221
+ value.compact.map { |v| _to_hash(v) }
222
+ elsif value.is_a?(Hash)
223
+ {}.tap do |hash|
224
+ value.each { |k, v| hash[k] = _to_hash(v) }
225
+ end
226
+ elsif value.respond_to? :to_hash
227
+ value.to_hash
228
+ else
229
+ value
230
+ end
231
+ end
232
+ end
233
+ end