Package org.a2aproject.sdk.spec
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 sessionstatus- Filter tasks by their current status statepageSize- Maximum number of tasks to return (1-100, defaults to 50)pageToken- Token for pagination from a previous ListTasksResulthistoryLength- Number of recent messages to include in each task's history (defaults to 0)statusTimestampAfter- Filter tasks updated after this timestampincludeArtifacts- 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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder for constructing instances. -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor for listing all tasks.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.ListTasksParams(Integer pageSize, String pageToken) Constructor with pagination. -
Method Summary
Modifier and TypeMethodDescriptionstatic ListTasksParams.Builderbuilder()Create a new Builder@Nullable StringReturns the value of thecontextIdrecord component.final booleanIndicates whether some other object is "equal to" this one.intReturns the effective history length (defaults to 0 if not specified).intReturns the effective page size (defaults to 50 if not specified).final inthashCode()Returns a hash code value for this object.@Nullable IntegerReturns the value of thehistoryLengthrecord component.@Nullable BooleanReturns the value of theincludeArtifactsrecord component.@Nullable IntegerpageSize()Returns the value of thepageSizerecord component.@Nullable StringReturns the value of thepageTokenrecord component.booleanReturns whether to include artifacts (defaults to false).@Nullable TaskStatestatus()Returns the value of thestatusrecord component.@Nullable InstantReturns the value of thestatusTimestampAfterrecord component.@Nullable Stringtenant()Returns the value of thetenantrecord component.final StringtoString()Returns a string representation of this record class.
-
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 IDstatus- filter by task statuspageSize- maximum number of results per pagepageToken- pagination tokenhistoryLength- number of history items to includestatusTimestampAfter- filter by status timestampincludeArtifacts- whether to include artifactstenant- the tenant identifier- Throws:
InvalidParamsError- if pageSize or historyLength are out of valid range
-
ListTasksParams
public ListTasksParams()Default constructor for listing all tasks. -
ListTasksParams
Constructor with pagination.- Parameters:
pageSize- Maximum number of tasks to returnpageToken- 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
Create a new Builder- Returns:
- the builder
-
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. -
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. -
equals
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 withObjects::equals(Object,Object). -
contextId
Returns the value of thecontextIdrecord component.- Returns:
- the value of the
contextIdrecord component
-
status
Returns the value of thestatusrecord component.- Returns:
- the value of the
statusrecord component
-
pageSize
Returns the value of thepageSizerecord component.- Returns:
- the value of the
pageSizerecord component
-
pageToken
Returns the value of thepageTokenrecord component.- Returns:
- the value of the
pageTokenrecord component
-
historyLength
Returns the value of thehistoryLengthrecord component.- Returns:
- the value of the
historyLengthrecord component
-
statusTimestampAfter
Returns the value of thestatusTimestampAfterrecord component.- Returns:
- the value of the
statusTimestampAfterrecord component
-
includeArtifacts
Returns the value of theincludeArtifactsrecord component.- Returns:
- the value of the
includeArtifactsrecord component
-
tenant
Returns the value of thetenantrecord component.- Returns:
- the value of the
tenantrecord component
-