Class: Pago::V2026_04::Services::Oauth2
- Defined in:
- lib/pago/v2026_04/services/oauth2.rb,
sig/pago/v2026_04/generated.rbs
Defined Under Namespace
Classes: Clients
Instance Attribute Summary
Attributes inherited from Service
Instance Method Summary collapse
- #authorize ⇒ Models::AuthorizeResponseUser, Models::AuthorizeResponseOrganization
- #clients ⇒ Clients
-
#introspect_token ⇒ Models::IntrospectTokenResponse
Get information about an access token.
-
#request_token ⇒ Models::TokenResponse
Request an access token using a valid grant.
-
#revoke_token ⇒ Models::RevokeTokenResponse
Revoke an access token or a refresh token.
-
#userinfo ⇒ Models::UserInfoUser, Models::UserInfoOrganization
Get information about the authenticated user.
Methods inherited from Service
Constructor Details
This class inherits a constructor from Pago::Service
Instance Method Details
#authorize ⇒ Models::AuthorizeResponseUser, Models::AuthorizeResponseOrganization
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/pago/v2026_04/services/oauth2.rb', line 12 def () data = client.request( http_method: "GET", path: "/v1/oauth2/authorize", path_params: {}, query: {}, response_type: :json, errors: { } ) ::Pago::Serde.union(data, discriminator: "sub_type", mapping: { "organization" => Models::AuthorizeResponseOrganization, "user" => Models::AuthorizeResponseUser }, variants: [Models::AuthorizeResponseUser, Models::AuthorizeResponseOrganization]) end |
#clients ⇒ Clients
8 |
# File 'lib/pago/v2026_04/services/oauth2.rb', line 8 def clients = @clients ||= Clients.new(client) |
#introspect_token ⇒ Models::IntrospectTokenResponse
Get information about an access token.
60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/pago/v2026_04/services/oauth2.rb', line 60 def introspect_token() data = client.request( http_method: "POST", path: "/v1/oauth2/introspect", path_params: {}, query: {}, response_type: :json, errors: { } ) Models::IntrospectTokenResponse.from_json(data) end |
#request_token ⇒ Models::TokenResponse
Request an access token using a valid grant.
28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/pago/v2026_04/services/oauth2.rb', line 28 def request_token() data = client.request( http_method: "POST", path: "/v1/oauth2/token", path_params: {}, query: {}, response_type: :json, errors: { } ) Models::TokenResponse.from_json(data) end |
#revoke_token ⇒ Models::RevokeTokenResponse
Revoke an access token or a refresh token.
44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/pago/v2026_04/services/oauth2.rb', line 44 def revoke_token() data = client.request( http_method: "POST", path: "/v1/oauth2/revoke", path_params: {}, query: {}, response_type: :json, errors: { } ) Models::RevokeTokenResponse.from_json(data) end |
#userinfo ⇒ Models::UserInfoUser, Models::UserInfoOrganization
Get information about the authenticated user.
76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/pago/v2026_04/services/oauth2.rb', line 76 def userinfo() data = client.request( http_method: "GET", path: "/v1/oauth2/userinfo", path_params: {}, query: {}, response_type: :json, errors: { } ) ::Pago::Serde.union(data, variants: [Models::UserInfoUser, Models::UserInfoOrganization]) end |