Class: Infrawrench::ProfileEmailChangeNamespace

Inherits:
Object
  • Object
show all
Defined in:
lib/infrawrench/client.rb,
sig/infrawrench/sdk.rbs

Overview

client.profile.email_change

Instance Method Summary collapse

Constructor Details

#initialize(transport) ⇒ ProfileEmailChangeNamespace

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 ProfileEmailChangeNamespace.

Parameters:



1925
1926
1927
# File 'lib/infrawrench/client.rb', line 1925

def initialize(transport)
  @transport = transport
end

Instance Method Details

#confirm(body: nil, request_options: nil) ⇒ Hash

Redeem an email change code

On success the account's email is the new address and it is marked verified.

POST /api/profile/email-change/confirm

Raises on 400: Bad request

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.

Parameters:

  • body (Hash, nil) (defaults to: nil)

    Request body, shaped as Hash.

  • request_options (Hash, nil) (defaults to: nil)

    Per-call :headers, :timeout and :open_timeout.

  • body: ({ "code" => String }, nil) (defaults to: nil)
  • request_options: (Hash[Symbol, untyped], nil) (defaults to: nil)

Returns:

  • (Hash)

    Parsed JSON, shaped as Hash — see sig/infrawrench/sdk.rbs.

Raises:



1947
1948
1949
1950
1951
1952
1953
1954
# File 'lib/infrawrench/client.rb', line 1947

def confirm(body: nil, request_options: nil)
  @transport.request(
    http_method: "POST",
    path: "/api/profile/email-change/confirm",
    body: body,
    request_options: request_options
  )
end

#create(body: nil, request_options: nil) ⇒ Hash

Send a confirmation code to a new email address

Starts an email change. The code goes to the new address and the account keeps its current address until /api/profile/email-change/confirm redeems it, so an abandoned or mistyped change is harmless.

POST /api/profile/email-change

Raises on 400: Bad request

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.

Parameters:

  • body (Hash, nil) (defaults to: nil)

    Request body, shaped as Hash.

  • request_options (Hash, nil) (defaults to: nil)

    Per-call :headers, :timeout and :open_timeout.

  • body: ({ "newEmail" => String }, nil) (defaults to: nil)
  • request_options: (Hash[Symbol, untyped], nil) (defaults to: nil)

Returns:

  • (Hash)

    Parsed JSON, shaped as Hash — see sig/infrawrench/sdk.rbs.

Raises:



1975
1976
1977
1978
1979
1980
1981
1982
# File 'lib/infrawrench/client.rb', line 1975

def create(body: nil, request_options: nil)
  @transport.request(
    http_method: "POST",
    path: "/api/profile/email-change",
    body: body,
    request_options: request_options
  )
end