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
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import com.azure.ai.agents.implementation.models.CreateAgentRequest;
import com.azure.ai.agents.implementation.models.CreateAgentVersionFromManifestRequest;
import com.azure.ai.agents.implementation.models.CreateAgentVersionRequest;
import com.azure.ai.agents.implementation.models.DeleteAgentResponse;
import com.azure.ai.agents.implementation.models.UpdateAgentFromManifestRequest;
import com.azure.ai.agents.implementation.models.UpdateAgentRequest;
import com.azure.ai.agents.models.AgentDefinition;
Expand Down Expand Up @@ -95,34 +96,6 @@ public Mono<Response<BinaryData>> getAgentWithResponse(String agentName, Request
return this.serviceClient.getAgentWithResponseAsync(agentName, requestOptions);
}

/**
* Deletes an agent.
* <p><strong>Response Body Schema</strong></p>
*
* <pre>
* {@code
* {
* object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
* name: String (Required)
* deleted: boolean (Required)
* }
* }
* </pre>
*
* @param agentName The name of the agent to delete.
* @param requestOptions The options to configure the HTTP request before HTTP client sends it.
* @throws HttpResponseException thrown if the request is rejected by server.
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
* @return a deleted agent Object along with {@link Response} on successful completion of {@link Mono}.
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Response<BinaryData>> deleteAgentWithResponse(String agentName, RequestOptions requestOptions) {
return this.serviceClient.deleteAgentWithResponseAsync(agentName, requestOptions);
}

/**
* Create a new agent version.
* <p><strong>Header Parameters</strong></p>
Expand Down Expand Up @@ -309,27 +282,6 @@ public Mono<AgentDetails> getAgent(String agentName) {
.map(protocolMethodData -> protocolMethodData.toObject(AgentDetails.class));
}

/**
* Deletes an agent.
*
* @param agentName The name of the agent to delete.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws HttpResponseException thrown if the request is rejected by server.
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return a deleted agent Object on successful completion of {@link Mono}.
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<DeleteAgentResponse> deleteAgent(String agentName) {
// Generated convenience method for deleteAgentWithResponse
RequestOptions requestOptions = new RequestOptions();
return deleteAgentWithResponse(agentName, requestOptions).flatMap(FluxUtil::toMono)
.map(protocolMethodData -> protocolMethodData.toObject(DeleteAgentResponse.class));
}

/**
* Returns the list of all agents.
*
Expand Down Expand Up @@ -1432,4 +1384,69 @@ public Mono<AgentVersionDetails> createAgentVersion(String agentName, AgentDefin
.flatMap(FluxUtil::toMono)
.map(protocolMethodData -> protocolMethodData.toObject(AgentVersionDetails.class));
}

/**
* Deletes an agent.
* <p><strong>Response Body Schema</strong></p>
*
* <pre>
* {@code
* {
* object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
* name: String (Required)
* deleted: boolean (Required)
* }
* }
* </pre>
*
* @param agentName The name of the agent to delete.
* @param requestOptions The options to configure the HTTP request before HTTP client sends it.
* @throws HttpResponseException thrown if the request is rejected by server.
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
* @return a deleted agent Object along with {@link Response} on successful completion of {@link Mono}.
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
Mono<Response<BinaryData>> internalDeleteAgentWithResponse(String agentName, RequestOptions requestOptions) {
return this.serviceClient.internalDeleteAgentWithResponseAsync(agentName, requestOptions);
}

/**
* Deletes an agent.
*
* @param agentName The name of the agent to delete.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws HttpResponseException thrown if the request is rejected by server.
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return a deleted agent Object on successful completion of {@link Mono}.
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
Mono<DeleteAgentResponse> internalDeleteAgent(String agentName) {
// Generated convenience method for internalDeleteAgentWithResponse
RequestOptions requestOptions = new RequestOptions();
return internalDeleteAgentWithResponse(agentName, requestOptions).flatMap(FluxUtil::toMono)
.map(protocolMethodData -> protocolMethodData.toObject(DeleteAgentResponse.class));
}

/**
* Deletes an agent.
*
* @param agentName The name of the agent to delete.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws HttpResponseException thrown if the request is rejected by server.
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Void> deleteAgent(String agentName) {
return internalDeleteAgent(agentName).then();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import com.azure.ai.agents.implementation.models.CreateAgentRequest;
import com.azure.ai.agents.implementation.models.CreateAgentVersionFromManifestRequest;
import com.azure.ai.agents.implementation.models.CreateAgentVersionRequest;
import com.azure.ai.agents.implementation.models.DeleteAgentResponse;
import com.azure.ai.agents.implementation.models.UpdateAgentFromManifestRequest;
import com.azure.ai.agents.implementation.models.UpdateAgentRequest;
import com.azure.ai.agents.models.AgentDefinition;
Expand Down Expand Up @@ -89,34 +90,6 @@ public Response<BinaryData> getAgentWithResponse(String agentName, RequestOption
return this.serviceClient.getAgentWithResponse(agentName, requestOptions);
}

/**
* Deletes an agent.
* <p><strong>Response Body Schema</strong></p>
*
* <pre>
* {@code
* {
* object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
* name: String (Required)
* deleted: boolean (Required)
* }
* }
* </pre>
*
* @param agentName The name of the agent to delete.
* @param requestOptions The options to configure the HTTP request before HTTP client sends it.
* @throws HttpResponseException thrown if the request is rejected by server.
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
* @return a deleted agent Object along with {@link Response}.
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
public Response<BinaryData> deleteAgentWithResponse(String agentName, RequestOptions requestOptions) {
return this.serviceClient.deleteAgentWithResponse(agentName, requestOptions);
}

/**
* Create a new agent version.
* <p><strong>Header Parameters</strong></p>
Expand Down Expand Up @@ -301,26 +274,6 @@ public AgentDetails getAgent(String agentName) {
return getAgentWithResponse(agentName, requestOptions).getValue().toObject(AgentDetails.class);
}

/**
* Deletes an agent.
*
* @param agentName The name of the agent to delete.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws HttpResponseException thrown if the request is rejected by server.
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return a deleted agent Object.
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
public DeleteAgentResponse deleteAgent(String agentName) {
// Generated convenience method for deleteAgentWithResponse
RequestOptions requestOptions = new RequestOptions();
return deleteAgentWithResponse(agentName, requestOptions).getValue().toObject(DeleteAgentResponse.class);
}

/**
* Returns the list of all agents.
*
Expand Down Expand Up @@ -1364,4 +1317,69 @@ public AgentVersionDetails createAgentVersion(String agentName, AgentDefinition
return createAgentVersionWithResponse(agentName, createAgentVersionRequest, requestOptions).getValue()
.toObject(AgentVersionDetails.class);
}

/**
* Deletes an agent.
* <p><strong>Response Body Schema</strong></p>
*
* <pre>
* {@code
* {
* object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
* name: String (Required)
* deleted: boolean (Required)
* }
* }
* </pre>
*
* @param agentName The name of the agent to delete.
* @param requestOptions The options to configure the HTTP request before HTTP client sends it.
* @throws HttpResponseException thrown if the request is rejected by server.
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
* @return a deleted agent Object along with {@link Response}.
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
Response<BinaryData> internalDeleteAgentWithResponse(String agentName, RequestOptions requestOptions) {
return this.serviceClient.internalDeleteAgentWithResponse(agentName, requestOptions);
}

/**
* Deletes an agent.
*
* @param agentName The name of the agent to delete.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws HttpResponseException thrown if the request is rejected by server.
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return a deleted agent Object.
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
DeleteAgentResponse internalDeleteAgent(String agentName) {
// Generated convenience method for internalDeleteAgentWithResponse
RequestOptions requestOptions = new RequestOptions();
return internalDeleteAgentWithResponse(agentName, requestOptions).getValue()
.toObject(DeleteAgentResponse.class);
}

/**
* Deletes an agent.
*
* @param agentName The name of the agent to delete.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws HttpResponseException thrown if the request is rejected by server.
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public void deleteAgent(String agentName) {
internalDeleteAgent(agentName);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ Response<BinaryData> updateAgentFromManifestSync(@HostParam("endpoint") String e
@UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
@UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
@UnexpectedResponseExceptionType(HttpResponseException.class)
Mono<Response<BinaryData>> deleteAgent(@HostParam("endpoint") String endpoint,
Mono<Response<BinaryData>> internalDeleteAgent(@HostParam("endpoint") String endpoint,
@PathParam("agent_name") String agentName, @QueryParam("api-version") String apiVersion,
@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);

Expand All @@ -208,7 +208,7 @@ Mono<Response<BinaryData>> deleteAgent(@HostParam("endpoint") String endpoint,
@UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
@UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
@UnexpectedResponseExceptionType(HttpResponseException.class)
Response<BinaryData> deleteAgentSync(@HostParam("endpoint") String endpoint,
Response<BinaryData> internalDeleteAgentSync(@HostParam("endpoint") String endpoint,
@PathParam("agent_name") String agentName, @QueryParam("api-version") String apiVersion,
@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);

Expand Down Expand Up @@ -1062,9 +1062,10 @@ public Response<BinaryData> updateAgentFromManifestWithResponse(String agentName
* @return a deleted agent Object along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Response<BinaryData>> deleteAgentWithResponseAsync(String agentName, RequestOptions requestOptions) {
public Mono<Response<BinaryData>> internalDeleteAgentWithResponseAsync(String agentName,
RequestOptions requestOptions) {
final String accept = "application/json";
return FluxUtil.withContext(context -> service.deleteAgent(this.client.getEndpoint(), agentName,
return FluxUtil.withContext(context -> service.internalDeleteAgent(this.client.getEndpoint(), agentName,
this.client.getServiceVersion().getVersion(), accept, requestOptions, context));
}

Expand All @@ -1091,9 +1092,9 @@ public Mono<Response<BinaryData>> deleteAgentWithResponseAsync(String agentName,
* @return a deleted agent Object along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response<BinaryData> deleteAgentWithResponse(String agentName, RequestOptions requestOptions) {
public Response<BinaryData> internalDeleteAgentWithResponse(String agentName, RequestOptions requestOptions) {
final String accept = "application/json";
return service.deleteAgentSync(this.client.getEndpoint(), agentName,
return service.internalDeleteAgentSync(this.client.getEndpoint(), agentName,
this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) TypeSpec Code Generator.
package com.azure.ai.agents.models;
package com.azure.ai.agents.implementation.models;

import com.azure.ai.agents.models.AgentObjectType;
import com.azure.core.annotation.Generated;
import com.azure.core.annotation.Immutable;
import com.azure.json.JsonReader;
Expand Down

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion sdk/ai/azure-ai-agents/tsp-location.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
directory: specification/ai-foundry/data-plane/Foundry/src/sdk-agents
commit: 7ff7194665dac00955db5d50386910e761aef2ad
commit: 695818b3fe5d664be6c257544b49a83a099a0efb
repo: Azure/azure-rest-api-specs
additionalDirectories:
- specification/ai-foundry/data-plane/Foundry/src/agents
Expand Down
Loading