Class: BundleUp::Unify::Me
- Defined in:
- lib/bundleup/unify/me.rb,
sig/bundleup/unify/me.rbs
Overview
Client for the root-level identity endpoint.
me is the one unified method every provider implements, so the API mounts
it at the root rather than under a vertical. It is exposed on the Unify
client as unify.me rather than as a namespace.
Constant Summary
Constants inherited from Base
Base::API_VERSION, Base::BASE_URL
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#get(params = {}) ⇒ { data: account }
Fetches the account the connection is authenticated as.
Methods inherited from Base
Constructor Details
This class inherits a constructor from BundleUp::Unify::Base
Instance Method Details
#get(params = {}) ⇒ { data: account }
Fetches the account the connection is authenticated as.
Providers that authorize per workspace, portal, tenant or company return that account instead of a user, and fields the provider does not expose come back as nil.
16 17 18 19 20 21 22 23 24 |
# File 'lib/bundleup/unify/me.rb', line 16 def get(params = {}) response = connection.get('me') do |req| req.params = params end raise "Failed to fetch me: #{response.status}" unless response.success? response.body end |