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
IManagementConnectionIManagementConnection used to make all API calls.
baseUri
UriUri 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
HookCreateRequestThe HookCreateRequest containing the details of the hook to create.
cancellationToken
CancellationTokenThe cancellation token to cancel operation.
Returns
DeleteAsync(string, CancellationToken)
Deletes a hook.
public Task DeleteAsync(string id, CancellationToken cancellationToken = default)
Parameters
id
stringThe ID of the hook to delete.
cancellationToken
CancellationTokenThe cancellation token to cancel operation.
Returns
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
GetHooksRequestSpecifies criteria to use when querying hooks.
pagination
PaginationInfoSpecifies pagination info to use when requesting paged results.
cancellationToken
CancellationTokenThe 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
stringThe ID of the hook to retrieve.
fields
stringA comma separated list of fields to include, empty to retrieve all fields.
cancellationToken
CancellationTokenThe cancellation token to cancel operation.
Returns
UpdateAsync(string, HookUpdateRequest, CancellationToken)
Updates a hook.
public Task<Hook> UpdateAsync(string id, HookUpdateRequest request, CancellationToken cancellationToken = default)
Parameters
id
stringThe ID of the hook to update.
request
HookUpdateRequestA HookUpdateRequest containing the information to update.
cancellationToken
CancellationTokenThe cancellation token to cancel operation.