Back to Node Auth0

Class ProviderClient

docs/classes/management.SDK.ProviderClient.html

5.9.110.0 KB
Original Source

Class ProviderClient

Index

Constructors

constructor

Methods

getcreatedeleteupdate

Properties

_options

Constructors

constructor

new ProviderClient(options: BaseClientOptions): ProviderClient

Parameters

Returns ProviderClient

Methods

get

get(
request?: GetEmailProviderRequestParameters,
requestOptions?: ProviderClient.RequestOptions,
): HttpResponsePromise<GetEmailProviderResponseContent>

Retrieve details of the email provider configuration in your tenant. A list of fields to include or exclude may also be specified.

Parameters

Request-specific configuration.

Returns HttpResponsePromise<GetEmailProviderResponseContent>

Throws

Management.BadRequestError

Throws

Management.UnauthorizedError

Throws

Management.ForbiddenError

Throws

Management.NotFoundError

Throws

Management.TooManyRequestsError

Example

await client.emails.provider.get({ fields: "fields", include_fields: true })Copy

create

create(
request: CreateEmailProviderRequestContent,
requestOptions?: ProviderClient.RequestOptions,
): HttpResponsePromise<CreateEmailProviderResponseContent>

Create an email provider. The credentials object requires different properties depending on the email provider (which is specified using the name property):

  • mandrill requires api_key
  • sendgrid requires api_key
  • sparkpost requires api_key. Optionally, set region to eu to use the SparkPost service hosted in Western Europe; set to null to use the SparkPost service hosted in North America. eu or null are the only valid values for region.
  • mailgun requires api_key and domain. Optionally, set region to eu to use the Mailgun service hosted in Europe; set to null otherwise. eu or null are the only valid values for region.
  • ses requires accessKeyId, secretAccessKey, and region
  • smtp requires smtp_host, smtp_port, smtp_user, and smtp_pass

Depending on the type of provider it is possible to specify settings object with different configuration options, which will be used when sending an email:

  • smtp provider, settings may contain headers object.

    • When using AWS SES SMTP host, you may provide a name of configuration set in X-SES-Configuration-Set header. Value must be a string.
    • When using Sparkpost host, you may provide value for X-MSYS_API header. Value must be an object.
  • for ses provider, settings may contain message object, where you can provide a name of configuration set in configuration_set_name property. Value must be a string.

Parameters

Request-specific configuration.

Returns HttpResponsePromise<CreateEmailProviderResponseContent>

Throws

Management.BadRequestError

Throws

Management.UnauthorizedError

Throws

Management.ForbiddenError

Throws

Management.ConflictError

Throws

Management.TooManyRequestsError

Example

await client.emails.provider.create({ name: "mailgun", credentials: { api_key: "api_key" } })Copy

delete

delete(
requestOptions?: ProviderClient.RequestOptions,
): HttpResponsePromise<void>

Delete the email provider.

Parameters

Request-specific configuration.

Returns HttpResponsePromise<void>

Throws

Management.BadRequestError

Throws

Management.UnauthorizedError

Throws

Management.ForbiddenError

Throws

Management.NotFoundError

Throws

Management.TooManyRequestsError

Example

await client.emails.provider.delete()Copy

update

update(
request?: UpdateEmailProviderRequestContent,
requestOptions?: ProviderClient.RequestOptions,
): HttpResponsePromise<UpdateEmailProviderResponseContent>

Update an email provider. The credentials object requires different properties depending on the email provider (which is specified using the name property):

  • mandrill requires api_key
  • sendgrid requires api_key
  • sparkpost requires api_key. Optionally, set region to eu to use the SparkPost service hosted in Western Europe; set to null to use the SparkPost service hosted in North America. eu or null are the only valid values for region.
  • mailgun requires api_key and domain. Optionally, set region to eu to use the Mailgun service hosted in Europe; set to null otherwise. eu or null are the only valid values for region.
  • ses requires accessKeyId, secretAccessKey, and region
  • smtp requires smtp_host, smtp_port, smtp_user, and smtp_pass

Depending on the type of provider it is possible to specify settings object with different configuration options, which will be used when sending an email:

  • smtp provider, settings may contain headers object.
    • When using AWS SES SMTP host, you may provide a name of configuration set in X-SES-Configuration-Set header. Value must be a string.
    • When using Sparkpost host, you may provide value for X-MSYS_API header. Value must be an object.

for ses provider, settings may contain message object, where you can provide a name of configuration set in configuration_set_name property. Value must be a string.

Parameters

Request-specific configuration.

Returns HttpResponsePromise<UpdateEmailProviderResponseContent>

Throws

Management.BadRequestError

Throws

Management.UnauthorizedError

Throws

Management.ForbiddenError

Throws

Management.NotFoundError

Throws

Management.ConflictError

Throws

Management.TooManyRequestsError

Example

await client.emails.provider.update()Copy

Properties

Protected Readonly_options

_options: NormalizedClientOptionsWithAuth<BaseClientOptions>

Settings

Member Visibility

  • Protected
  • Inherited

ThemeOSLightDark

On This Page

Constructors constructor Methods getcreatedeleteupdate Properties _options