Table of Contents

Class RulesClient

Namespace
Auth0.ManagementApi.Clients
Assembly
Auth0.ManagementApi.dll

Contains methods to access the /rules endpoints.

public class RulesClient : BaseClient, IRulesClient
Inheritance
RulesClient
Implements
Inherited Members

Constructors

RulesClient(IManagementConnection, Uri, IDictionary<string, string>)

Initializes a new instance of RulesClient.

public RulesClient(IManagementConnection connection, Uri baseUri, IDictionary<string, string> defaultHeaders)

Parameters

connection IManagementConnection

IManagementConnection used to make all API calls.

baseUri Uri

Uri of the endpoint to use in making API calls.

defaultHeaders IDictionary<string, string>

Dictionary containing default headers included with every request this client makes.

Methods

CreateAsync(RuleCreateRequest, CancellationToken)

Creates a new rule according to the request.

public Task<Rule> CreateAsync(RuleCreateRequest request, CancellationToken cancellationToken = default)

Parameters

request RuleCreateRequest

The RuleCreateRequest containing the details of the rule to create.

cancellationToken CancellationToken

The cancellation token to cancel operation.

Returns

Task<Rule>

The newly created Rule.

DeleteAsync(string, CancellationToken)

Deletes a rule.

public Task DeleteAsync(string id, CancellationToken cancellationToken = default)

Parameters

id string

The ID of the rule to delete.

cancellationToken CancellationToken

The cancellation token to cancel operation.

Returns

Task

A Task that represents the asynchronous delete operation.

GetAllAsync(GetRulesRequest, PaginationInfo, CancellationToken)

Retrieves a list of all rules.

public Task<IPagedList<Rule>> GetAllAsync(GetRulesRequest request, PaginationInfo pagination = null, CancellationToken cancellationToken = default)

Parameters

request GetRulesRequest

Specifies criteria to use when querying rules.

pagination PaginationInfo

Specifies pagination info to use when requesting paged results.

cancellationToken CancellationToken

The cancellation token to cancel operation.

Returns

Task<IPagedList<Rule>>

An IPagedList<T> containing the rules requested.

GetAsync(string, string, bool, CancellationToken)

Retrieves a rule by its ID.

public Task<Rule> GetAsync(string id, string fields = null, bool includeFields = true, CancellationToken cancellationToken = default)

Parameters

id string

The ID of the rule to retrieve.

fields string

A comma separated list of fields to include or exclude (depending on includeFields) from the result, empty to retrieve all fields.

includeFields bool

True if the fields specified are to be included in the result, false otherwise (defaults to true).

cancellationToken CancellationToken

The cancellation token to cancel operation.

Returns

Task<Rule>

The Rule that was requested.

UpdateAsync(string, RuleUpdateRequest, CancellationToken)

Updates a rule.

public Task<Rule> UpdateAsync(string id, RuleUpdateRequest request, CancellationToken cancellationToken = default)

Parameters

id string

The ID of the rule to update.

request RuleUpdateRequest

A RuleUpdateRequest containing the information to update.

cancellationToken CancellationToken

The cancellation token to cancel operation.

Returns

Task<Rule>

The newly updated Rule.