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
connectionIManagementConnectionIManagementConnection used to make all API calls.
baseUriUriUri of the endpoint to use in making API calls.
defaultHeadersIDictionary<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
requestHookCreateRequestThe HookCreateRequest containing the details of the hook to create.
cancellationTokenCancellationTokenThe cancellation token to cancel operation.
Returns
DeleteAsync(string, CancellationToken)
Deletes a hook.
public Task DeleteAsync(string id, CancellationToken cancellationToken = default)
Parameters
idstringThe ID of the hook to delete.
cancellationTokenCancellationTokenThe 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
requestGetHooksRequestSpecifies criteria to use when querying hooks.
paginationPaginationInfoSpecifies pagination info to use when requesting paged results.
cancellationTokenCancellationTokenThe 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
idstringThe ID of the hook to retrieve.
fieldsstringA comma separated list of fields to include, empty to retrieve all fields.
cancellationTokenCancellationTokenThe 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
idstringThe ID of the hook to update.
requestHookUpdateRequestA HookUpdateRequest containing the information to update.
cancellationTokenCancellationTokenThe cancellation token to cancel operation.