Class Triggers

java.lang.Object
com.google.genai.gaos.Triggers

public class Triggers extends Object
  • Method Details

    • async

      public AsyncTriggers async()
      Switches to the async SDK.
      Returns:
      The async SDK
    • list

      Lists triggers for a project.
      Returns:
      The call builder
    • listDirect

      public ListTriggersResponse listDirect()
      Lists triggers for a project.
      Returns:
      The response from the API call
      Throws:
      RuntimeException - subclass if the API call fails
    • list

      public ListTriggersResponse list(@Nullable String apiVersion, @Nullable String filter, @Nullable Long pageSize, @Nullable String pageToken, @Nullable Options options)
      Lists triggers for a project.
      Parameters:
      apiVersion - Which version of the API to use.
      filter - Optional. Filter expression (e.g., by state).
      pageSize - Optional. The maximum number of triggers to return per page.
      pageToken - Optional. A page token from a previous ListTriggers call.
      options - additional options
      Returns:
      The response from the API call
      Throws:
      RuntimeException - subclass if the API call fails
    • create

      public CreateTriggerRequestBuilder create()
      Creates a new trigger that will invoke the specified agent on the given cron schedule.
      Returns:
      The call builder
    • create

      public CreateTriggerResponse create(@Nonnull TriggerCreateParams body)
      Creates a new trigger that will invoke the specified agent on the given cron schedule.
      Parameters:
      body - Parameters for creating a trigger.
      Returns:
      The response from the API call
      Throws:
      RuntimeException - subclass if the API call fails
    • create

      public CreateTriggerResponse create(@Nullable String apiVersion, @Nonnull TriggerCreateParams body, @Nullable Options options)
      Creates a new trigger that will invoke the specified agent on the given cron schedule.
      Parameters:
      apiVersion - Which version of the API to use.
      body - Parameters for creating a trigger.
      options - additional options
      Returns:
      The response from the API call
      Throws:
      RuntimeException - subclass if the API call fails
    • delete

      public DeleteTriggerRequestBuilder delete()
      Deletes a trigger.
      Returns:
      The call builder
    • delete

      public DeleteTriggerResponse delete(@Nonnull String id)
      Deletes a trigger.
      Parameters:
      id - Resource name of the trigger.
      Returns:
      The response from the API call
      Throws:
      RuntimeException - subclass if the API call fails
    • delete

      public DeleteTriggerResponse delete(@Nullable String apiVersion, @Nonnull String id, @Nullable Options options)
      Deletes a trigger.
      Parameters:
      apiVersion - Which version of the API to use.
      id - Resource name of the trigger.
      options - additional options
      Returns:
      The response from the API call
      Throws:
      RuntimeException - subclass if the API call fails
    • get

      Gets details of a single trigger.
      Returns:
      The call builder
    • get

      public GetTriggerResponse get(@Nonnull String id)
      Gets details of a single trigger.
      Parameters:
      id - Resource name of the trigger.
      Returns:
      The response from the API call
      Throws:
      RuntimeException - subclass if the API call fails
    • get

      public GetTriggerResponse get(@Nullable String apiVersion, @Nonnull String id, @Nullable Options options)
      Gets details of a single trigger.
      Parameters:
      apiVersion - Which version of the API to use.
      id - Resource name of the trigger.
      options - additional options
      Returns:
      The response from the API call
      Throws:
      RuntimeException - subclass if the API call fails
    • update

      public UpdateTriggerRequestBuilder update()
      Updates a trigger.
      Returns:
      The call builder
    • update

      public UpdateTriggerResponse update(@Nonnull String id, @Nonnull TriggerUpdate body)
      Updates a trigger.
      Parameters:
      id - Resource name of the trigger.
      body - Represents the fields of a Trigger that can be updated.
      Returns:
      The response from the API call
      Throws:
      RuntimeException - subclass if the API call fails
    • update

      public UpdateTriggerResponse update(@Nullable String apiVersion, @Nonnull String id, @Nonnull TriggerUpdate body, @Nullable Options options)
      Updates a trigger.
      Parameters:
      apiVersion - Which version of the API to use.
      id - Resource name of the trigger.
      body - Represents the fields of a Trigger that can be updated.
      options - additional options
      Returns:
      The response from the API call
      Throws:
      RuntimeException - subclass if the API call fails
    • listExecutions

      public ListTriggerExecutionsRequestBuilder listExecutions()
      Lists executions for a trigger.
      Returns:
      The call builder
    • listExecutions

      public ListTriggerExecutionsResponse listExecutions(@Nonnull String triggerId)
      Lists executions for a trigger.
      Parameters:
      triggerId - Resource name of the trigger.
      Returns:
      The response from the API call
      Throws:
      RuntimeException - subclass if the API call fails
    • listExecutions

      public ListTriggerExecutionsResponse listExecutions(@Nullable String apiVersion, @Nonnull String triggerId, @Nullable Long pageSize, @Nullable String pageToken, @Nullable Options options)
      Lists executions for a trigger.
      Parameters:
      apiVersion - Which version of the API to use.
      triggerId - Resource name of the trigger.
      pageSize - Optional. The maximum number of executions to return per page.
      pageToken - Optional. A page token from a previous ListTriggerExecutions call.
      options - additional options
      Returns:
      The response from the API call
      Throws:
      RuntimeException - subclass if the API call fails
    • run

      Runs a trigger immediately.
      Returns:
      The call builder
    • run

      public RunTriggerResponse run(@Nonnull String triggerId)
      Runs a trigger immediately.
      Parameters:
      triggerId - Resource name of the trigger.
      Returns:
      The response from the API call
      Throws:
      RuntimeException - subclass if the API call fails
    • run

      public RunTriggerResponse run(@Nullable String apiVersion, @Nonnull String triggerId, @Nullable Options options)
      Runs a trigger immediately.
      Parameters:
      apiVersion - Which version of the API to use.
      triggerId - Resource name of the trigger.
      options - additional options
      Returns:
      The response from the API call
      Throws:
      RuntimeException - subclass if the API call fails