Record Class ListTasksParams

java.lang.Object
java.lang.Record
org.a2aproject.sdk.spec.ListTasksParams
Record Components:
contextId - Filter tasks by context ID to get tasks from a specific conversation or session
status - Filter tasks by their current status state
pageSize - Maximum number of tasks to return (1-100, defaults to 50)
pageToken - Token for pagination from a previous ListTasksResult
historyLength - Number of recent messages to include in each task's history (defaults to 0)
statusTimestampAfter - Filter tasks updated after this timestamp
includeArtifacts - Whether to include artifacts in the returned tasks (defaults to false)
tenant - optional tenant, provided as a path parameter.

public record ListTasksParams(@Nullable String contextId, @Nullable TaskState status, @Nullable Integer pageSize, @Nullable String pageToken, @Nullable Integer historyLength, @Nullable Instant statusTimestampAfter, @Nullable Boolean includeArtifacts, @Nullable String tenant) extends Record
Parameters for listing tasks with optional filtering and pagination.
  • Constructor Details

    • ListTasksParams

      public ListTasksParams(@Nullable String contextId, @Nullable TaskState status, @Nullable Integer pageSize, @Nullable String pageToken, @Nullable Integer historyLength, @Nullable Instant statusTimestampAfter, @Nullable Boolean includeArtifacts, @Nullable String tenant)
      Compact constructor for validation. Validates that the tenant parameter is not null and parameters are within valid ranges.
      Parameters:
      contextId - filter by context ID
      status - filter by task status
      pageSize - maximum number of results per page
      pageToken - pagination token
      historyLength - number of history items to include
      statusTimestampAfter - filter by status timestamp
      includeArtifacts - whether to include artifacts
      tenant - the tenant identifier
      Throws:
      InvalidParamsError - if pageSize or historyLength are out of valid range
    • ListTasksParams

      public ListTasksParams()
      Default constructor for listing all tasks.
    • ListTasksParams

      public ListTasksParams(Integer pageSize, String pageToken)
      Constructor with pagination.
      Parameters:
      pageSize - Maximum number of tasks to return
      pageToken - Token for pagination
  • Method Details

    • getEffectivePageSize

      public int getEffectivePageSize()
      Returns the effective page size (defaults to 50 if not specified). Values are validated in the constructor to be within the range [1, 100].
      Returns:
      the effective page size
    • getEffectiveHistoryLength

      public int getEffectiveHistoryLength()
      Returns the effective history length (defaults to 0 if not specified). Values are validated in the constructor to be non-negative.
      Returns:
      the effective history length
    • shouldIncludeArtifacts

      public boolean shouldIncludeArtifacts()
      Returns whether to include artifacts (defaults to false).
      Returns:
      true if artifacts should be included
    • builder

      public static ListTasksParams.Builder builder()
      Create a new Builder
      Returns:
      the builder
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • contextId

      public @Nullable String contextId()
      Returns the value of the contextId record component.
      Returns:
      the value of the contextId record component
    • status

      public @Nullable TaskState status()
      Returns the value of the status record component.
      Returns:
      the value of the status record component
    • pageSize

      public @Nullable Integer pageSize()
      Returns the value of the pageSize record component.
      Returns:
      the value of the pageSize record component
    • pageToken

      public @Nullable String pageToken()
      Returns the value of the pageToken record component.
      Returns:
      the value of the pageToken record component
    • historyLength

      public @Nullable Integer historyLength()
      Returns the value of the historyLength record component.
      Returns:
      the value of the historyLength record component
    • statusTimestampAfter

      public @Nullable Instant statusTimestampAfter()
      Returns the value of the statusTimestampAfter record component.
      Returns:
      the value of the statusTimestampAfter record component
    • includeArtifacts

      public @Nullable Boolean includeArtifacts()
      Returns the value of the includeArtifacts record component.
      Returns:
      the value of the includeArtifacts record component
    • tenant

      public @Nullable String tenant()
      Returns the value of the tenant record component.
      Returns:
      the value of the tenant record component