ory-hydra-client 0.0.0.alpha39
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +9 -0
- data/README.md +165 -0
- data/Rakefile +10 -0
- data/docs/AcceptConsentRequest.md +25 -0
- data/docs/AcceptLoginRequest.md +27 -0
- data/docs/AdminApi.md +1443 -0
- data/docs/CompletedRequest.md +17 -0
- data/docs/ConsentRequest.md +39 -0
- data/docs/ConsentRequestSession.md +19 -0
- data/docs/FlushInactiveOAuth2TokensRequest.md +17 -0
- data/docs/GenericError.md +23 -0
- data/docs/HealthNotReadyStatus.md +17 -0
- data/docs/HealthStatus.md +17 -0
- data/docs/JSONWebKey.md +49 -0
- data/docs/JSONWebKeySet.md +17 -0
- data/docs/JsonWebKeySetGeneratorRequest.md +21 -0
- data/docs/LoginRequest.md +33 -0
- data/docs/LogoutRequest.md +23 -0
- data/docs/OAuth2Client.md +79 -0
- data/docs/OAuth2TokenIntrospection.md +41 -0
- data/docs/Oauth2TokenResponse.md +27 -0
- data/docs/OauthTokenResponse.md +27 -0
- data/docs/OpenIDConnectContext.md +25 -0
- data/docs/PreviousConsentSession.md +27 -0
- data/docs/PublicApi.md +398 -0
- data/docs/RejectRequest.md +25 -0
- data/docs/UserinfoResponse.md +53 -0
- data/docs/Version.md +17 -0
- data/docs/WellKnown.md +65 -0
- data/lib/ory-hydra-client.rb +65 -0
- data/lib/ory-hydra-client/api/admin_api.rb +1879 -0
- data/lib/ory-hydra-client/api/public_api.rb +498 -0
- data/lib/ory-hydra-client/api_client.rb +386 -0
- data/lib/ory-hydra-client/api_error.rb +57 -0
- data/lib/ory-hydra-client/configuration.rb +255 -0
- data/lib/ory-hydra-client/models/accept_consent_request.rb +250 -0
- data/lib/ory-hydra-client/models/accept_login_request.rb +264 -0
- data/lib/ory-hydra-client/models/completed_request.rb +207 -0
- data/lib/ory-hydra-client/models/consent_request.rb +321 -0
- data/lib/ory-hydra-client/models/consent_request_session.rb +221 -0
- data/lib/ory-hydra-client/models/flush_inactive_o_auth2_tokens_request.rb +207 -0
- data/lib/ory-hydra-client/models/generic_error.rb +243 -0
- data/lib/ory-hydra-client/models/health_not_ready_status.rb +209 -0
- data/lib/ory-hydra-client/models/health_status.rb +207 -0
- data/lib/ory-hydra-client/models/json_web_key.rb +377 -0
- data/lib/ory-hydra-client/models/json_web_key_set.rb +209 -0
- data/lib/ory-hydra-client/models/json_web_key_set_generator_request.rb +242 -0
- data/lib/ory-hydra-client/models/login_request.rb +289 -0
- data/lib/ory-hydra-client/models/logout_request.rb +237 -0
- data/lib/ory-hydra-client/models/o_auth2_client.rb +551 -0
- data/lib/ory-hydra-client/models/o_auth2_token_introspection.rb +337 -0
- data/lib/ory-hydra-client/models/oauth2_token_response.rb +252 -0
- data/lib/ory-hydra-client/models/oauth_token_response.rb +258 -0
- data/lib/ory-hydra-client/models/open_id_connect_context.rb +253 -0
- data/lib/ory-hydra-client/models/previous_consent_session.rb +260 -0
- data/lib/ory-hydra-client/models/reject_request.rb +242 -0
- data/lib/ory-hydra-client/models/userinfo_response.rb +388 -0
- data/lib/ory-hydra-client/models/version.rb +207 -0
- data/lib/ory-hydra-client/models/well_known.rb +501 -0
- data/lib/ory-hydra-client/version.rb +15 -0
- data/ory-hydra-client.gemspec +39 -0
- data/spec/api/admin_api_spec.rb +395 -0
- data/spec/api/public_api_spec.rb +129 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/accept_consent_request_spec.rb +65 -0
- data/spec/models/accept_login_request_spec.rb +71 -0
- data/spec/models/completed_request_spec.rb +41 -0
- data/spec/models/consent_request_session_spec.rb +47 -0
- data/spec/models/consent_request_spec.rb +107 -0
- data/spec/models/flush_inactive_o_auth2_tokens_request_spec.rb +41 -0
- data/spec/models/generic_error_spec.rb +59 -0
- data/spec/models/health_not_ready_status_spec.rb +41 -0
- data/spec/models/health_status_spec.rb +41 -0
- data/spec/models/json_web_key_set_generator_request_spec.rb +53 -0
- data/spec/models/json_web_key_set_spec.rb +41 -0
- data/spec/models/json_web_key_spec.rb +137 -0
- data/spec/models/login_request_spec.rb +89 -0
- data/spec/models/logout_request_spec.rb +59 -0
- data/spec/models/o_auth2_client_spec.rb +227 -0
- data/spec/models/o_auth2_token_introspection_spec.rb +113 -0
- data/spec/models/oauth2_token_response_spec.rb +71 -0
- data/spec/models/oauth_token_response_spec.rb +71 -0
- data/spec/models/open_id_connect_context_spec.rb +65 -0
- data/spec/models/previous_consent_session_spec.rb +71 -0
- data/spec/models/reject_request_spec.rb +65 -0
- data/spec/models/userinfo_response_spec.rb +149 -0
- data/spec/models/version_spec.rb +41 -0
- data/spec/models/well_known_spec.rb +185 -0
- data/spec/spec_helper.rb +111 -0
- metadata +223 -0
@@ -0,0 +1,388 @@
|
|
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: v0.0.0-alpha.39
|
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 userinfo response
|
17
|
+
class UserinfoResponse
|
18
|
+
# End-User's birthday, represented as an ISO 8601:2004 [ISO8601‑2004] YYYY-MM-DD format. The year MAY be 0000, indicating that it is omitted. To represent only the year, YYYY format is allowed. Note that depending on the underlying platform's date related function, providing just year can result in varying month and day, so the implementers need to take this factor into account to correctly process the dates.
|
19
|
+
attr_accessor :birthdate
|
20
|
+
|
21
|
+
# End-User's preferred e-mail address. Its value MUST conform to the RFC 5322 [RFC5322] addr-spec syntax. The RP MUST NOT rely upon this value being unique, as discussed in Section 5.7.
|
22
|
+
attr_accessor :email
|
23
|
+
|
24
|
+
# True if the End-User's e-mail address has been verified; otherwise false. When this Claim Value is true, this means that the OP took affirmative steps to ensure that this e-mail address was controlled by the End-User at the time the verification was performed. The means by which an e-mail address is verified is context-specific, and dependent upon the trust framework or contractual agreements within which the parties are operating.
|
25
|
+
attr_accessor :email_verified
|
26
|
+
|
27
|
+
# Surname(s) or last name(s) of the End-User. Note that in some cultures, people can have multiple family names or no family name; all can be present, with the names being separated by space characters.
|
28
|
+
attr_accessor :family_name
|
29
|
+
|
30
|
+
# End-User's gender. Values defined by this specification are female and male. Other values MAY be used when neither of the defined values are applicable.
|
31
|
+
attr_accessor :gender
|
32
|
+
|
33
|
+
# Given name(s) or first name(s) of the End-User. Note that in some cultures, people can have multiple given names; all can be present, with the names being separated by space characters.
|
34
|
+
attr_accessor :given_name
|
35
|
+
|
36
|
+
# End-User's locale, represented as a BCP47 [RFC5646] language tag. This is typically an ISO 639-1 Alpha-2 [ISO639‑1] language code in lowercase and an ISO 3166-1 Alpha-2 [ISO3166‑1] country code in uppercase, separated by a dash. For example, en-US or fr-CA. As a compatibility note, some implementations have used an underscore as the separator rather than a dash, for example, en_US; Relying Parties MAY choose to accept this locale syntax as well.
|
37
|
+
attr_accessor :locale
|
38
|
+
|
39
|
+
# Middle name(s) of the End-User. Note that in some cultures, people can have multiple middle names; all can be present, with the names being separated by space characters. Also note that in some cultures, middle names are not used.
|
40
|
+
attr_accessor :middle_name
|
41
|
+
|
42
|
+
# End-User's full name in displayable form including all name parts, possibly including titles and suffixes, ordered according to the End-User's locale and preferences.
|
43
|
+
attr_accessor :name
|
44
|
+
|
45
|
+
# Casual name of the End-User that may or may not be the same as the given_name. For instance, a nickname value of Mike might be returned alongside a given_name value of Michael.
|
46
|
+
attr_accessor :nickname
|
47
|
+
|
48
|
+
# End-User's preferred telephone number. E.164 [E.164] is RECOMMENDED as the format of this Claim, for example, +1 (425) 555-1212 or +56 (2) 687 2400. If the phone number contains an extension, it is RECOMMENDED that the extension be represented using the RFC 3966 [RFC3966] extension syntax, for example, +1 (604) 555-1234;ext=5678.
|
49
|
+
attr_accessor :phone_number
|
50
|
+
|
51
|
+
# True if the End-User's phone number has been verified; otherwise false. When this Claim Value is true, this means that the OP took affirmative steps to ensure that this phone number was controlled by the End-User at the time the verification was performed. The means by which a phone number is verified is context-specific, and dependent upon the trust framework or contractual agreements within which the parties are operating. When true, the phone_number Claim MUST be in E.164 format and any extensions MUST be represented in RFC 3966 format.
|
52
|
+
attr_accessor :phone_number_verified
|
53
|
+
|
54
|
+
# URL of the End-User's profile picture. This URL MUST refer to an image file (for example, a PNG, JPEG, or GIF image file), rather than to a Web page containing an image. Note that this URL SHOULD specifically reference a profile photo of the End-User suitable for displaying when describing the End-User, rather than an arbitrary photo taken by the End-User.
|
55
|
+
attr_accessor :picture
|
56
|
+
|
57
|
+
# Non-unique shorthand name by which the End-User wishes to be referred to at the RP, such as janedoe or j.doe. This value MAY be any valid JSON string including special characters such as @, /, or whitespace.
|
58
|
+
attr_accessor :preferred_username
|
59
|
+
|
60
|
+
# URL of the End-User's profile page. The contents of this Web page SHOULD be about the End-User.
|
61
|
+
attr_accessor :profile
|
62
|
+
|
63
|
+
# Subject - Identifier for the End-User at the IssuerURL.
|
64
|
+
attr_accessor :sub
|
65
|
+
|
66
|
+
# Time the End-User's information was last updated. Its value is a JSON number representing the number of seconds from 1970-01-01T0:0:0Z as measured in UTC until the date/time.
|
67
|
+
attr_accessor :updated_at
|
68
|
+
|
69
|
+
# URL of the End-User's Web page or blog. This Web page SHOULD contain information published by the End-User or an organization that the End-User is affiliated with.
|
70
|
+
attr_accessor :website
|
71
|
+
|
72
|
+
# String from zoneinfo [zoneinfo] time zone database representing the End-User's time zone. For example, Europe/Paris or America/Los_Angeles.
|
73
|
+
attr_accessor :zoneinfo
|
74
|
+
|
75
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
76
|
+
def self.attribute_map
|
77
|
+
{
|
78
|
+
:'birthdate' => :'birthdate',
|
79
|
+
:'email' => :'email',
|
80
|
+
:'email_verified' => :'email_verified',
|
81
|
+
:'family_name' => :'family_name',
|
82
|
+
:'gender' => :'gender',
|
83
|
+
:'given_name' => :'given_name',
|
84
|
+
:'locale' => :'locale',
|
85
|
+
:'middle_name' => :'middle_name',
|
86
|
+
:'name' => :'name',
|
87
|
+
:'nickname' => :'nickname',
|
88
|
+
:'phone_number' => :'phone_number',
|
89
|
+
:'phone_number_verified' => :'phone_number_verified',
|
90
|
+
:'picture' => :'picture',
|
91
|
+
:'preferred_username' => :'preferred_username',
|
92
|
+
:'profile' => :'profile',
|
93
|
+
:'sub' => :'sub',
|
94
|
+
:'updated_at' => :'updated_at',
|
95
|
+
:'website' => :'website',
|
96
|
+
:'zoneinfo' => :'zoneinfo'
|
97
|
+
}
|
98
|
+
end
|
99
|
+
|
100
|
+
# Attribute type mapping.
|
101
|
+
def self.openapi_types
|
102
|
+
{
|
103
|
+
:'birthdate' => :'String',
|
104
|
+
:'email' => :'String',
|
105
|
+
:'email_verified' => :'Boolean',
|
106
|
+
:'family_name' => :'String',
|
107
|
+
:'gender' => :'String',
|
108
|
+
:'given_name' => :'String',
|
109
|
+
:'locale' => :'String',
|
110
|
+
:'middle_name' => :'String',
|
111
|
+
:'name' => :'String',
|
112
|
+
:'nickname' => :'String',
|
113
|
+
:'phone_number' => :'String',
|
114
|
+
:'phone_number_verified' => :'Boolean',
|
115
|
+
:'picture' => :'String',
|
116
|
+
:'preferred_username' => :'String',
|
117
|
+
:'profile' => :'String',
|
118
|
+
:'sub' => :'String',
|
119
|
+
:'updated_at' => :'Integer',
|
120
|
+
:'website' => :'String',
|
121
|
+
:'zoneinfo' => :'String'
|
122
|
+
}
|
123
|
+
end
|
124
|
+
|
125
|
+
# List of attributes with nullable: true
|
126
|
+
def self.openapi_nullable
|
127
|
+
Set.new([
|
128
|
+
])
|
129
|
+
end
|
130
|
+
|
131
|
+
# Initializes the object
|
132
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
133
|
+
def initialize(attributes = {})
|
134
|
+
if (!attributes.is_a?(Hash))
|
135
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `OryHydraClient::UserinfoResponse` initialize method"
|
136
|
+
end
|
137
|
+
|
138
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
139
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
140
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
141
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `OryHydraClient::UserinfoResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
142
|
+
end
|
143
|
+
h[k.to_sym] = v
|
144
|
+
}
|
145
|
+
|
146
|
+
if attributes.key?(:'birthdate')
|
147
|
+
self.birthdate = attributes[:'birthdate']
|
148
|
+
end
|
149
|
+
|
150
|
+
if attributes.key?(:'email')
|
151
|
+
self.email = attributes[:'email']
|
152
|
+
end
|
153
|
+
|
154
|
+
if attributes.key?(:'email_verified')
|
155
|
+
self.email_verified = attributes[:'email_verified']
|
156
|
+
end
|
157
|
+
|
158
|
+
if attributes.key?(:'family_name')
|
159
|
+
self.family_name = attributes[:'family_name']
|
160
|
+
end
|
161
|
+
|
162
|
+
if attributes.key?(:'gender')
|
163
|
+
self.gender = attributes[:'gender']
|
164
|
+
end
|
165
|
+
|
166
|
+
if attributes.key?(:'given_name')
|
167
|
+
self.given_name = attributes[:'given_name']
|
168
|
+
end
|
169
|
+
|
170
|
+
if attributes.key?(:'locale')
|
171
|
+
self.locale = attributes[:'locale']
|
172
|
+
end
|
173
|
+
|
174
|
+
if attributes.key?(:'middle_name')
|
175
|
+
self.middle_name = attributes[:'middle_name']
|
176
|
+
end
|
177
|
+
|
178
|
+
if attributes.key?(:'name')
|
179
|
+
self.name = attributes[:'name']
|
180
|
+
end
|
181
|
+
|
182
|
+
if attributes.key?(:'nickname')
|
183
|
+
self.nickname = attributes[:'nickname']
|
184
|
+
end
|
185
|
+
|
186
|
+
if attributes.key?(:'phone_number')
|
187
|
+
self.phone_number = attributes[:'phone_number']
|
188
|
+
end
|
189
|
+
|
190
|
+
if attributes.key?(:'phone_number_verified')
|
191
|
+
self.phone_number_verified = attributes[:'phone_number_verified']
|
192
|
+
end
|
193
|
+
|
194
|
+
if attributes.key?(:'picture')
|
195
|
+
self.picture = attributes[:'picture']
|
196
|
+
end
|
197
|
+
|
198
|
+
if attributes.key?(:'preferred_username')
|
199
|
+
self.preferred_username = attributes[:'preferred_username']
|
200
|
+
end
|
201
|
+
|
202
|
+
if attributes.key?(:'profile')
|
203
|
+
self.profile = attributes[:'profile']
|
204
|
+
end
|
205
|
+
|
206
|
+
if attributes.key?(:'sub')
|
207
|
+
self.sub = attributes[:'sub']
|
208
|
+
end
|
209
|
+
|
210
|
+
if attributes.key?(:'updated_at')
|
211
|
+
self.updated_at = attributes[:'updated_at']
|
212
|
+
end
|
213
|
+
|
214
|
+
if attributes.key?(:'website')
|
215
|
+
self.website = attributes[:'website']
|
216
|
+
end
|
217
|
+
|
218
|
+
if attributes.key?(:'zoneinfo')
|
219
|
+
self.zoneinfo = attributes[:'zoneinfo']
|
220
|
+
end
|
221
|
+
end
|
222
|
+
|
223
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
224
|
+
# @return Array for valid properties with the reasons
|
225
|
+
def list_invalid_properties
|
226
|
+
invalid_properties = Array.new
|
227
|
+
invalid_properties
|
228
|
+
end
|
229
|
+
|
230
|
+
# Check to see if the all the properties in the model are valid
|
231
|
+
# @return true if the model is valid
|
232
|
+
def valid?
|
233
|
+
true
|
234
|
+
end
|
235
|
+
|
236
|
+
# Checks equality by comparing each attribute.
|
237
|
+
# @param [Object] Object to be compared
|
238
|
+
def ==(o)
|
239
|
+
return true if self.equal?(o)
|
240
|
+
self.class == o.class &&
|
241
|
+
birthdate == o.birthdate &&
|
242
|
+
email == o.email &&
|
243
|
+
email_verified == o.email_verified &&
|
244
|
+
family_name == o.family_name &&
|
245
|
+
gender == o.gender &&
|
246
|
+
given_name == o.given_name &&
|
247
|
+
locale == o.locale &&
|
248
|
+
middle_name == o.middle_name &&
|
249
|
+
name == o.name &&
|
250
|
+
nickname == o.nickname &&
|
251
|
+
phone_number == o.phone_number &&
|
252
|
+
phone_number_verified == o.phone_number_verified &&
|
253
|
+
picture == o.picture &&
|
254
|
+
preferred_username == o.preferred_username &&
|
255
|
+
profile == o.profile &&
|
256
|
+
sub == o.sub &&
|
257
|
+
updated_at == o.updated_at &&
|
258
|
+
website == o.website &&
|
259
|
+
zoneinfo == o.zoneinfo
|
260
|
+
end
|
261
|
+
|
262
|
+
# @see the `==` method
|
263
|
+
# @param [Object] Object to be compared
|
264
|
+
def eql?(o)
|
265
|
+
self == o
|
266
|
+
end
|
267
|
+
|
268
|
+
# Calculates hash code according to all attributes.
|
269
|
+
# @return [Integer] Hash code
|
270
|
+
def hash
|
271
|
+
[birthdate, email, email_verified, family_name, gender, given_name, locale, middle_name, name, nickname, phone_number, phone_number_verified, picture, preferred_username, profile, sub, updated_at, website, zoneinfo].hash
|
272
|
+
end
|
273
|
+
|
274
|
+
# Builds the object from hash
|
275
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
276
|
+
# @return [Object] Returns the model itself
|
277
|
+
def self.build_from_hash(attributes)
|
278
|
+
new.build_from_hash(attributes)
|
279
|
+
end
|
280
|
+
|
281
|
+
# Builds the object from hash
|
282
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
283
|
+
# @return [Object] Returns the model itself
|
284
|
+
def build_from_hash(attributes)
|
285
|
+
return nil unless attributes.is_a?(Hash)
|
286
|
+
self.class.openapi_types.each_pair do |key, type|
|
287
|
+
if type =~ /\AArray<(.*)>/i
|
288
|
+
# check to ensure the input is an array given that the attribute
|
289
|
+
# is documented as an array but the input is not
|
290
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
291
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
292
|
+
end
|
293
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
294
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
295
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
296
|
+
end
|
297
|
+
|
298
|
+
self
|
299
|
+
end
|
300
|
+
|
301
|
+
# Deserializes the data based on type
|
302
|
+
# @param string type Data type
|
303
|
+
# @param string value Value to be deserialized
|
304
|
+
# @return [Object] Deserialized data
|
305
|
+
def _deserialize(type, value)
|
306
|
+
case type.to_sym
|
307
|
+
when :DateTime
|
308
|
+
DateTime.parse(value)
|
309
|
+
when :Date
|
310
|
+
Date.parse(value)
|
311
|
+
when :String
|
312
|
+
value.to_s
|
313
|
+
when :Integer
|
314
|
+
value.to_i
|
315
|
+
when :Float
|
316
|
+
value.to_f
|
317
|
+
when :Boolean
|
318
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
319
|
+
true
|
320
|
+
else
|
321
|
+
false
|
322
|
+
end
|
323
|
+
when :Object
|
324
|
+
# generic object (usually a Hash), return directly
|
325
|
+
value
|
326
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
327
|
+
inner_type = Regexp.last_match[:inner_type]
|
328
|
+
value.map { |v| _deserialize(inner_type, v) }
|
329
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
330
|
+
k_type = Regexp.last_match[:k_type]
|
331
|
+
v_type = Regexp.last_match[:v_type]
|
332
|
+
{}.tap do |hash|
|
333
|
+
value.each do |k, v|
|
334
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
335
|
+
end
|
336
|
+
end
|
337
|
+
else # model
|
338
|
+
OryHydraClient.const_get(type).build_from_hash(value)
|
339
|
+
end
|
340
|
+
end
|
341
|
+
|
342
|
+
# Returns the string representation of the object
|
343
|
+
# @return [String] String presentation of the object
|
344
|
+
def to_s
|
345
|
+
to_hash.to_s
|
346
|
+
end
|
347
|
+
|
348
|
+
# to_body is an alias to to_hash (backward compatibility)
|
349
|
+
# @return [Hash] Returns the object in the form of hash
|
350
|
+
def to_body
|
351
|
+
to_hash
|
352
|
+
end
|
353
|
+
|
354
|
+
# Returns the object in the form of hash
|
355
|
+
# @return [Hash] Returns the object in the form of hash
|
356
|
+
def to_hash
|
357
|
+
hash = {}
|
358
|
+
self.class.attribute_map.each_pair do |attr, param|
|
359
|
+
value = self.send(attr)
|
360
|
+
if value.nil?
|
361
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
362
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
363
|
+
end
|
364
|
+
|
365
|
+
hash[param] = _to_hash(value)
|
366
|
+
end
|
367
|
+
hash
|
368
|
+
end
|
369
|
+
|
370
|
+
# Outputs non-array value in the form of hash
|
371
|
+
# For object, use to_hash. Otherwise, just return the value
|
372
|
+
# @param [Object] value Any valid value
|
373
|
+
# @return [Hash] Returns the value in the form of hash
|
374
|
+
def _to_hash(value)
|
375
|
+
if value.is_a?(Array)
|
376
|
+
value.compact.map { |v| _to_hash(v) }
|
377
|
+
elsif value.is_a?(Hash)
|
378
|
+
{}.tap do |hash|
|
379
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
380
|
+
end
|
381
|
+
elsif value.respond_to? :to_hash
|
382
|
+
value.to_hash
|
383
|
+
else
|
384
|
+
value
|
385
|
+
end
|
386
|
+
end
|
387
|
+
end
|
388
|
+
end
|
@@ -0,0 +1,207 @@
|
|
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: v0.0.0-alpha.39
|
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
|
+
class Version
|
17
|
+
# Version is the service's version.
|
18
|
+
attr_accessor :version
|
19
|
+
|
20
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
21
|
+
def self.attribute_map
|
22
|
+
{
|
23
|
+
:'version' => :'version'
|
24
|
+
}
|
25
|
+
end
|
26
|
+
|
27
|
+
# Attribute type mapping.
|
28
|
+
def self.openapi_types
|
29
|
+
{
|
30
|
+
:'version' => :'String'
|
31
|
+
}
|
32
|
+
end
|
33
|
+
|
34
|
+
# List of attributes with nullable: true
|
35
|
+
def self.openapi_nullable
|
36
|
+
Set.new([
|
37
|
+
])
|
38
|
+
end
|
39
|
+
|
40
|
+
# Initializes the object
|
41
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
42
|
+
def initialize(attributes = {})
|
43
|
+
if (!attributes.is_a?(Hash))
|
44
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `OryHydraClient::Version` initialize method"
|
45
|
+
end
|
46
|
+
|
47
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
48
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
49
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
50
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `OryHydraClient::Version`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
51
|
+
end
|
52
|
+
h[k.to_sym] = v
|
53
|
+
}
|
54
|
+
|
55
|
+
if attributes.key?(:'version')
|
56
|
+
self.version = attributes[:'version']
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
61
|
+
# @return Array for valid properties with the reasons
|
62
|
+
def list_invalid_properties
|
63
|
+
invalid_properties = Array.new
|
64
|
+
invalid_properties
|
65
|
+
end
|
66
|
+
|
67
|
+
# Check to see if the all the properties in the model are valid
|
68
|
+
# @return true if the model is valid
|
69
|
+
def valid?
|
70
|
+
true
|
71
|
+
end
|
72
|
+
|
73
|
+
# Checks equality by comparing each attribute.
|
74
|
+
# @param [Object] Object to be compared
|
75
|
+
def ==(o)
|
76
|
+
return true if self.equal?(o)
|
77
|
+
self.class == o.class &&
|
78
|
+
version == o.version
|
79
|
+
end
|
80
|
+
|
81
|
+
# @see the `==` method
|
82
|
+
# @param [Object] Object to be compared
|
83
|
+
def eql?(o)
|
84
|
+
self == o
|
85
|
+
end
|
86
|
+
|
87
|
+
# Calculates hash code according to all attributes.
|
88
|
+
# @return [Integer] Hash code
|
89
|
+
def hash
|
90
|
+
[version].hash
|
91
|
+
end
|
92
|
+
|
93
|
+
# Builds the object from hash
|
94
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
95
|
+
# @return [Object] Returns the model itself
|
96
|
+
def self.build_from_hash(attributes)
|
97
|
+
new.build_from_hash(attributes)
|
98
|
+
end
|
99
|
+
|
100
|
+
# Builds the object from hash
|
101
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
102
|
+
# @return [Object] Returns the model itself
|
103
|
+
def build_from_hash(attributes)
|
104
|
+
return nil unless attributes.is_a?(Hash)
|
105
|
+
self.class.openapi_types.each_pair do |key, type|
|
106
|
+
if type =~ /\AArray<(.*)>/i
|
107
|
+
# check to ensure the input is an array given that the attribute
|
108
|
+
# is documented as an array but the input is not
|
109
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
110
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
111
|
+
end
|
112
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
113
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
114
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
115
|
+
end
|
116
|
+
|
117
|
+
self
|
118
|
+
end
|
119
|
+
|
120
|
+
# Deserializes the data based on type
|
121
|
+
# @param string type Data type
|
122
|
+
# @param string value Value to be deserialized
|
123
|
+
# @return [Object] Deserialized data
|
124
|
+
def _deserialize(type, value)
|
125
|
+
case type.to_sym
|
126
|
+
when :DateTime
|
127
|
+
DateTime.parse(value)
|
128
|
+
when :Date
|
129
|
+
Date.parse(value)
|
130
|
+
when :String
|
131
|
+
value.to_s
|
132
|
+
when :Integer
|
133
|
+
value.to_i
|
134
|
+
when :Float
|
135
|
+
value.to_f
|
136
|
+
when :Boolean
|
137
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
138
|
+
true
|
139
|
+
else
|
140
|
+
false
|
141
|
+
end
|
142
|
+
when :Object
|
143
|
+
# generic object (usually a Hash), return directly
|
144
|
+
value
|
145
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
146
|
+
inner_type = Regexp.last_match[:inner_type]
|
147
|
+
value.map { |v| _deserialize(inner_type, v) }
|
148
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
149
|
+
k_type = Regexp.last_match[:k_type]
|
150
|
+
v_type = Regexp.last_match[:v_type]
|
151
|
+
{}.tap do |hash|
|
152
|
+
value.each do |k, v|
|
153
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
154
|
+
end
|
155
|
+
end
|
156
|
+
else # model
|
157
|
+
OryHydraClient.const_get(type).build_from_hash(value)
|
158
|
+
end
|
159
|
+
end
|
160
|
+
|
161
|
+
# Returns the string representation of the object
|
162
|
+
# @return [String] String presentation of the object
|
163
|
+
def to_s
|
164
|
+
to_hash.to_s
|
165
|
+
end
|
166
|
+
|
167
|
+
# to_body is an alias to to_hash (backward compatibility)
|
168
|
+
# @return [Hash] Returns the object in the form of hash
|
169
|
+
def to_body
|
170
|
+
to_hash
|
171
|
+
end
|
172
|
+
|
173
|
+
# Returns the object in the form of hash
|
174
|
+
# @return [Hash] Returns the object in the form of hash
|
175
|
+
def to_hash
|
176
|
+
hash = {}
|
177
|
+
self.class.attribute_map.each_pair do |attr, param|
|
178
|
+
value = self.send(attr)
|
179
|
+
if value.nil?
|
180
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
181
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
182
|
+
end
|
183
|
+
|
184
|
+
hash[param] = _to_hash(value)
|
185
|
+
end
|
186
|
+
hash
|
187
|
+
end
|
188
|
+
|
189
|
+
# Outputs non-array value in the form of hash
|
190
|
+
# For object, use to_hash. Otherwise, just return the value
|
191
|
+
# @param [Object] value Any valid value
|
192
|
+
# @return [Hash] Returns the value in the form of hash
|
193
|
+
def _to_hash(value)
|
194
|
+
if value.is_a?(Array)
|
195
|
+
value.compact.map { |v| _to_hash(v) }
|
196
|
+
elsif value.is_a?(Hash)
|
197
|
+
{}.tap do |hash|
|
198
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
199
|
+
end
|
200
|
+
elsif value.respond_to? :to_hash
|
201
|
+
value.to_hash
|
202
|
+
else
|
203
|
+
value
|
204
|
+
end
|
205
|
+
end
|
206
|
+
end
|
207
|
+
end
|