sources-api-client 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (84) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/Gemfile.lock +70 -0
  4. data/LICENSE.txt +202 -0
  5. data/README.md +151 -0
  6. data/Rakefile +10 -0
  7. data/docs/Application.md +31 -0
  8. data/docs/ApplicationType.md +31 -0
  9. data/docs/ApplicationTypesCollection.md +21 -0
  10. data/docs/ApplicationsCollection.md +21 -0
  11. data/docs/Authentication.md +41 -0
  12. data/docs/AuthenticationExtra.md +17 -0
  13. data/docs/AuthenticationExtraAzure.md +17 -0
  14. data/docs/AuthenticationsCollection.md +21 -0
  15. data/docs/CollectionLinks.md +23 -0
  16. data/docs/CollectionMetadata.md +21 -0
  17. data/docs/DefaultApi.md +1945 -0
  18. data/docs/Endpoint.md +47 -0
  19. data/docs/EndpointsCollection.md +21 -0
  20. data/docs/ErrorNotFound.md +17 -0
  21. data/docs/ErrorNotFoundErrors.md +19 -0
  22. data/docs/GraphQLRequest.md +21 -0
  23. data/docs/GraphQLResponse.md +19 -0
  24. data/docs/Source.md +37 -0
  25. data/docs/SourceType.md +31 -0
  26. data/docs/SourceTypesCollection.md +21 -0
  27. data/docs/SourcesCollection.md +21 -0
  28. data/docs/Tenant.md +21 -0
  29. data/git_push.sh +58 -0
  30. data/lib/sources-api-client.rb +61 -0
  31. data/lib/sources-api-client/api/default_api.rb +2523 -0
  32. data/lib/sources-api-client/api_client.rb +386 -0
  33. data/lib/sources-api-client/api_error.rb +57 -0
  34. data/lib/sources-api-client/configuration.rb +268 -0
  35. data/lib/sources-api-client/models/application.rb +323 -0
  36. data/lib/sources-api-client/models/application_type.rb +287 -0
  37. data/lib/sources-api-client/models/application_types_collection.rb +226 -0
  38. data/lib/sources-api-client/models/applications_collection.rb +226 -0
  39. data/lib/sources-api-client/models/authentication.rb +350 -0
  40. data/lib/sources-api-client/models/authentication_extra.rb +206 -0
  41. data/lib/sources-api-client/models/authentication_extra_azure.rb +206 -0
  42. data/lib/sources-api-client/models/authentications_collection.rb +226 -0
  43. data/lib/sources-api-client/models/collection_links.rb +233 -0
  44. data/lib/sources-api-client/models/collection_metadata.rb +224 -0
  45. data/lib/sources-api-client/models/endpoint.rb +384 -0
  46. data/lib/sources-api-client/models/endpoints_collection.rb +226 -0
  47. data/lib/sources-api-client/models/error_not_found.rb +208 -0
  48. data/lib/sources-api-client/models/error_not_found_errors.rb +215 -0
  49. data/lib/sources-api-client/models/graph_ql_request.rb +237 -0
  50. data/lib/sources-api-client/models/graph_ql_response.rb +219 -0
  51. data/lib/sources-api-client/models/source.rb +332 -0
  52. data/lib/sources-api-client/models/source_type.rb +287 -0
  53. data/lib/sources-api-client/models/source_types_collection.rb +226 -0
  54. data/lib/sources-api-client/models/sources_collection.rb +226 -0
  55. data/lib/sources-api-client/models/tenant.rb +224 -0
  56. data/lib/sources-api-client/version.rb +15 -0
  57. data/pkg/sources-api-client-1.0.0.gem +0 -0
  58. data/sources-api-client.gemspec +39 -0
  59. data/spec/api/default_api_spec.rb +487 -0
  60. data/spec/api_client_spec.rb +226 -0
  61. data/spec/configuration_spec.rb +42 -0
  62. data/spec/models/application_spec.rb +83 -0
  63. data/spec/models/application_type_spec.rb +83 -0
  64. data/spec/models/application_types_collection_spec.rb +53 -0
  65. data/spec/models/applications_collection_spec.rb +53 -0
  66. data/spec/models/authentication_extra_azure_spec.rb +41 -0
  67. data/spec/models/authentication_extra_spec.rb +41 -0
  68. data/spec/models/authentication_spec.rb +113 -0
  69. data/spec/models/authentications_collection_spec.rb +53 -0
  70. data/spec/models/collection_links_spec.rb +59 -0
  71. data/spec/models/collection_metadata_spec.rb +53 -0
  72. data/spec/models/endpoint_spec.rb +131 -0
  73. data/spec/models/endpoints_collection_spec.rb +53 -0
  74. data/spec/models/error_not_found_errors_spec.rb +47 -0
  75. data/spec/models/error_not_found_spec.rb +41 -0
  76. data/spec/models/graph_ql_request_spec.rb +53 -0
  77. data/spec/models/graph_ql_response_spec.rb +47 -0
  78. data/spec/models/source_spec.rb +101 -0
  79. data/spec/models/source_type_spec.rb +83 -0
  80. data/spec/models/source_types_collection_spec.rb +53 -0
  81. data/spec/models/sources_collection_spec.rb +53 -0
  82. data/spec/models/tenant_spec.rb +53 -0
  83. data/spec/spec_helper.rb +111 -0
  84. metadata +210 -0
@@ -0,0 +1,237 @@
1
+ =begin
2
+ #Sources
3
+
4
+ #Sources
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 SourcesApiClient
16
+ class GraphQLRequest
17
+ # The GraphQL query
18
+ attr_accessor :query
19
+
20
+ # If the Query contains several named operations, the operationName controls which one should be executed
21
+ attr_accessor :operation_name
22
+
23
+ # Optional Query variables
24
+ attr_accessor :variables
25
+
26
+ # Attribute mapping from ruby-style variable name to JSON key.
27
+ def self.attribute_map
28
+ {
29
+ :'query' => :'query',
30
+ :'operation_name' => :'operationName',
31
+ :'variables' => :'variables'
32
+ }
33
+ end
34
+
35
+ # Attribute type mapping.
36
+ def self.openapi_types
37
+ {
38
+ :'query' => :'String',
39
+ :'operation_name' => :'String',
40
+ :'variables' => :'Object'
41
+ }
42
+ end
43
+
44
+ # List of attributes with nullable: true
45
+ def self.openapi_nullable
46
+ Set.new([
47
+ :'variables'
48
+ ])
49
+ end
50
+
51
+ # Initializes the object
52
+ # @param [Hash] attributes Model attributes in the form of hash
53
+ def initialize(attributes = {})
54
+ if (!attributes.is_a?(Hash))
55
+ fail ArgumentError, "The input argument (attributes) must be a hash in `SourcesApiClient::GraphQLRequest` initialize method"
56
+ end
57
+
58
+ # check to see if the attribute exists and convert string to symbol for hash key
59
+ attributes = attributes.each_with_object({}) { |(k, v), h|
60
+ if (!self.class.attribute_map.key?(k.to_sym))
61
+ fail ArgumentError, "`#{k}` is not a valid attribute in `SourcesApiClient::GraphQLRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
62
+ end
63
+ h[k.to_sym] = v
64
+ }
65
+
66
+ if attributes.key?(:'query')
67
+ self.query = attributes[:'query']
68
+ else
69
+ self.query = '{}'
70
+ end
71
+
72
+ if attributes.key?(:'operation_name')
73
+ self.operation_name = attributes[:'operation_name']
74
+ else
75
+ self.operation_name = ''
76
+ end
77
+
78
+ if attributes.key?(:'variables')
79
+ self.variables = attributes[:'variables']
80
+ end
81
+ end
82
+
83
+ # Show invalid properties with the reasons. Usually used together with valid?
84
+ # @return Array for valid properties with the reasons
85
+ def list_invalid_properties
86
+ invalid_properties = Array.new
87
+ if @query.nil?
88
+ invalid_properties.push('invalid value for "query", query cannot be nil.')
89
+ end
90
+
91
+ invalid_properties
92
+ end
93
+
94
+ # Check to see if the all the properties in the model are valid
95
+ # @return true if the model is valid
96
+ def valid?
97
+ return false if @query.nil?
98
+ true
99
+ end
100
+
101
+ # Checks equality by comparing each attribute.
102
+ # @param [Object] Object to be compared
103
+ def ==(o)
104
+ return true if self.equal?(o)
105
+ self.class == o.class &&
106
+ query == o.query &&
107
+ operation_name == o.operation_name &&
108
+ variables == o.variables
109
+ end
110
+
111
+ # @see the `==` method
112
+ # @param [Object] Object to be compared
113
+ def eql?(o)
114
+ self == o
115
+ end
116
+
117
+ # Calculates hash code according to all attributes.
118
+ # @return [Integer] Hash code
119
+ def hash
120
+ [query, operation_name, variables].hash
121
+ end
122
+
123
+ # Builds the object from hash
124
+ # @param [Hash] attributes Model attributes in the form of hash
125
+ # @return [Object] Returns the model itself
126
+ def self.build_from_hash(attributes)
127
+ new.build_from_hash(attributes)
128
+ end
129
+
130
+ # Builds the object from hash
131
+ # @param [Hash] attributes Model attributes in the form of hash
132
+ # @return [Object] Returns the model itself
133
+ def build_from_hash(attributes)
134
+ return nil unless attributes.is_a?(Hash)
135
+ self.class.openapi_types.each_pair do |key, type|
136
+ if type =~ /\AArray<(.*)>/i
137
+ # check to ensure the input is an array given that the attribute
138
+ # is documented as an array but the input is not
139
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
140
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
141
+ end
142
+ elsif !attributes[self.class.attribute_map[key]].nil?
143
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
144
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
145
+ end
146
+
147
+ self
148
+ end
149
+
150
+ # Deserializes the data based on type
151
+ # @param string type Data type
152
+ # @param string value Value to be deserialized
153
+ # @return [Object] Deserialized data
154
+ def _deserialize(type, value)
155
+ case type.to_sym
156
+ when :DateTime
157
+ DateTime.parse(value)
158
+ when :Date
159
+ Date.parse(value)
160
+ when :String
161
+ value.to_s
162
+ when :Integer
163
+ value.to_i
164
+ when :Float
165
+ value.to_f
166
+ when :Boolean
167
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
168
+ true
169
+ else
170
+ false
171
+ end
172
+ when :Object
173
+ # generic object (usually a Hash), return directly
174
+ value
175
+ when /\AArray<(?<inner_type>.+)>\z/
176
+ inner_type = Regexp.last_match[:inner_type]
177
+ value.map { |v| _deserialize(inner_type, v) }
178
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
179
+ k_type = Regexp.last_match[:k_type]
180
+ v_type = Regexp.last_match[:v_type]
181
+ {}.tap do |hash|
182
+ value.each do |k, v|
183
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
184
+ end
185
+ end
186
+ else # model
187
+ SourcesApiClient.const_get(type).build_from_hash(value)
188
+ end
189
+ end
190
+
191
+ # Returns the string representation of the object
192
+ # @return [String] String presentation of the object
193
+ def to_s
194
+ to_hash.to_s
195
+ end
196
+
197
+ # to_body is an alias to to_hash (backward compatibility)
198
+ # @return [Hash] Returns the object in the form of hash
199
+ def to_body
200
+ to_hash
201
+ end
202
+
203
+ # Returns the object in the form of hash
204
+ # @return [Hash] Returns the object in the form of hash
205
+ def to_hash
206
+ hash = {}
207
+ self.class.attribute_map.each_pair do |attr, param|
208
+ value = self.send(attr)
209
+ if value.nil?
210
+ is_nullable = self.class.openapi_nullable.include?(attr)
211
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
212
+ end
213
+
214
+ hash[param] = _to_hash(value)
215
+ end
216
+ hash
217
+ end
218
+
219
+ # Outputs non-array value in the form of hash
220
+ # For object, use to_hash. Otherwise, just return the value
221
+ # @param [Object] value Any valid value
222
+ # @return [Hash] Returns the value in the form of hash
223
+ def _to_hash(value)
224
+ if value.is_a?(Array)
225
+ value.compact.map { |v| _to_hash(v) }
226
+ elsif value.is_a?(Hash)
227
+ {}.tap do |hash|
228
+ value.each { |k, v| hash[k] = _to_hash(v) }
229
+ end
230
+ elsif value.respond_to? :to_hash
231
+ value.to_hash
232
+ else
233
+ value
234
+ end
235
+ end
236
+ end
237
+ end
@@ -0,0 +1,219 @@
1
+ =begin
2
+ #Sources
3
+
4
+ #Sources
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 SourcesApiClient
16
+ class GraphQLResponse
17
+ # Results from the GraphQL query
18
+ attr_accessor :data
19
+
20
+ # Errors resulting from the GraphQL query
21
+ attr_accessor :errors
22
+
23
+ # Attribute mapping from ruby-style variable name to JSON key.
24
+ def self.attribute_map
25
+ {
26
+ :'data' => :'data',
27
+ :'errors' => :'errors'
28
+ }
29
+ end
30
+
31
+ # Attribute type mapping.
32
+ def self.openapi_types
33
+ {
34
+ :'data' => :'Object',
35
+ :'errors' => :'Array<Object>'
36
+ }
37
+ end
38
+
39
+ # List of attributes with nullable: true
40
+ def self.openapi_nullable
41
+ Set.new([
42
+ ])
43
+ end
44
+
45
+ # Initializes the object
46
+ # @param [Hash] attributes Model attributes in the form of hash
47
+ def initialize(attributes = {})
48
+ if (!attributes.is_a?(Hash))
49
+ fail ArgumentError, "The input argument (attributes) must be a hash in `SourcesApiClient::GraphQLResponse` initialize method"
50
+ end
51
+
52
+ # check to see if the attribute exists and convert string to symbol for hash key
53
+ attributes = attributes.each_with_object({}) { |(k, v), h|
54
+ if (!self.class.attribute_map.key?(k.to_sym))
55
+ fail ArgumentError, "`#{k}` is not a valid attribute in `SourcesApiClient::GraphQLResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
56
+ end
57
+ h[k.to_sym] = v
58
+ }
59
+
60
+ if attributes.key?(:'data')
61
+ self.data = attributes[:'data']
62
+ end
63
+
64
+ if attributes.key?(:'errors')
65
+ if (value = attributes[:'errors']).is_a?(Array)
66
+ self.errors = value
67
+ end
68
+ end
69
+ end
70
+
71
+ # Show invalid properties with the reasons. Usually used together with valid?
72
+ # @return Array for valid properties with the reasons
73
+ def list_invalid_properties
74
+ invalid_properties = Array.new
75
+ invalid_properties
76
+ end
77
+
78
+ # Check to see if the all the properties in the model are valid
79
+ # @return true if the model is valid
80
+ def valid?
81
+ true
82
+ end
83
+
84
+ # Checks equality by comparing each attribute.
85
+ # @param [Object] Object to be compared
86
+ def ==(o)
87
+ return true if self.equal?(o)
88
+ self.class == o.class &&
89
+ data == o.data &&
90
+ errors == o.errors
91
+ end
92
+
93
+ # @see the `==` method
94
+ # @param [Object] Object to be compared
95
+ def eql?(o)
96
+ self == o
97
+ end
98
+
99
+ # Calculates hash code according to all attributes.
100
+ # @return [Integer] Hash code
101
+ def hash
102
+ [data, errors].hash
103
+ end
104
+
105
+ # Builds the object from hash
106
+ # @param [Hash] attributes Model attributes in the form of hash
107
+ # @return [Object] Returns the model itself
108
+ def self.build_from_hash(attributes)
109
+ new.build_from_hash(attributes)
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 build_from_hash(attributes)
116
+ return nil unless attributes.is_a?(Hash)
117
+ self.class.openapi_types.each_pair do |key, type|
118
+ if type =~ /\AArray<(.*)>/i
119
+ # check to ensure the input is an array given that the attribute
120
+ # is documented as an array but the input is not
121
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
122
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
123
+ end
124
+ elsif !attributes[self.class.attribute_map[key]].nil?
125
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
126
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
127
+ end
128
+
129
+ self
130
+ end
131
+
132
+ # Deserializes the data based on type
133
+ # @param string type Data type
134
+ # @param string value Value to be deserialized
135
+ # @return [Object] Deserialized data
136
+ def _deserialize(type, value)
137
+ case type.to_sym
138
+ when :DateTime
139
+ DateTime.parse(value)
140
+ when :Date
141
+ Date.parse(value)
142
+ when :String
143
+ value.to_s
144
+ when :Integer
145
+ value.to_i
146
+ when :Float
147
+ value.to_f
148
+ when :Boolean
149
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
150
+ true
151
+ else
152
+ false
153
+ end
154
+ when :Object
155
+ # generic object (usually a Hash), return directly
156
+ value
157
+ when /\AArray<(?<inner_type>.+)>\z/
158
+ inner_type = Regexp.last_match[:inner_type]
159
+ value.map { |v| _deserialize(inner_type, v) }
160
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
161
+ k_type = Regexp.last_match[:k_type]
162
+ v_type = Regexp.last_match[:v_type]
163
+ {}.tap do |hash|
164
+ value.each do |k, v|
165
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
166
+ end
167
+ end
168
+ else # model
169
+ SourcesApiClient.const_get(type).build_from_hash(value)
170
+ end
171
+ end
172
+
173
+ # Returns the string representation of the object
174
+ # @return [String] String presentation of the object
175
+ def to_s
176
+ to_hash.to_s
177
+ end
178
+
179
+ # to_body is an alias to to_hash (backward compatibility)
180
+ # @return [Hash] Returns the object in the form of hash
181
+ def to_body
182
+ to_hash
183
+ end
184
+
185
+ # Returns the object in the form of hash
186
+ # @return [Hash] Returns the object in the form of hash
187
+ def to_hash
188
+ hash = {}
189
+ self.class.attribute_map.each_pair do |attr, param|
190
+ value = self.send(attr)
191
+ if value.nil?
192
+ is_nullable = self.class.openapi_nullable.include?(attr)
193
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
194
+ end
195
+
196
+ hash[param] = _to_hash(value)
197
+ end
198
+ hash
199
+ end
200
+
201
+ # Outputs non-array value in the form of hash
202
+ # For object, use to_hash. Otherwise, just return the value
203
+ # @param [Object] value Any valid value
204
+ # @return [Hash] Returns the value in the form of hash
205
+ def _to_hash(value)
206
+ if value.is_a?(Array)
207
+ value.compact.map { |v| _to_hash(v) }
208
+ elsif value.is_a?(Hash)
209
+ {}.tap do |hash|
210
+ value.each { |k, v| hash[k] = _to_hash(v) }
211
+ end
212
+ elsif value.respond_to? :to_hash
213
+ value.to_hash
214
+ else
215
+ value
216
+ end
217
+ end
218
+ end
219
+ end