Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
114 changes: 57 additions & 57 deletions src/main/java/com/google/genai/gaos/Agents.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,49 @@ public AsyncAgents async() {
return asyncSDK;
}

/**
* Lists all Agents.
*
* @return The call builder
*/
public ListAgentsRequestBuilder list() {
return new ListAgentsRequestBuilder(sdkConfiguration);
}

/**
* Lists all Agents.
*
* @return The response from the API call
* @throws RuntimeException subclass if the API call fails
*/
public ListAgentsResponse listDirect() {
return list(null, null, null,
null, null);
}

/**
* Lists all Agents.
*
* @param apiVersion Which version of the API to use.
* @param pageSize
* @param pageToken
* @param parent
* @param options additional options
* @return The response from the API call
* @throws RuntimeException subclass if the API call fails
*/
public ListAgentsResponse list(
@Nullable String apiVersion, @Nullable Integer pageSize,
@Nullable String pageToken, @Nullable String parent,
@Nullable Options options) {
ListAgentsRequest request = new ListAgentsRequest(
apiVersion, pageSize, pageToken,
parent);
RequestOperation<ListAgentsRequest, ListAgentsResponse> operation
= new ListAgents.Sync(sdkConfiguration, options, _headers);
return operation.handleResponse(operation.doRequest(request));
}

/**
* Creates a new Agent (Typed version for SDK).
*
Expand Down Expand Up @@ -122,45 +165,40 @@ public CreateAgentResponse create(
}

/**
* Lists all Agents.
* Deletes an Agent.
*
* @return The call builder
*/
public ListAgentsRequestBuilder list() {
return new ListAgentsRequestBuilder(sdkConfiguration);
public DeleteAgentRequestBuilder delete() {
return new DeleteAgentRequestBuilder(sdkConfiguration);
}

/**
* Lists all Agents.
* Deletes an Agent.
*
* @param id
* @return The response from the API call
* @throws RuntimeException subclass if the API call fails
*/
public ListAgentsResponse listDirect() {
return list(null, null, null,
null, null);
public DeleteAgentResponse delete(@Nonnull String id) {
return delete(null, id, null);
}

/**
* Lists all Agents.
* Deletes an Agent.
*
* @param apiVersion Which version of the API to use.
* @param pageSize
* @param pageToken
* @param parent
* @param id
* @param options additional options
* @return The response from the API call
* @throws RuntimeException subclass if the API call fails
*/
public ListAgentsResponse list(
@Nullable String apiVersion, @Nullable Integer pageSize,
@Nullable String pageToken, @Nullable String parent,
public DeleteAgentResponse delete(
@Nullable String apiVersion, @Nonnull String id,
@Nullable Options options) {
ListAgentsRequest request = new ListAgentsRequest(
apiVersion, pageSize, pageToken,
parent);
RequestOperation<ListAgentsRequest, ListAgentsResponse> operation
= new ListAgents.Sync(sdkConfiguration, options, _headers);
DeleteAgentRequest request = new DeleteAgentRequest(apiVersion, id);
RequestOperation<DeleteAgentRequest, DeleteAgentResponse> operation
= new DeleteAgent.Sync(sdkConfiguration, options, _headers);
return operation.handleResponse(operation.doRequest(request));
}

Expand Down Expand Up @@ -202,42 +240,4 @@ public GetAgentResponse get(
return operation.handleResponse(operation.doRequest(request));
}

/**
* Deletes an Agent.
*
* @return The call builder
*/
public DeleteAgentRequestBuilder delete() {
return new DeleteAgentRequestBuilder(sdkConfiguration);
}

/**
* Deletes an Agent.
*
* @param id
* @return The response from the API call
* @throws RuntimeException subclass if the API call fails
*/
public DeleteAgentResponse delete(@Nonnull String id) {
return delete(null, id, null);
}

/**
* Deletes an Agent.
*
* @param apiVersion Which version of the API to use.
* @param id
* @param options additional options
* @return The response from the API call
* @throws RuntimeException subclass if the API call fails
*/
public DeleteAgentResponse delete(
@Nullable String apiVersion, @Nonnull String id,
@Nullable Options options) {
DeleteAgentRequest request = new DeleteAgentRequest(apiVersion, id);
RequestOperation<DeleteAgentRequest, DeleteAgentResponse> operation
= new DeleteAgent.Sync(sdkConfiguration, options, _headers);
return operation.handleResponse(operation.doRequest(request));
}

}
124 changes: 62 additions & 62 deletions src/main/java/com/google/genai/gaos/AsyncAgents.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,52 @@ public Agents sync() {
}


/**
* Lists all Agents.
*
* @return The async call builder
*/
public ListAgentsRequestBuilder list() {
return new ListAgentsRequestBuilder(sdkConfiguration);
}

/**
* Lists all Agents.
*
* @return {@code CompletableFuture<ListAgentsResponse>} - The async response
*/
public CompletableFuture<ListAgentsResponse> listDirect() {
return list(
null, null, null,
null, null);
}

/**
* Lists all Agents.
*
* @param apiVersion Which version of the API to use.
* @param pageSize
* @param pageToken
* @param parent
* @param options additional options
* @return {@code CompletableFuture<ListAgentsResponse>} - The async response
*/
public CompletableFuture<ListAgentsResponse> list(
@Nullable String apiVersion, @Nullable Integer pageSize,
@Nullable String pageToken, @Nullable String parent,
@Nullable Options options) {
ListAgentsRequest request = new ListAgentsRequest(
apiVersion, pageSize, pageToken,
parent);
AsyncRequestOperation<ListAgentsRequest, ListAgentsResponse> operation
= new ListAgents.Async(
sdkConfiguration, options, sdkConfiguration.retryScheduler(),
_headers);
return Operations.relayCancel(Operations.applyBodyReadAsync(operation.doRequest(request),
operation::handleResponse), operation);
}


/**
* Creates a new Agent (Typed version for SDK).
*
Expand Down Expand Up @@ -127,44 +173,38 @@ public CompletableFuture<CreateAgentResponse> create(


/**
* Lists all Agents.
* Deletes an Agent.
*
* @return The async call builder
*/
public ListAgentsRequestBuilder list() {
return new ListAgentsRequestBuilder(sdkConfiguration);
public DeleteAgentRequestBuilder delete() {
return new DeleteAgentRequestBuilder(sdkConfiguration);
}

/**
* Lists all Agents.
* Deletes an Agent.
*
* @return {@code CompletableFuture<ListAgentsResponse>} - The async response
* @param id
* @return {@code CompletableFuture<DeleteAgentResponse>} - The async response
*/
public CompletableFuture<ListAgentsResponse> listDirect() {
return list(
null, null, null,
null, null);
public CompletableFuture<DeleteAgentResponse> delete(@Nonnull String id) {
return delete(null, id, null);
}

/**
* Lists all Agents.
* Deletes an Agent.
*
* @param apiVersion Which version of the API to use.
* @param pageSize
* @param pageToken
* @param parent
* @param id
* @param options additional options
* @return {@code CompletableFuture<ListAgentsResponse>} - The async response
* @return {@code CompletableFuture<DeleteAgentResponse>} - The async response
*/
public CompletableFuture<ListAgentsResponse> list(
@Nullable String apiVersion, @Nullable Integer pageSize,
@Nullable String pageToken, @Nullable String parent,
public CompletableFuture<DeleteAgentResponse> delete(
@Nullable String apiVersion, @Nonnull String id,
@Nullable Options options) {
ListAgentsRequest request = new ListAgentsRequest(
apiVersion, pageSize, pageToken,
parent);
AsyncRequestOperation<ListAgentsRequest, ListAgentsResponse> operation
= new ListAgents.Async(
DeleteAgentRequest request = new DeleteAgentRequest(apiVersion, id);
AsyncRequestOperation<DeleteAgentRequest, DeleteAgentResponse> operation
= new DeleteAgent.Async(
sdkConfiguration, options, sdkConfiguration.retryScheduler(),
_headers);
return Operations.relayCancel(Operations.applyBodyReadAsync(operation.doRequest(request),
Expand Down Expand Up @@ -211,44 +251,4 @@ public CompletableFuture<GetAgentResponse> get(
operation::handleResponse), operation);
}


/**
* Deletes an Agent.
*
* @return The async call builder
*/
public DeleteAgentRequestBuilder delete() {
return new DeleteAgentRequestBuilder(sdkConfiguration);
}

/**
* Deletes an Agent.
*
* @param id
* @return {@code CompletableFuture<DeleteAgentResponse>} - The async response
*/
public CompletableFuture<DeleteAgentResponse> delete(@Nonnull String id) {
return delete(null, id, null);
}

/**
* Deletes an Agent.
*
* @param apiVersion Which version of the API to use.
* @param id
* @param options additional options
* @return {@code CompletableFuture<DeleteAgentResponse>} - The async response
*/
public CompletableFuture<DeleteAgentResponse> delete(
@Nullable String apiVersion, @Nonnull String id,
@Nullable Options options) {
DeleteAgentRequest request = new DeleteAgentRequest(apiVersion, id);
AsyncRequestOperation<DeleteAgentRequest, DeleteAgentResponse> operation
= new DeleteAgent.Async(
sdkConfiguration, options, sdkConfiguration.retryScheduler(),
_headers);
return Operations.relayCancel(Operations.applyBodyReadAsync(operation.doRequest(request),
operation::handleResponse), operation);
}

}
Loading
Loading