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
-
#delete(request_options: nil) ⇒ Hash
Delete the signed-in user's account.
-
#deletion_preview(request_options: nil) ⇒ Hash
What deleting this account would do.
-
#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.
3418 3419 3420 3421 3422 3423 |
# File 'lib/infrawrench/client.rb', line 3418 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.
3410 3411 3412 |
# File 'lib/infrawrench/client.rb', line 3410 def email_change @email_change end |
#mfa ⇒ ProfileMfaNamespace (readonly)
Returns client.profile.mfa.
3412 3413 3414 |
# File 'lib/infrawrench/client.rb', line 3412 def mfa @mfa end |
#sessions ⇒ ProfileSessionsNamespace (readonly)
Returns client.profile.sessions.
3414 3415 3416 |
# File 'lib/infrawrench/client.rb', line 3414 def sessions @sessions end |
Instance Method Details
#delete(request_options: nil) ⇒ Hash
Delete the signed-in user's account
Irreversible. Organizations where the caller is the only member are
deleted and their subscriptions cancelled; other memberships are simply
removed. Refuses with transfer_ownership_required while the caller is
the only owner of an organization other people belong to.
DELETE /api/profile
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.
Raises on 409: The caller still solely owns a shared organization; nothing was deleted.
Raises on 502: A subscription could not be cancelled; nothing was deleted.
3447 3448 3449 3450 3451 3452 3453 |
# File 'lib/infrawrench/client.rb', line 3447 def delete(request_options: nil) @transport.request( http_method: "DELETE", path: "/api/profile", request_options: ) end |
#deletion_preview(request_options: nil) ⇒ Hash
What deleting this account would do
Read-only. Lets a confirmation screen name the organizations that go with the account, and the ones that must be handed over first.
GET /api/profile/deletion-preview
Raises on 401: Unauthenticated
3468 3469 3470 3471 3472 3473 3474 |
# File 'lib/infrawrench/client.rb', line 3468 def deletion_preview(request_options: nil) @transport.request( http_method: "GET", path: "/api/profile/deletion-preview", request_options: ) end |
#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
3488 3489 3490 3491 3492 3493 3494 |
# File 'lib/infrawrench/client.rb', line 3488 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.
3512 3513 3514 3515 3516 3517 3518 |
# File 'lib/infrawrench/client.rb', line 3512 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
3531 3532 3533 3534 3535 3536 3537 |
# File 'lib/infrawrench/client.rb', line 3531 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
3551 3552 3553 3554 3555 3556 3557 3558 |
# File 'lib/infrawrench/client.rb', line 3551 def update(body: nil, request_options: nil) @transport.request( http_method: "PATCH", path: "/api/profile", body: body, request_options: ) end |