Back to Node Auth0

Class RulesClient

docs/classes/management.SDK.RulesClient.html

5.9.18.8 KB
Original Source

Class RulesClient

Index

Constructors

constructor

Methods

listcreategetdeleteupdate

Properties

_options

Constructors

constructor

new RulesClient(options: BaseClientOptions): RulesClient

Parameters

Returns RulesClient

Methods

list

list(
request?: ListRulesRequestParameters,
requestOptions?: RulesClient.RequestOptions,
): Promise<Page<Rule, ListRulesOffsetPaginatedResponseContent>>

Retrieve a filtered list of rules. Accepts a list of fields to include or exclude.

Parameters

Request-specific configuration.

Returns Promise<Page<Rule, ListRulesOffsetPaginatedResponseContent>>

Throws

Management.BadRequestError

Throws

Management.UnauthorizedError

Throws

Management.ForbiddenError

Throws

Management.NotFoundError

Throws

Management.TooManyRequestsError

Example

await client.rules.list({ page: 1, per_page: 1, include_totals: true, enabled: true, fields: "fields", include_fields: true })Copy

create

create(
request: CreateRuleRequestContent,
requestOptions?: RulesClient.RequestOptions,
): HttpResponsePromise<CreateRuleResponseContent>

Create a new rule.

Note: Changing a rule's stage of execution from the default login_success can change the rule's function signature to have user omitted.

Parameters

Request-specific configuration.

Returns HttpResponsePromise<CreateRuleResponseContent>

Throws

Management.BadRequestError

Throws

Management.UnauthorizedError

Throws

Management.ForbiddenError

Throws

Management.ConflictError

Throws

Management.TooManyRequestsError

Example

await client.rules.create({ name: "name", script: "script" })Copy

get

get(
id: string,
request?: GetRuleRequestParameters,
requestOptions?: RulesClient.RequestOptions,
): HttpResponsePromise<GetRuleResponseContent>

Retrieve rule details. Accepts a list of fields to include or exclude in the result.

Parameters

  • id: string

ID of the rule to retrieve.

Request-specific configuration.

Returns HttpResponsePromise<GetRuleResponseContent>

Throws

Management.BadRequestError

Throws

Management.UnauthorizedError

Throws

Management.ForbiddenError

Throws

Management.NotFoundError

Throws

Management.TooManyRequestsError

Example

await client.rules.get("id", { fields: "fields", include_fields: true })Copy

delete

delete(
id: string,
requestOptions?: RulesClient.RequestOptions,
): HttpResponsePromise<void>

Delete a rule.

Parameters

  • id: string

ID of the rule to delete.

Request-specific configuration.

Returns HttpResponsePromise<void>

Throws

Management.BadRequestError

Throws

Management.UnauthorizedError

Throws

Management.ForbiddenError

Throws

Management.TooManyRequestsError

Example

await client.rules.delete("id")Copy

update

update(
id: string,
request?: UpdateRuleRequestContent,
requestOptions?: RulesClient.RequestOptions,
): HttpResponsePromise<UpdateRuleResponseContent>

Update an existing rule.

Parameters

  • id: string

ID of the rule to retrieve.

Request-specific configuration.

Returns HttpResponsePromise<UpdateRuleResponseContent>

Throws

Management.BadRequestError

Throws

Management.UnauthorizedError

Throws

Management.ForbiddenError

Throws

Management.NotFoundError

Throws

Management.ConflictError

Throws

Management.TooManyRequestsError

Example

await client.rules.update("id")Copy

Properties

Protected Readonly_options

_options: NormalizedClientOptionsWithAuth<BaseClientOptions>

Settings

Member Visibility

  • Protected
  • Inherited

ThemeOSLightDark

On This Page

Constructors constructor Methods listcreategetdeleteupdate Properties _options