Module: Auth0::Api::V2::Emails

Included in:
Auth0::Api::V2
Defined in:
lib/auth0/api/v2/emails.rb

Overview

Methods to use the connections endpoints

Instance Method Summary collapse

Instance Method Details

#configure_provider(body) ⇒ Object

Configure a new email provider.

Parameters:

  • body (hash)

    The Hash options used to specify the email provider's properties.

Raises:

See Also:



25
26
27
28
# File 'lib/auth0/api/v2/emails.rb', line 25

def configure_provider(body)
  raise Auth0::InvalidParameter, 'Must supply a valid body to create an email provider' if body.to_s.empty?
  post(email_path, body)
end

#delete_providerjson

Deletes the configured email provider.

Returns:

  • (json)

    Returns the created email provider.

See Also:



34
35
36
# File 'lib/auth0/api/v2/emails.rb', line 34

def delete_provider
  delete(email_path)
end

#get_provider(fields: nil, include_fields: nil) ⇒ json

Get all the email providers.

Parameters:

  • fields (string)

    A comma separated list of fields to include or exclude from the result.

  • include_fields (boolean)

    True if the fields specified are to be included in the result, false otherwise.

Returns:

  • (json)

    Returns the existing email providers.

See Also:



14
15
16
17
18
19
20
# File 'lib/auth0/api/v2/emails.rb', line 14

def get_provider(fields: nil, include_fields: nil)
  request_params = {
    fields:           fields,
    include_fields:   include_fields
  }
  get(email_path, request_params)
end

#update_provider(body) ⇒ json

Updates the configured email provider.

Parameters:

  • body (hash)

    The Hash options used to specify the email provider's properties.

Returns:

  • (json)

    Returns the updated email provider.

Raises:

See Also:



43
44
45
46
# File 'lib/auth0/api/v2/emails.rb', line 43

def update_provider(body)
  raise Auth0::InvalidParameter, 'Must supply a valid body to update an email provider' if body.to_s.empty?
  patch(email_path, body)
end