Table of Contents

Class HooksClient

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

Contains methods to access the /hooks endpoints.

public class HooksClient : BaseClient, IHooksClient
Inheritance
HooksClient
Implements
Inherited Members

Constructors

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

Initializes a new instance of HooksClient.

public HooksClient(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(HookCreateRequest, CancellationToken)

Creates a new hook according to the request.

public Task<Hook> CreateAsync(HookCreateRequest request, CancellationToken cancellationToken = default)

Parameters

request HookCreateRequest

The HookCreateRequest containing the details of the hook to create.

cancellationToken CancellationToken

The cancellation token to cancel operation.

Returns

Task<Hook>

The newly created Hook.

DeleteAsync(string, CancellationToken)

Deletes a hook.

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

Parameters

id string

The ID of the hook to delete.

cancellationToken CancellationToken

The cancellation token to cancel operation.

Returns

Task

A Task that represents the asynchronous delete operation.

GetAllAsync(GetHooksRequest, PaginationInfo, CancellationToken)

Retrieves a list of all hooks.

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

Parameters

request GetHooksRequest

Specifies criteria to use when querying hooks.

pagination PaginationInfo

Specifies pagination info to use when requesting paged results.

cancellationToken CancellationToken

The cancellation token to cancel operation.

Returns

Task<IPagedList<Hook>>

An IPagedList<T> containing the hooks requested.

GetAsync(string, string, CancellationToken)

Retrieves a hook by its ID.

public Task<Hook> GetAsync(string id, string fields = null, CancellationToken cancellationToken = default)

Parameters

id string

The ID of the hook to retrieve.

fields string

A comma separated list of fields to include, empty to retrieve all fields.

cancellationToken CancellationToken

The cancellation token to cancel operation.

Returns

Task<Hook>

The Hook that was requested.

UpdateAsync(string, HookUpdateRequest, CancellationToken)

Updates a hook.

public Task<Hook> UpdateAsync(string id, HookUpdateRequest request, CancellationToken cancellationToken = default)

Parameters

id string

The ID of the hook to update.

request HookUpdateRequest

A HookUpdateRequest containing the information to update.

cancellationToken CancellationToken

The cancellation token to cancel operation.

Returns

Task<Hook>

The newly updated Hook.