Class ActionsClient
- Namespace
- Auth0.ManagementApi.Clients
- Assembly
- Auth0.ManagementApi.dll
Contains methods to access the /actions endpoints.
public class ActionsClient : BaseClient, IActionsClient
- Inheritance
-
ActionsClient
- Implements
- Inherited Members
Constructors
ActionsClient(IManagementConnection, Uri, IDictionary<string, string>)
public ActionsClient(IManagementConnection connection, Uri baseUri, IDictionary<string, string> defaultHeaders)
Parameters
connectionIManagementConnectionbaseUriUridefaultHeadersIDictionary<string, string>
Methods
CreateAsync(CreateActionRequest, CancellationToken)
Create an action.
public Task<Action> CreateAsync(CreateActionRequest request, CancellationToken cancellationToken = default)
Parameters
requestCreateActionRequestSpecifies criteria to use when creating an action.
cancellationTokenCancellationTokenThe cancellation token to cancel operation.
Returns
Remarks
Once an action is created, it must be deployed, and then bound to a trigger before it will be executed as part of a flow.
DeleteAsync(string, DeleteActionRequest, CancellationToken)
Deletes an action and all of its associated versions.
public Task DeleteAsync(string id, DeleteActionRequest request = null, CancellationToken cancellationToken = default)
Parameters
idstringThe ID of the action to delete.
requestDeleteActionRequestSpecifies criteria to use when deleting an action.
cancellationTokenCancellationTokenThe cancellation token to cancel operation.
Returns
Remarks
An action must be unbound from all triggers before it can be deleted.
DeployAsync(string, CancellationToken)
Deploy an action.
public Task<ActionVersion> DeployAsync(string id, CancellationToken cancellationToken = default)
Parameters
idstringThe ID of the action to deploy.
cancellationTokenCancellationTokenThe cancellation token to cancel operation.
Returns
- Task<ActionVersion>
The action version that was created.
Remarks
Deploying an action will create a new immutable version of the action. If the action is currently bound to a trigger, then the system will begin executing the newly deployed version of the action immediately.Otherwise, the action will only be executed as a part of a flow once it is bound to that flow.
GetAllAsync(GetActionsRequest, PaginationInfo, CancellationToken)
Retrieve all actions.
public Task<IPagedList<Action>> GetAllAsync(GetActionsRequest request, PaginationInfo pagination, CancellationToken cancellationToken = default)
Parameters
requestGetActionsRequestSpecifies criteria to use when querying actions.
paginationPaginationInfoSpecifies pagination info to use.
cancellationTokenCancellationTokenThe cancellation token to cancel operation.
Returns
- Task<IPagedList<Action>>
An IPagedList<T> containing the actions.
GetAllTriggerBindingsAsync(string, PaginationInfo, CancellationToken)
Retrieve the actions that are bound to a trigger.
public Task<IPagedList<TriggerBinding>> GetAllTriggerBindingsAsync(string triggerId, PaginationInfo pagination, CancellationToken cancellationToken = default)
Parameters
triggerIdstringAn actions extensibility point.
paginationPaginationInfoSpecifies pagination info to use.
cancellationTokenCancellationTokenThe cancellation token to cancel operation.
Returns
- Task<IPagedList<TriggerBinding>>
The retrieved trigger bindings.
Remarks
Once an action is created and deployed, it must be attached (i.e. bound) to a trigger so that it will be executed as part of a flow. The list of actions returned reflects the order in which they will be executed during the appropriate flow.
GetAllTriggersAsync(CancellationToken)
Retrieve the set of triggers currently available within actions. A trigger is an extensibility point to which actions can be bound
public Task<IList<Trigger>> GetAllTriggersAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenThe cancellation token to cancel operation.
Returns
GetAllVersionsAsync(string, PaginationInfo, CancellationToken)
Retrieve all versions of an action.
public Task<IPagedList<ActionVersion>> GetAllVersionsAsync(string actionId, PaginationInfo pagination, CancellationToken cancellationToken = default)
Parameters
actionIdstringThe ID of the action.
paginationPaginationInfoSpecifies pagination info to use.
cancellationTokenCancellationTokenThe cancellation token to cancel operation.
Returns
- Task<IPagedList<ActionVersion>>
The retrieved versions of the specified action.
Remarks
An action version is created whenever an action is deployed. An action version is immutable, once created.
GetAsync(string, CancellationToken)
Retrieve an action by its ID.
public Task<Action> GetAsync(string id, CancellationToken cancellationToken = default)
Parameters
idstringThe ID of the action to retrieve.
cancellationTokenCancellationTokenThe cancellation token to cancel operation.
Returns
GetExecutionAsync(string, CancellationToken)
Retrieve information about a specific execution of a trigger.
public Task<ActionExecution> GetExecutionAsync(string id, CancellationToken cancellationToken = default)
Parameters
idstringThe ID of the execution to retrieve.
cancellationTokenCancellationTokenThe cancellation token to cancel operation.
Returns
- Task<ActionExecution>
The retrieved execution.
Remarks
Relevant execution IDs will be included in tenant logs generated as part of that authentication flow. Executions will only be stored for 10 days after their creation.
GetVersionAsync(string, string, CancellationToken)
Retrieve a specific version of an action.
public Task<ActionVersion> GetVersionAsync(string actionId, string versionId, CancellationToken cancellationToken = default)
Parameters
actionIdstringThe ID of the action.
versionIdstringThe ID of the action version.
cancellationTokenCancellationTokenThe cancellation token to cancel operation.
Returns
- Task<ActionVersion>
The retrieved version of the specified action.
Remarks
An action version is created whenever an action is deployed. An action version is immutable, once created.
RollbackToVersionAsync(string, string, CancellationToken)
Performs the equivalent of a roll-back of an action to an earlier, specified version.
public Task<ActionVersion> RollbackToVersionAsync(string actionId, string versionId, CancellationToken cancellationToken = default)
Parameters
actionIdstringThe ID of the action.
versionIdstringThe ID of the version to deploy.
cancellationTokenCancellationTokenThe cancellation token to cancel operation.
Returns
- Task<ActionVersion>
A Task that represents the asynchronous delete operation.
Remarks
Creates a new, deployed action version that is identical to the specified version. If this action is currently bound to a trigger, the system will begin executing the newly-created version immediately.
UpdateAsync(string, UpdateActionRequest, CancellationToken)
Update an existing action.
public Task<Action> UpdateAsync(string id, UpdateActionRequest request, CancellationToken cancellationToken = default)
Parameters
idstringThe id of the action to update.
requestUpdateActionRequestSpecifies criteria to use when updating an action.
cancellationTokenCancellationTokenThe cancellation token to cancel operation.
Returns
Remarks
If this action is currently bound to a trigger, updating it will not affect any user flows until the action is deployed.
UpdateTriggerBindingsAsync(string, UpdateTriggerBindingsRequest, CancellationToken)
Update the actions that are bound (i.e. attached) to a trigger. Once an action is created and deployed, it must be attached(i.e.bound) to a trigger so that it will be executed as part of a flow. The order in which the actions are provided will determine the order in which they are executed.
public Task<IList<TriggerBinding>> UpdateTriggerBindingsAsync(string triggerId, UpdateTriggerBindingsRequest request, CancellationToken cancellationToken = default)
Parameters
triggerIdstringAn actions extensibility point.
requestUpdateTriggerBindingsRequestSpecifies criteria to use when updating the trigger bindings.
cancellationTokenCancellationTokenThe cancellation token to cancel operation.
Returns
- Task<IList<TriggerBinding>>
The trigger bindings.