Class ActionsEntity

java.lang.Object
com.auth0.client.mgmt.ActionsEntity

public class ActionsEntity extends Object
Class that provides an implementation of the Actions methods of the Management API as defined in https://auth0.com/docs/api/management/v2#!/Actions

This class is not thread-safe.

See Also:
  • Field Details

    • client

      protected final okhttp3.OkHttpClient client
    • baseUrl

      protected final okhttp3.HttpUrl baseUrl
    • apiToken

      protected final String apiToken
  • Method Details

    • create

      public Request<Action> create(Action action)
      Create an action. A token with create:actions scope is required.
      Parameters:
      action - the action to create
      Returns:
      a request to execute
      See Also:
    • get

      public Request<Action> get(String actionId)
      Get an action. A token with read:actions scope is required.
      Parameters:
      actionId - the ID of the action to retrieve
      Returns:
      a Request to execute
      See Also:
    • delete

      public Request<Void> delete(String actionId)
      Delete an action and all of its associated versions. An action must be unbound from all triggers before it can be deleted. A token with delete:action scope is required.
      Parameters:
      actionId - the ID of the action to delete.
      Returns:
      a request to execute.
      See Also:
    • delete

      public Request<Void> delete(String actionId, boolean force)
      Delete an action and all of its associated versions. A token with delete:action scope is required.
      Parameters:
      actionId - the ID of the action to delete.
      force - whether to force the action deletion even if it is bound to triggers.
      Returns:
      a request to execute. https://auth0.com/docs/api/management/v2#!/Actions/get_triggers
    • getTriggers

      public Request<Triggers> getTriggers()
      Get the set of triggers currently available. A trigger is an extensibility point to which actions can be bound. A token with read:actions scope is required.
      Returns:
      a request to execute.
    • update

      public Request<Action> update(String actionId, Action action)
      Update an existing action. If this action is currently bound to a trigger, updating it will not affect any user flows until the action is deployed. Requires a token with update:actions scope.
      Parameters:
      actionId - the ID of the action to update.
      action - the updated action.
      Returns:
      a request to execute.
      See Also:
    • deploy

      public Request<Version> deploy(String actionId)
      Deploy an action. 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. Requires a token with create:actions.
      Parameters:
      actionId - the ID of the action to deploy.
      Returns:
      a request to execute.
      See Also:
    • getVersion

      public Request<Version> getVersion(String actionId, String actionVersionId)
      Retrieve a specific version of an action. An action version is created whenever an action is deployed. An action version is immutable, once created. Requires a token with read:actions scope.
      Parameters:
      actionId - the ID of the action for which to retrieve the version.
      actionVersionId - the ID of the specific version to retrieve.
      Returns:
      a request to execute.
      See Also:
    • rollBackToVersion

      public Request<Version> rollBackToVersion(String actionId, String actionVersionId)
      Performs the equivalent of a roll-back of an action to an earlier, specified version. 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.
      Parameters:
      actionId - the ID of the action
      actionVersionId - the ID of the action version to roll-back to
      Returns:
      a request to be executed
      See Also:
    • getExecution

      public Request<Execution> getExecution(String executionId)
      Retrieve information about a specific execution of an action. 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. Requires a token with read:actions scope.
      Parameters:
      executionId - The ID of the execution to retrieve.
      Returns:
      a request to be executed.
      See Also:
    • list

      public Request<ActionsPage> list(ActionsFilter filter)
      Get all actions. Requires a token with read:actions scope.
      Parameters:
      filter - an optional filter to apply to the request.
      Returns:
      a request to execute.
      See Also:
    • getVersions

      public Request<VersionsPage> getVersions(String actionId, PageFilter filter)
      Retrieve all of an action's versions. An action version is created whenever an action is deployed. An action version is immutable, once created. Requires a token with read:actions scope.
      Parameters:
      actionId - the ID of the action to retrieve versions for.
      filter - an optional pagination filter. Note that all available pagination parameters may be available for this endpoint. See the referenced API documentation for supported parameters.
      Returns:
      a request to execute.
      See Also:
    • getTriggerBindings

      public Request<BindingsPage> getTriggerBindings(String triggerId, PageFilter filter)
      Retrieve the actions that are bound 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 list of actions returned reflects the order in which they will be executed during the appropriate flow. Requires a token with read:actions.
      Parameters:
      triggerId - The trigger ID for which to get its action bindings.
      filter - an optional pagination filter. Note that all available pagination parameters may be available for this endpoint. See the referenced API documentation for supported parameters.
      Returns:
      a request to execute.
      See Also:
    • updateTriggerBindings

      public Request<BindingsPage> updateTriggerBindings(String triggerId, BindingsUpdateRequest bindingsUpdateRequest)
      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. Requires a token with update:actions scope.
      Parameters:
      triggerId - the ID of the trigger for which to update its bindings.
      bindingsUpdateRequest - the bindings update request body.
      Returns:
      a request to execute.
      See Also:
    • voidRequest

      protected Request<Void> voidRequest(String method, Consumer<com.auth0.client.mgmt.RequestBuilder<Void>> customizer)
    • request

      protected <T> Request<T> request(String method, com.fasterxml.jackson.core.type.TypeReference<T> target, Consumer<com.auth0.client.mgmt.RequestBuilder<T>> customizer)