Class: Infrawrench::ProfileNamespace
- Inherits:
-
Object
- Object
- Infrawrench::ProfileNamespace
- Defined in:
- lib/infrawrench/client.rb,
sig/infrawrench/sdk.rbs
Overview
client.profile
Instance Attribute Summary collapse
-
#email_change ⇒ ProfileEmailChangeNamespace
readonly
client.profile.email_change. -
#mfa ⇒ ProfileMfaNamespace
readonly
client.profile.mfa. -
#sessions ⇒ ProfileSessionsNamespace
readonly
client.profile.sessions.
Instance Method Summary collapse
-
#get(request_options: nil) ⇒ Hash
The signed-in user's account profile.
-
#initialize(transport) ⇒ ProfileNamespace
constructor
private
A new instance of ProfileNamespace.
-
#password_reset(request_options: nil) ⇒ Hash
Mint a password reset link for the signed-in user.
-
#send_verification_email(request_options: nil) ⇒ Hash
Re-send the email verification message.
-
#update(body: nil, request_options: nil) ⇒ Hash
Update the signed-in user's name.
Constructor Details
#initialize(transport) ⇒ ProfileNamespace
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of ProfileNamespace.
2334 2335 2336 2337 2338 2339 |
# File 'lib/infrawrench/client.rb', line 2334 def initialize(transport) @transport = transport @email_change = ProfileEmailChangeNamespace.new(@transport) @mfa = ProfileMfaNamespace.new(@transport) @sessions = ProfileSessionsNamespace.new(@transport) end |
Instance Attribute Details
#email_change ⇒ ProfileEmailChangeNamespace (readonly)
Returns client.profile.email_change.
2326 2327 2328 |
# File 'lib/infrawrench/client.rb', line 2326 def email_change @email_change end |
#mfa ⇒ ProfileMfaNamespace (readonly)
Returns client.profile.mfa.
2328 2329 2330 |
# File 'lib/infrawrench/client.rb', line 2328 def mfa @mfa end |
#sessions ⇒ ProfileSessionsNamespace (readonly)
Returns client.profile.sessions.
2330 2331 2332 |
# File 'lib/infrawrench/client.rb', line 2330 def sessions @sessions end |
Instance Method Details
#get(request_options: nil) ⇒ Hash
The signed-in user's account profile
User-scoped, not organization-scoped: one WorkOS identity is shared across every organization the user belongs to.
GET /api/profile
Raises on 401: Unauthenticated
2353 2354 2355 2356 2357 2358 2359 |
# File 'lib/infrawrench/client.rb', line 2353 def get(request_options: nil) @transport.request( http_method: "GET", path: "/api/profile", request_options: ) end |
#password_reset(request_options: nil) ⇒ Hash
Mint a password reset link for the signed-in user
Returns a one-time AuthKit-hosted reset URL rather than emailing it — the caller already holds a valid session for the account. Also the way to set a first password on an SSO or OAuth-only account.
POST /api/profile/password-reset
Raises on 401: Unauthenticated
Raises on 403: Recent sign-in required. Send the user through sign-in again and retry; the request itself was well-formed.
2377 2378 2379 2380 2381 2382 2383 |
# File 'lib/infrawrench/client.rb', line 2377 def password_reset(request_options: nil) @transport.request( http_method: "POST", path: "/api/profile/password-reset", request_options: ) end |
#send_verification_email(request_options: nil) ⇒ Hash
Re-send the email verification message
POST /api/profile/send-verification-email
Raises on 400: Bad request
Raises on 401: Unauthenticated
2396 2397 2398 2399 2400 2401 2402 |
# File 'lib/infrawrench/client.rb', line 2396 def send_verification_email(request_options: nil) @transport.request( http_method: "POST", path: "/api/profile/send-verification-email", request_options: ) end |
#update(body: nil, request_options: nil) ⇒ Hash
Update the signed-in user's name
PATCH /api/profile
Raises on 400: Bad request
Raises on 401: Unauthenticated
2416 2417 2418 2419 2420 2421 2422 2423 |
# File 'lib/infrawrench/client.rb', line 2416 def update(body: nil, request_options: nil) @transport.request( http_method: "PATCH", path: "/api/profile", body: body, request_options: ) end |