Class: Telnyx::Resources::Dir::VerifyEmail

Inherits:
Object
  • Object
show all
Defined in:
lib/telnyx/resources/dir/verify_email.rb,
sig/telnyx/resources/dir/verify_email.rbs

Overview

Verify ownership of a DIR's authorizer email. A short code is emailed and confirmed; the email must be verified before references can be submitted.

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ VerifyEmail

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

Parameters:



85
86
87
# File 'lib/telnyx/resources/dir/verify_email.rb', line 85

def initialize(client:)
  @client = client
end

Instance Method Details

#confirm(dir_id, code:, request_options: {}) ⇒ Telnyx::Models::Dir::EmailVerificationStatusWrapped

Submit the 6-digit code that was emailed to the DIR's authorizer email. On success the authorizer email is marked verified.

For security, any failure (wrong, expired, already-used, or too many attempts) returns the same generic message.

Parameters:

  • dir_id (String)

    The DIR id. Lowercase UUID.

  • code (String)

    The 6-digit code sent to the authorizer email.

  • request_options (Telnyx::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



71
72
73
74
75
76
77
78
79
80
# File 'lib/telnyx/resources/dir/verify_email.rb', line 71

def confirm(dir_id, params)
  parsed, options = Telnyx::Dir::VerifyEmailConfirmParams.dump_request(params)
  @client.request(
    method: :post,
    path: ["dir/%1$s/verify_email/confirm", dir_id],
    body: parsed,
    model: Telnyx::Dir::EmailVerificationStatusWrapped,
    options: options
  )
end

#create(dir_id, request_options: {}) ⇒ Telnyx::Models::Dir::EmailVerificationStatusWrapped

Email a 6-digit code to the DIR's authorizer email to confirm ownership of that address.

The code expires in 15 minutes. Requesting a new code invalidates any previous one. Resends are rate limited (a short cooldown plus a daily cap). Submit the code to POST /dir/{dir_id}/verify_email/confirm.

Parameters:

  • dir_id (String)

    The DIR id. Lowercase UUID.

  • request_options (Telnyx::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



25
26
27
28
29
30
31
32
# File 'lib/telnyx/resources/dir/verify_email.rb', line 25

def create(dir_id, params = {})
  @client.request(
    method: :post,
    path: ["dir/%1$s/verify_email", dir_id],
    model: Telnyx::Dir::EmailVerificationStatusWrapped,
    options: params[:request_options]
  )
end

#list(dir_id, request_options: {}) ⇒ Telnyx::Models::Dir::EmailVerificationStatusWrapped

Whether the DIR's current authorizer email has been verified.

Parameters:

  • dir_id (String)

    The DIR id. Lowercase UUID.

  • request_options (Telnyx::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



45
46
47
48
49
50
51
52
# File 'lib/telnyx/resources/dir/verify_email.rb', line 45

def list(dir_id, params = {})
  @client.request(
    method: :get,
    path: ["dir/%1$s/verify_email", dir_id],
    model: Telnyx::Dir::EmailVerificationStatusWrapped,
    options: params[:request_options]
  )
end