ory-hydra-client 1.2.0.alpha3 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,268 +0,0 @@
1
- =begin
2
- #ORY Hydra
3
-
4
- #Welcome to the ORY Hydra HTTP API documentation. You will find documentation for all HTTP APIs here.
5
-
6
- The version of the OpenAPI document: latest
7
-
8
- Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.2.2
10
-
11
- =end
12
-
13
- require 'date'
14
-
15
- module OryHydraClient
16
- # Name Name Name Name Name Name represents an X.509 distinguished name. This only includes the common elements of a DN. When parsing, all elements are stored in Names and non-standard elements can be extracted from there. When marshaling, elements in ExtraNames are appended and override other values with the same OID.
17
- class Name
18
- # country
19
- attr_accessor :country
20
-
21
- # extra names
22
- attr_accessor :extra_names
23
-
24
- # locality
25
- attr_accessor :locality
26
-
27
- # names
28
- attr_accessor :names
29
-
30
- # serial number
31
- attr_accessor :serial_number
32
-
33
- # street address
34
- attr_accessor :street_address
35
-
36
- # Attribute mapping from ruby-style variable name to JSON key.
37
- def self.attribute_map
38
- {
39
- :'country' => :'Country',
40
- :'extra_names' => :'ExtraNames',
41
- :'locality' => :'Locality',
42
- :'names' => :'Names',
43
- :'serial_number' => :'SerialNumber',
44
- :'street_address' => :'StreetAddress'
45
- }
46
- end
47
-
48
- # Attribute type mapping.
49
- def self.openapi_types
50
- {
51
- :'country' => :'Array<String>',
52
- :'extra_names' => :'Array<AttributeTypeAndValue>',
53
- :'locality' => :'Array<String>',
54
- :'names' => :'Array<AttributeTypeAndValue>',
55
- :'serial_number' => :'String',
56
- :'street_address' => :'Array<String>'
57
- }
58
- end
59
-
60
- # List of attributes with nullable: true
61
- def self.openapi_nullable
62
- Set.new([
63
- ])
64
- end
65
-
66
- # Initializes the object
67
- # @param [Hash] attributes Model attributes in the form of hash
68
- def initialize(attributes = {})
69
- if (!attributes.is_a?(Hash))
70
- fail ArgumentError, "The input argument (attributes) must be a hash in `OryHydraClient::Name` initialize method"
71
- end
72
-
73
- # check to see if the attribute exists and convert string to symbol for hash key
74
- attributes = attributes.each_with_object({}) { |(k, v), h|
75
- if (!self.class.attribute_map.key?(k.to_sym))
76
- fail ArgumentError, "`#{k}` is not a valid attribute in `OryHydraClient::Name`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
77
- end
78
- h[k.to_sym] = v
79
- }
80
-
81
- if attributes.key?(:'country')
82
- if (value = attributes[:'country']).is_a?(Array)
83
- self.country = value
84
- end
85
- end
86
-
87
- if attributes.key?(:'extra_names')
88
- if (value = attributes[:'extra_names']).is_a?(Array)
89
- self.extra_names = value
90
- end
91
- end
92
-
93
- if attributes.key?(:'locality')
94
- if (value = attributes[:'locality']).is_a?(Array)
95
- self.locality = value
96
- end
97
- end
98
-
99
- if attributes.key?(:'names')
100
- if (value = attributes[:'names']).is_a?(Array)
101
- self.names = value
102
- end
103
- end
104
-
105
- if attributes.key?(:'serial_number')
106
- self.serial_number = attributes[:'serial_number']
107
- end
108
-
109
- if attributes.key?(:'street_address')
110
- if (value = attributes[:'street_address']).is_a?(Array)
111
- self.street_address = value
112
- end
113
- end
114
- end
115
-
116
- # Show invalid properties with the reasons. Usually used together with valid?
117
- # @return Array for valid properties with the reasons
118
- def list_invalid_properties
119
- invalid_properties = Array.new
120
- invalid_properties
121
- end
122
-
123
- # Check to see if the all the properties in the model are valid
124
- # @return true if the model is valid
125
- def valid?
126
- true
127
- end
128
-
129
- # Checks equality by comparing each attribute.
130
- # @param [Object] Object to be compared
131
- def ==(o)
132
- return true if self.equal?(o)
133
- self.class == o.class &&
134
- country == o.country &&
135
- extra_names == o.extra_names &&
136
- locality == o.locality &&
137
- names == o.names &&
138
- serial_number == o.serial_number &&
139
- street_address == o.street_address
140
- end
141
-
142
- # @see the `==` method
143
- # @param [Object] Object to be compared
144
- def eql?(o)
145
- self == o
146
- end
147
-
148
- # Calculates hash code according to all attributes.
149
- # @return [Integer] Hash code
150
- def hash
151
- [country, extra_names, locality, names, serial_number, street_address].hash
152
- end
153
-
154
- # Builds the object from hash
155
- # @param [Hash] attributes Model attributes in the form of hash
156
- # @return [Object] Returns the model itself
157
- def self.build_from_hash(attributes)
158
- new.build_from_hash(attributes)
159
- end
160
-
161
- # Builds the object from hash
162
- # @param [Hash] attributes Model attributes in the form of hash
163
- # @return [Object] Returns the model itself
164
- def build_from_hash(attributes)
165
- return nil unless attributes.is_a?(Hash)
166
- self.class.openapi_types.each_pair do |key, type|
167
- if type =~ /\AArray<(.*)>/i
168
- # check to ensure the input is an array given that the attribute
169
- # is documented as an array but the input is not
170
- if attributes[self.class.attribute_map[key]].is_a?(Array)
171
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
172
- end
173
- elsif !attributes[self.class.attribute_map[key]].nil?
174
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
175
- end # or else data not found in attributes(hash), not an issue as the data can be optional
176
- end
177
-
178
- self
179
- end
180
-
181
- # Deserializes the data based on type
182
- # @param string type Data type
183
- # @param string value Value to be deserialized
184
- # @return [Object] Deserialized data
185
- def _deserialize(type, value)
186
- case type.to_sym
187
- when :DateTime
188
- DateTime.parse(value)
189
- when :Date
190
- Date.parse(value)
191
- when :String
192
- value.to_s
193
- when :Integer
194
- value.to_i
195
- when :Float
196
- value.to_f
197
- when :Boolean
198
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
199
- true
200
- else
201
- false
202
- end
203
- when :Object
204
- # generic object (usually a Hash), return directly
205
- value
206
- when /\AArray<(?<inner_type>.+)>\z/
207
- inner_type = Regexp.last_match[:inner_type]
208
- value.map { |v| _deserialize(inner_type, v) }
209
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
210
- k_type = Regexp.last_match[:k_type]
211
- v_type = Regexp.last_match[:v_type]
212
- {}.tap do |hash|
213
- value.each do |k, v|
214
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
215
- end
216
- end
217
- else # model
218
- OryHydraClient.const_get(type).build_from_hash(value)
219
- end
220
- end
221
-
222
- # Returns the string representation of the object
223
- # @return [String] String presentation of the object
224
- def to_s
225
- to_hash.to_s
226
- end
227
-
228
- # to_body is an alias to to_hash (backward compatibility)
229
- # @return [Hash] Returns the object in the form of hash
230
- def to_body
231
- to_hash
232
- end
233
-
234
- # Returns the object in the form of hash
235
- # @return [Hash] Returns the object in the form of hash
236
- def to_hash
237
- hash = {}
238
- self.class.attribute_map.each_pair do |attr, param|
239
- value = self.send(attr)
240
- if value.nil?
241
- is_nullable = self.class.openapi_nullable.include?(attr)
242
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
243
- end
244
-
245
- hash[param] = _to_hash(value)
246
- end
247
- hash
248
- end
249
-
250
- # Outputs non-array value in the form of hash
251
- # For object, use to_hash. Otherwise, just return the value
252
- # @param [Object] value Any valid value
253
- # @return [Hash] Returns the value in the form of hash
254
- def _to_hash(value)
255
- if value.is_a?(Array)
256
- value.compact.map { |v| _to_hash(v) }
257
- elsif value.is_a?(Hash)
258
- {}.tap do |hash|
259
- value.each { |k, v| hash[k] = _to_hash(v) }
260
- end
261
- elsif value.respond_to? :to_hash
262
- value.to_hash
263
- else
264
- value
265
- end
266
- end
267
- end
268
- end
@@ -1,288 +0,0 @@
1
- =begin
2
- #ORY Hydra
3
-
4
- #Welcome to the ORY Hydra HTTP API documentation. You will find documentation for all HTTP APIs here.
5
-
6
- The version of the OpenAPI document: latest
7
-
8
- Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.2.2
10
-
11
- =end
12
-
13
- require 'date'
14
-
15
- module OryHydraClient
16
- # The general form represented is: [scheme:][//[userinfo@]host][/]path[?query][#fragment] URLs that do not start with a slash after the scheme are interpreted as: scheme:opaque[?query][#fragment] Note that the Path field is stored in decoded form: /%47%6f%2f becomes /Go/. A consequence is that it is impossible to tell which slashes in the Path were slashes in the raw URL and which were %2f. This distinction is rarely important, but when it is, the code should use RawPath, an optional field which only gets set if the default encoding is different from Path. URL's String method uses the EscapedPath method to obtain the path. See the EscapedPath method for more details.
17
- class URL
18
- # force query
19
- attr_accessor :force_query
20
-
21
- # fragment
22
- attr_accessor :fragment
23
-
24
- # host
25
- attr_accessor :host
26
-
27
- # opaque
28
- attr_accessor :opaque
29
-
30
- # path
31
- attr_accessor :path
32
-
33
- # raw path
34
- attr_accessor :raw_path
35
-
36
- # raw query
37
- attr_accessor :raw_query
38
-
39
- # scheme
40
- attr_accessor :scheme
41
-
42
- # Userinfo Userinfo Userinfo Userinfo Userinfo The Userinfo type is an immutable encapsulation of username and password details for a URL. An existing Userinfo value is guaranteed to have a username set (potentially empty, as allowed by RFC 2396), and optionally a password.
43
- attr_accessor :user
44
-
45
- # Attribute mapping from ruby-style variable name to JSON key.
46
- def self.attribute_map
47
- {
48
- :'force_query' => :'ForceQuery',
49
- :'fragment' => :'Fragment',
50
- :'host' => :'Host',
51
- :'opaque' => :'Opaque',
52
- :'path' => :'Path',
53
- :'raw_path' => :'RawPath',
54
- :'raw_query' => :'RawQuery',
55
- :'scheme' => :'Scheme',
56
- :'user' => :'User'
57
- }
58
- end
59
-
60
- # Attribute type mapping.
61
- def self.openapi_types
62
- {
63
- :'force_query' => :'Boolean',
64
- :'fragment' => :'String',
65
- :'host' => :'String',
66
- :'opaque' => :'String',
67
- :'path' => :'String',
68
- :'raw_path' => :'String',
69
- :'raw_query' => :'String',
70
- :'scheme' => :'String',
71
- :'user' => :'Object'
72
- }
73
- end
74
-
75
- # List of attributes with nullable: true
76
- def self.openapi_nullable
77
- Set.new([
78
- ])
79
- end
80
-
81
- # Initializes the object
82
- # @param [Hash] attributes Model attributes in the form of hash
83
- def initialize(attributes = {})
84
- if (!attributes.is_a?(Hash))
85
- fail ArgumentError, "The input argument (attributes) must be a hash in `OryHydraClient::URL` initialize method"
86
- end
87
-
88
- # check to see if the attribute exists and convert string to symbol for hash key
89
- attributes = attributes.each_with_object({}) { |(k, v), h|
90
- if (!self.class.attribute_map.key?(k.to_sym))
91
- fail ArgumentError, "`#{k}` is not a valid attribute in `OryHydraClient::URL`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
92
- end
93
- h[k.to_sym] = v
94
- }
95
-
96
- if attributes.key?(:'force_query')
97
- self.force_query = attributes[:'force_query']
98
- end
99
-
100
- if attributes.key?(:'fragment')
101
- self.fragment = attributes[:'fragment']
102
- end
103
-
104
- if attributes.key?(:'host')
105
- self.host = attributes[:'host']
106
- end
107
-
108
- if attributes.key?(:'opaque')
109
- self.opaque = attributes[:'opaque']
110
- end
111
-
112
- if attributes.key?(:'path')
113
- self.path = attributes[:'path']
114
- end
115
-
116
- if attributes.key?(:'raw_path')
117
- self.raw_path = attributes[:'raw_path']
118
- end
119
-
120
- if attributes.key?(:'raw_query')
121
- self.raw_query = attributes[:'raw_query']
122
- end
123
-
124
- if attributes.key?(:'scheme')
125
- self.scheme = attributes[:'scheme']
126
- end
127
-
128
- if attributes.key?(:'user')
129
- self.user = attributes[:'user']
130
- end
131
- end
132
-
133
- # Show invalid properties with the reasons. Usually used together with valid?
134
- # @return Array for valid properties with the reasons
135
- def list_invalid_properties
136
- invalid_properties = Array.new
137
- invalid_properties
138
- end
139
-
140
- # Check to see if the all the properties in the model are valid
141
- # @return true if the model is valid
142
- def valid?
143
- true
144
- end
145
-
146
- # Checks equality by comparing each attribute.
147
- # @param [Object] Object to be compared
148
- def ==(o)
149
- return true if self.equal?(o)
150
- self.class == o.class &&
151
- force_query == o.force_query &&
152
- fragment == o.fragment &&
153
- host == o.host &&
154
- opaque == o.opaque &&
155
- path == o.path &&
156
- raw_path == o.raw_path &&
157
- raw_query == o.raw_query &&
158
- scheme == o.scheme &&
159
- user == o.user
160
- end
161
-
162
- # @see the `==` method
163
- # @param [Object] Object to be compared
164
- def eql?(o)
165
- self == o
166
- end
167
-
168
- # Calculates hash code according to all attributes.
169
- # @return [Integer] Hash code
170
- def hash
171
- [force_query, fragment, host, opaque, path, raw_path, raw_query, scheme, user].hash
172
- end
173
-
174
- # Builds the object from hash
175
- # @param [Hash] attributes Model attributes in the form of hash
176
- # @return [Object] Returns the model itself
177
- def self.build_from_hash(attributes)
178
- new.build_from_hash(attributes)
179
- end
180
-
181
- # Builds the object from hash
182
- # @param [Hash] attributes Model attributes in the form of hash
183
- # @return [Object] Returns the model itself
184
- def build_from_hash(attributes)
185
- return nil unless attributes.is_a?(Hash)
186
- self.class.openapi_types.each_pair do |key, type|
187
- if type =~ /\AArray<(.*)>/i
188
- # check to ensure the input is an array given that the attribute
189
- # is documented as an array but the input is not
190
- if attributes[self.class.attribute_map[key]].is_a?(Array)
191
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
192
- end
193
- elsif !attributes[self.class.attribute_map[key]].nil?
194
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
195
- end # or else data not found in attributes(hash), not an issue as the data can be optional
196
- end
197
-
198
- self
199
- end
200
-
201
- # Deserializes the data based on type
202
- # @param string type Data type
203
- # @param string value Value to be deserialized
204
- # @return [Object] Deserialized data
205
- def _deserialize(type, value)
206
- case type.to_sym
207
- when :DateTime
208
- DateTime.parse(value)
209
- when :Date
210
- Date.parse(value)
211
- when :String
212
- value.to_s
213
- when :Integer
214
- value.to_i
215
- when :Float
216
- value.to_f
217
- when :Boolean
218
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
219
- true
220
- else
221
- false
222
- end
223
- when :Object
224
- # generic object (usually a Hash), return directly
225
- value
226
- when /\AArray<(?<inner_type>.+)>\z/
227
- inner_type = Regexp.last_match[:inner_type]
228
- value.map { |v| _deserialize(inner_type, v) }
229
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
230
- k_type = Regexp.last_match[:k_type]
231
- v_type = Regexp.last_match[:v_type]
232
- {}.tap do |hash|
233
- value.each do |k, v|
234
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
235
- end
236
- end
237
- else # model
238
- OryHydraClient.const_get(type).build_from_hash(value)
239
- end
240
- end
241
-
242
- # Returns the string representation of the object
243
- # @return [String] String presentation of the object
244
- def to_s
245
- to_hash.to_s
246
- end
247
-
248
- # to_body is an alias to to_hash (backward compatibility)
249
- # @return [Hash] Returns the object in the form of hash
250
- def to_body
251
- to_hash
252
- end
253
-
254
- # Returns the object in the form of hash
255
- # @return [Hash] Returns the object in the form of hash
256
- def to_hash
257
- hash = {}
258
- self.class.attribute_map.each_pair do |attr, param|
259
- value = self.send(attr)
260
- if value.nil?
261
- is_nullable = self.class.openapi_nullable.include?(attr)
262
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
263
- end
264
-
265
- hash[param] = _to_hash(value)
266
- end
267
- hash
268
- end
269
-
270
- # Outputs non-array value in the form of hash
271
- # For object, use to_hash. Otherwise, just return the value
272
- # @param [Object] value Any valid value
273
- # @return [Hash] Returns the value in the form of hash
274
- def _to_hash(value)
275
- if value.is_a?(Array)
276
- value.compact.map { |v| _to_hash(v) }
277
- elsif value.is_a?(Hash)
278
- {}.tap do |hash|
279
- value.each { |k, v| hash[k] = _to_hash(v) }
280
- end
281
- elsif value.respond_to? :to_hash
282
- value.to_hash
283
- else
284
- value
285
- end
286
- end
287
- end
288
- end