updateAgentFromCodeWithResponseInternal(String agentName, S
* description: String (Optional)
* created_at: long (Required)
* definition (Required): {
- * kind: String(prompt/hosted/workflow/external) (Required)
+ * kind: String(prompt/hosted/workflow/external/voice) (Required)
* rai_config (Optional): {
* rai_policy_name: String (Required)
+ * invocations_moderation (Optional): {
+ * input_content_type: String(json/text) (Optional)
+ * output_content_type: String(json/text) (Optional)
+ * response_mode: String(non_streaming/streaming/both) (Required)
+ * input_paths (Optional): [
+ * String (Optional)
+ * ]
+ * output_paths (Optional): [
+ * String (Optional)
+ * ]
+ * stream_selectors (Optional): [
+ * (Optional){
+ * event_type: String (Required)
+ * text_field: String (Optional)
+ * }
+ * ]
+ * }
* }
* }
* draft: Boolean (Optional)
diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/AgentsClientBuilder.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/AgentsClientBuilder.java
index 7dbab0615e426..824df8d8f9be5 100644
--- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/AgentsClientBuilder.java
+++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/AgentsClientBuilder.java
@@ -60,10 +60,14 @@
*/
@ServiceClientBuilder(
serviceClients = {
+ BetaVoiceAgentsConversationsClient.class,
+ BetaVoiceAgentsTelephonyClient.class,
BetaMemoryStoresClient.class,
BetaAgentsClient.class,
AgentsClient.class,
ToolboxesClient.class,
+ BetaVoiceAgentsConversationsAsyncClient.class,
+ BetaVoiceAgentsTelephonyAsyncClient.class,
BetaMemoryStoresAsyncClient.class,
BetaAgentsAsyncClient.class,
AgentsAsyncClient.class,
@@ -92,6 +96,9 @@ public final class AgentsClientBuilder
private static final String MEMORY_STORES_PREVIEW_FEATURES
= FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW.toString();
+ private static final String VOICE_AGENTS_PREVIEW_FEATURES
+ = AgentDefinitionOptInKeys.VOICE_AGENTS_V1_PREVIEW.toString();
+
private boolean allowPreview;
@Generated
@@ -529,7 +536,9 @@ public AgentsClient buildAgentsClient() {
* The returned builder uses the configuration set on this builder, including endpoint, credential, HTTP pipeline,
* policies, retry settings, logging options, client options, and service version. Use this method
* when you want to build a client whose type is prefixed with {@code Beta}, such as {@link BetaAgentsClient},
- * {@link BetaAgentsAsyncClient}, {@link BetaMemoryStoresClient}, {@link BetaMemoryStoresAsyncClient}
+ * {@link BetaAgentsAsyncClient}, {@link BetaMemoryStoresClient}, {@link BetaMemoryStoresAsyncClient},
+ * {@link BetaVoiceAgentsTelephonyClient}, {@link BetaVoiceAgentsTelephonyAsyncClient},
+ * {@link BetaVoiceAgentsConversationsClient}, or {@link BetaVoiceAgentsConversationsAsyncClient}.
*
* Clients created by this sub-builder automatically opt in to the preview service area they target by adding the
* required {@code Foundry-Features} header. Calling {@link #allowPreview(boolean)} is not required for these
@@ -554,8 +563,12 @@ public BetaAgentsClientBuilder beta() {
serviceClients = {
BetaAgentsClient.class,
BetaMemoryStoresClient.class,
+ BetaVoiceAgentsTelephonyClient.class,
+ BetaVoiceAgentsConversationsClient.class,
BetaAgentsAsyncClient.class,
- BetaMemoryStoresAsyncClient.class })
+ BetaMemoryStoresAsyncClient.class,
+ BetaVoiceAgentsTelephonyAsyncClient.class,
+ BetaVoiceAgentsConversationsAsyncClient.class })
public final class BetaAgentsClientBuilder {
/**
@@ -595,6 +608,38 @@ public BetaMemoryStoresAsyncClient buildBetaMemoryStoresAsyncClient() {
buildInnerClient(MEMORY_STORES_PREVIEW_FEATURES).getBetaMemoryStores());
}
+ /**
+ * Builds an asynchronous beta client for preview voice-agent telephony operations.
+ *
+ * The client is created using the endpoint, credential, pipeline, policies, and other configuration set on the
+ * enclosing {@link AgentsClientBuilder}. Requests made by the client automatically include the
+ * {@code Foundry-Features} header required for voice-agent preview operations, so
+ * {@link AgentsClientBuilder#allowPreview(boolean)} does not need to be enabled.
+ *
+ * @return an instance of BetaVoiceAgentsTelephonyAsyncClient.
+ */
+ @Beta
+ public BetaVoiceAgentsTelephonyAsyncClient buildBetaVoiceAgentsTelephonyAsyncClient() {
+ return new BetaVoiceAgentsTelephonyAsyncClient(
+ buildInnerClient(VOICE_AGENTS_PREVIEW_FEATURES).getBetaVoiceAgentsTelephonies());
+ }
+
+ /**
+ * Builds an asynchronous beta client for preview voice-agent conversation operations.
+ *
+ * The client is created using the endpoint, credential, pipeline, policies, and other configuration set on the
+ * enclosing {@link AgentsClientBuilder}. Requests made by the client automatically include the
+ * {@code Foundry-Features} header required for voice-agent preview operations, so
+ * {@link AgentsClientBuilder#allowPreview(boolean)} does not need to be enabled.
+ *
+ * @return an instance of BetaVoiceAgentsConversationsAsyncClient.
+ */
+ @Beta
+ public BetaVoiceAgentsConversationsAsyncClient buildBetaVoiceAgentsConversationsAsyncClient() {
+ return new BetaVoiceAgentsConversationsAsyncClient(
+ buildInnerClient(VOICE_AGENTS_PREVIEW_FEATURES).getBetaVoiceAgentsConversations());
+ }
+
/**
* Builds a synchronous beta Agents client for preview agent optimization operations.
*
@@ -624,6 +669,38 @@ public BetaAgentsClient buildBetaAgentsClient() {
public BetaMemoryStoresClient buildBetaMemoryStoresClient() {
return new BetaMemoryStoresClient(buildInnerClient(MEMORY_STORES_PREVIEW_FEATURES).getBetaMemoryStores());
}
+
+ /**
+ * Builds a synchronous beta client for preview voice-agent telephony operations.
+ *
+ * The client is created using the endpoint, credential, pipeline, policies, and other configuration set on the
+ * enclosing {@link AgentsClientBuilder}. Requests made by the client automatically include the
+ * {@code Foundry-Features} header required for voice-agent preview operations, so
+ * {@link AgentsClientBuilder#allowPreview(boolean)} does not need to be enabled.
+ *
+ * @return an instance of BetaVoiceAgentsTelephonyClient.
+ */
+ @Beta
+ public BetaVoiceAgentsTelephonyClient buildBetaVoiceAgentsTelephonyClient() {
+ return new BetaVoiceAgentsTelephonyClient(
+ buildInnerClient(VOICE_AGENTS_PREVIEW_FEATURES).getBetaVoiceAgentsTelephonies());
+ }
+
+ /**
+ * Builds a synchronous beta client for preview voice-agent conversation operations.
+ *
+ * The client is created using the endpoint, credential, pipeline, policies, and other configuration set on the
+ * enclosing {@link AgentsClientBuilder}. Requests made by the client automatically include the
+ * {@code Foundry-Features} header required for voice-agent preview operations, so
+ * {@link AgentsClientBuilder#allowPreview(boolean)} does not need to be enabled.
+ *
+ * @return an instance of BetaVoiceAgentsConversationsClient.
+ */
+ @Beta
+ public BetaVoiceAgentsConversationsClient buildBetaVoiceAgentsConversationsClient() {
+ return new BetaVoiceAgentsConversationsClient(
+ buildInnerClient(VOICE_AGENTS_PREVIEW_FEATURES).getBetaVoiceAgentsConversations());
+ }
}
/**
@@ -681,4 +758,40 @@ public ToolboxesAsyncClient buildToolboxesAsyncClient() {
public ToolboxesClient buildToolboxesClient() {
return new ToolboxesClient(buildInnerClient().getToolboxes());
}
+
+ /**
+ * Builds an instance of BetaVoiceAgentsConversationsAsyncClient class.
+ *
+ * @return an instance of BetaVoiceAgentsConversationsAsyncClient.
+ */
+ private BetaVoiceAgentsConversationsAsyncClient buildBetaVoiceAgentsConversationsAsyncClient() {
+ return new BetaVoiceAgentsConversationsAsyncClient(buildInnerClient().getBetaVoiceAgentsConversations());
+ }
+
+ /**
+ * Builds an instance of BetaVoiceAgentsTelephonyAsyncClient class.
+ *
+ * @return an instance of BetaVoiceAgentsTelephonyAsyncClient.
+ */
+ private BetaVoiceAgentsTelephonyAsyncClient buildBetaVoiceAgentsTelephonyAsyncClient() {
+ return new BetaVoiceAgentsTelephonyAsyncClient(buildInnerClient().getBetaVoiceAgentsTelephonies());
+ }
+
+ /**
+ * Builds an instance of BetaVoiceAgentsConversationsClient class.
+ *
+ * @return an instance of BetaVoiceAgentsConversationsClient.
+ */
+ private BetaVoiceAgentsConversationsClient buildBetaVoiceAgentsConversationsClient() {
+ return new BetaVoiceAgentsConversationsClient(buildInnerClient().getBetaVoiceAgentsConversations());
+ }
+
+ /**
+ * Builds an instance of BetaVoiceAgentsTelephonyClient class.
+ *
+ * @return an instance of BetaVoiceAgentsTelephonyClient.
+ */
+ private BetaVoiceAgentsTelephonyClient buildBetaVoiceAgentsTelephonyClient() {
+ return new BetaVoiceAgentsTelephonyClient(buildInnerClient().getBetaVoiceAgentsTelephonies());
+ }
}
diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/BetaAgentsAsyncClient.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/BetaAgentsAsyncClient.java
index f8c58fd575db4..1ee141c74b5f8 100644
--- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/BetaAgentsAsyncClient.java
+++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/BetaAgentsAsyncClient.java
@@ -5,6 +5,7 @@
import com.azure.ai.agents.implementation.BetaAgentsImpl;
import com.azure.ai.agents.implementation.utils.Beta;
+import com.azure.ai.agents.models.AgentDetails;
import com.azure.ai.agents.models.AgentOptimizationJob;
import com.azure.ai.agents.models.AgentOptimizationJobListItem;
import com.azure.ai.agents.models.AgentOptimizationJobResult;
@@ -778,4 +779,174 @@ public PollerFlux beginCreateOptimizationJob(BinaryData
RequestOptions requestOptions = new RequestOptions();
return serviceClient.beginCreateOptimizationJobWithModelAsync(BinaryData.fromObject(job), requestOptions);
}
+
+ /**
+ * Generate an agent
+ *
+ * Generates and creates an agent from kind-specific high-level inputs.
+ * The generated definition remains fully editable through the standard agent versioning operations.
+ * Request Body Schema
+ *
+ *
+ * {@code
+ * BinaryData
+ * }
+ *
+ *
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
+ * id: String (Required)
+ * name: String (Required)
+ * state: String(enabled/disabled) (Required)
+ * configuration_state: String(enabled/disabled) (Required)
+ * state_source: String(agent_instance_identity/agent_blueprint) (Optional)
+ * versions (Required): {
+ * latest (Required): {
+ * metadata (Required): {
+ * String: String (Required)
+ * }
+ * object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
+ * id: String (Required)
+ * name: String (Required)
+ * version: String (Required)
+ * description: String (Optional)
+ * created_at: long (Required)
+ * definition (Required): {
+ * kind: String(prompt/hosted/workflow/external/voice) (Required)
+ * rai_config (Optional): {
+ * rai_policy_name: String (Required)
+ * invocations_moderation (Optional): {
+ * input_content_type: String(json/text) (Optional)
+ * output_content_type: String(json/text) (Optional)
+ * response_mode: String(non_streaming/streaming/both) (Required)
+ * input_paths (Optional): [
+ * String (Optional)
+ * ]
+ * output_paths (Optional): [
+ * String (Optional)
+ * ]
+ * stream_selectors (Optional): [
+ * (Optional){
+ * event_type: String (Required)
+ * text_field: String (Optional)
+ * }
+ * ]
+ * }
+ * }
+ * }
+ * draft: Boolean (Optional)
+ * status: String(creating/active/failed/deleting/deleted) (Optional)
+ * instance_identity (Optional): {
+ * principal_id: String (Required)
+ * client_id: String (Required)
+ * status: String(active/disabled) (Optional)
+ * }
+ * blueprint (Optional): (recursive schema, see blueprint above)
+ * blueprint_reference (Optional): {
+ * type: String(ManagedAgentIdentityBlueprint) (Required)
+ * }
+ * agent_guid: String (Optional)
+ * }
+ * }
+ * agent_endpoint (Optional): {
+ * version_selector (Optional): {
+ * version_selection_rules (Optional, Required on create): [
+ * (Optional, Required on create){
+ * type: String(FixedRatio) (Required)
+ * agent_version: String (Optional, Required on create)
+ * }
+ * ]
+ * }
+ * protocol_configuration (Optional): {
+ * activity (Optional): {
+ * enable_m365_public_endpoint: Boolean (Optional)
+ * access_boundaries (Optional): [
+ * String(read.1on1.developers/read.1on1.manager/read.1on1.allowlisted/read.1on1.tenant/write.1on1.developers/write.1on1.manager/write.1on1.allowlisted/write.1on1.tenant/read.group.developers/read.group.allowlisted/read.group.manager-invited/read.group.manager-present/read.group.tenant/write.group.developers/write.group.allowlisted/write.group.manager-invited/write.group.manager-present/write.group.tenant) (Optional)
+ * ]
+ * }
+ * responses (Optional): {
+ * }
+ * a2a (Optional): {
+ * }
+ * mcp (Optional): {
+ * }
+ * invocations (Optional): {
+ * }
+ * invocations_ws (Optional): {
+ * }
+ * }
+ * authorization_schemes (Optional): [
+ * (Optional){
+ * type: String(Entra/BotService/BotServiceRbac/BotServiceTenant) (Required)
+ * }
+ * ]
+ * publish_approval_status: String(not_published/pending/approved/rejected/no_approval_needed) (Optional)
+ * }
+ * digital_worker_type: String(m365) (Optional)
+ * instance_identity (Optional): (recursive schema, see instance_identity above)
+ * blueprint (Optional): (recursive schema, see blueprint above)
+ * blueprint_reference (Optional): (recursive schema, see blueprint_reference above)
+ * agent_card (Optional): {
+ * version: String (Optional, Required on create)
+ * description: String (Optional)
+ * skills (Optional, Required on create): [
+ * (Optional, Required on create){
+ * id: String (Optional, Required on create)
+ * name: String (Optional, Required on create)
+ * description: String (Optional)
+ * tags (Optional): [
+ * String (Optional)
+ * ]
+ * examples (Optional): [
+ * String (Optional)
+ * ]
+ * }
+ * ]
+ * }
+ * }
+ * }
+ *
+ *
+ * @param body The kind-specific inputs for generating and creating an agent.
+ * @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 the response body along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> createAgentFromPromptWithResponse(BinaryData body,
+ RequestOptions requestOptions) {
+ return this.serviceClient.createAgentFromPromptWithResponseAsync(body, requestOptions);
+ }
+
+ /**
+ * Generate an agent
+ *
+ * Generates and creates an agent from kind-specific high-level inputs.
+ * The generated definition remains fully editable through the standard agent versioning operations.
+ *
+ * @param body The kind-specific inputs for generating and creating an agent.
+ * @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 the response body on successful completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono createAgentFromPrompt(BinaryData body) {
+ // Generated convenience method for createAgentFromPromptWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ return createAgentFromPromptWithResponse(body, requestOptions).flatMap(FluxUtil::toMono)
+ .map(protocolMethodData -> protocolMethodData.toObject(AgentDetails.class));
+ }
}
diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/BetaAgentsClient.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/BetaAgentsClient.java
index be812c429b97a..3e63f6123dd4e 100644
--- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/BetaAgentsClient.java
+++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/BetaAgentsClient.java
@@ -5,6 +5,7 @@
import com.azure.ai.agents.implementation.BetaAgentsImpl;
import com.azure.ai.agents.implementation.utils.Beta;
+import com.azure.ai.agents.models.AgentDetails;
import com.azure.ai.agents.models.AgentOptimizationJob;
import com.azure.ai.agents.models.AgentOptimizationJobListItem;
import com.azure.ai.agents.models.AgentOptimizationJobResult;
@@ -745,4 +746,172 @@ public SyncPoller beginCreateOptimizationJob(BinaryData
RequestOptions requestOptions = new RequestOptions();
return serviceClient.beginCreateOptimizationJobWithModel(BinaryData.fromObject(job), requestOptions);
}
+
+ /**
+ * Generate an agent
+ *
+ * Generates and creates an agent from kind-specific high-level inputs.
+ * The generated definition remains fully editable through the standard agent versioning operations.
+ * Request Body Schema
+ *
+ *
+ * {@code
+ * BinaryData
+ * }
+ *
+ *
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
+ * id: String (Required)
+ * name: String (Required)
+ * state: String(enabled/disabled) (Required)
+ * configuration_state: String(enabled/disabled) (Required)
+ * state_source: String(agent_instance_identity/agent_blueprint) (Optional)
+ * versions (Required): {
+ * latest (Required): {
+ * metadata (Required): {
+ * String: String (Required)
+ * }
+ * object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
+ * id: String (Required)
+ * name: String (Required)
+ * version: String (Required)
+ * description: String (Optional)
+ * created_at: long (Required)
+ * definition (Required): {
+ * kind: String(prompt/hosted/workflow/external/voice) (Required)
+ * rai_config (Optional): {
+ * rai_policy_name: String (Required)
+ * invocations_moderation (Optional): {
+ * input_content_type: String(json/text) (Optional)
+ * output_content_type: String(json/text) (Optional)
+ * response_mode: String(non_streaming/streaming/both) (Required)
+ * input_paths (Optional): [
+ * String (Optional)
+ * ]
+ * output_paths (Optional): [
+ * String (Optional)
+ * ]
+ * stream_selectors (Optional): [
+ * (Optional){
+ * event_type: String (Required)
+ * text_field: String (Optional)
+ * }
+ * ]
+ * }
+ * }
+ * }
+ * draft: Boolean (Optional)
+ * status: String(creating/active/failed/deleting/deleted) (Optional)
+ * instance_identity (Optional): {
+ * principal_id: String (Required)
+ * client_id: String (Required)
+ * status: String(active/disabled) (Optional)
+ * }
+ * blueprint (Optional): (recursive schema, see blueprint above)
+ * blueprint_reference (Optional): {
+ * type: String(ManagedAgentIdentityBlueprint) (Required)
+ * }
+ * agent_guid: String (Optional)
+ * }
+ * }
+ * agent_endpoint (Optional): {
+ * version_selector (Optional): {
+ * version_selection_rules (Optional, Required on create): [
+ * (Optional, Required on create){
+ * type: String(FixedRatio) (Required)
+ * agent_version: String (Optional, Required on create)
+ * }
+ * ]
+ * }
+ * protocol_configuration (Optional): {
+ * activity (Optional): {
+ * enable_m365_public_endpoint: Boolean (Optional)
+ * access_boundaries (Optional): [
+ * String(read.1on1.developers/read.1on1.manager/read.1on1.allowlisted/read.1on1.tenant/write.1on1.developers/write.1on1.manager/write.1on1.allowlisted/write.1on1.tenant/read.group.developers/read.group.allowlisted/read.group.manager-invited/read.group.manager-present/read.group.tenant/write.group.developers/write.group.allowlisted/write.group.manager-invited/write.group.manager-present/write.group.tenant) (Optional)
+ * ]
+ * }
+ * responses (Optional): {
+ * }
+ * a2a (Optional): {
+ * }
+ * mcp (Optional): {
+ * }
+ * invocations (Optional): {
+ * }
+ * invocations_ws (Optional): {
+ * }
+ * }
+ * authorization_schemes (Optional): [
+ * (Optional){
+ * type: String(Entra/BotService/BotServiceRbac/BotServiceTenant) (Required)
+ * }
+ * ]
+ * publish_approval_status: String(not_published/pending/approved/rejected/no_approval_needed) (Optional)
+ * }
+ * digital_worker_type: String(m365) (Optional)
+ * instance_identity (Optional): (recursive schema, see instance_identity above)
+ * blueprint (Optional): (recursive schema, see blueprint above)
+ * blueprint_reference (Optional): (recursive schema, see blueprint_reference above)
+ * agent_card (Optional): {
+ * version: String (Optional, Required on create)
+ * description: String (Optional)
+ * skills (Optional, Required on create): [
+ * (Optional, Required on create){
+ * id: String (Optional, Required on create)
+ * name: String (Optional, Required on create)
+ * description: String (Optional)
+ * tags (Optional): [
+ * String (Optional)
+ * ]
+ * examples (Optional): [
+ * String (Optional)
+ * ]
+ * }
+ * ]
+ * }
+ * }
+ * }
+ *
+ *
+ * @param body The kind-specific inputs for generating and creating an agent.
+ * @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 the response body along with {@link Response}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response createAgentFromPromptWithResponse(BinaryData body, RequestOptions requestOptions) {
+ return this.serviceClient.createAgentFromPromptWithResponse(body, requestOptions);
+ }
+
+ /**
+ * Generate an agent
+ *
+ * Generates and creates an agent from kind-specific high-level inputs.
+ * The generated definition remains fully editable through the standard agent versioning operations.
+ *
+ * @param body The kind-specific inputs for generating and creating an agent.
+ * @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 the response.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public AgentDetails createAgentFromPrompt(BinaryData body) {
+ // Generated convenience method for createAgentFromPromptWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ return createAgentFromPromptWithResponse(body, requestOptions).getValue().toObject(AgentDetails.class);
+ }
}
diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/BetaVoiceAgentsConversationsAsyncClient.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/BetaVoiceAgentsConversationsAsyncClient.java
new file mode 100644
index 0000000000000..eaed34bda0db5
--- /dev/null
+++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/BetaVoiceAgentsConversationsAsyncClient.java
@@ -0,0 +1,1564 @@
+// 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;
+
+import com.azure.ai.agents.implementation.BetaVoiceAgentsConversationsImpl;
+import com.azure.ai.agents.implementation.utils.Beta;
+import com.azure.ai.agents.models.PageOrder;
+import com.azure.ai.agents.models.RealtimeConversationItem;
+import com.azure.ai.agents.models.VoiceAudioItemResponse;
+import com.azure.ai.agents.models.VoiceConversation;
+import com.azure.ai.agents.models.VoiceGeneratedAudioItemResponse;
+import com.azure.ai.agents.models.VoiceRecordingResponse;
+import com.azure.ai.agents.models.VoiceResponse;
+import com.azure.core.annotation.Generated;
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceClient;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.exception.ClientAuthenticationException;
+import com.azure.core.exception.HttpResponseException;
+import com.azure.core.exception.ResourceModifiedException;
+import com.azure.core.exception.ResourceNotFoundException;
+import com.azure.core.http.rest.PagedFlux;
+import com.azure.core.http.rest.PagedResponse;
+import com.azure.core.http.rest.PagedResponseBase;
+import com.azure.core.http.rest.RequestOptions;
+import com.azure.core.http.rest.Response;
+import com.azure.core.util.BinaryData;
+import com.azure.core.util.FluxUtil;
+import java.util.stream.Collectors;
+import reactor.core.publisher.Flux;
+import reactor.core.publisher.Mono;
+
+/**
+ * Initializes a new instance of the asynchronous AgentsClient type.
+ */
+@ServiceClient(builder = AgentsClientBuilder.class, isAsync = true)
+@Beta(warningText = "This class is in preview and may change in future releases.")
+public final class BetaVoiceAgentsConversationsAsyncClient {
+
+ @Generated
+ private final BetaVoiceAgentsConversationsImpl serviceClient;
+
+ /**
+ * Initializes an instance of BetaVoiceAgentsConversationsAsyncClient class.
+ *
+ * @param serviceClient the service client implementation.
+ */
+ @Generated
+ BetaVoiceAgentsConversationsAsyncClient(BetaVoiceAgentsConversationsImpl serviceClient) {
+ this.serviceClient = serviceClient;
+ }
+
+ /**
+ * List voice agent conversations
+ *
+ * Returns the conversations persisted for the specified voice agent endpoint.
+ * Conversations are present when the session's effective `store` setting is `true`, whether inherited from the
+ * agent definition or enabled by the WebSocket session override.
+ * Query Parameters
+ *
+ * Query Parameters
+ * | Name | Type | Required | Description |
+ * | limit | Integer | No | A limit on the number of objects to be returned. Limit can range
+ * between 1 and 100, and the
+ * default is 20. |
+ * | order | String | No | Sort order by the `created_at` timestamp of the objects. `asc`
+ * for ascending order and`desc`
+ * for descending order. Allowed values: "asc", "desc". |
+ * | after | String | No | A cursor for use in pagination. `after` is an object ID that
+ * defines your place in the list.
+ * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your
+ * subsequent call can include after=obj_foo in order to fetch the next page of the list. |
+ * | before | String | No | A cursor for use in pagination. `before` is an object ID that
+ * defines your place in the list.
+ * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your
+ * subsequent call can include before=obj_foo in order to fetch the previous page of the list. |
+ *
+ * You can add these to a request with {@link RequestOptions#addQueryParam}
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * id: String (Required)
+ * object: String (Required)
+ * status: String(in_progress/completed/failed) (Required)
+ * created_at: long (Required)
+ * completed_at: Long (Optional)
+ * metadata (Optional): {
+ * String: String (Required)
+ * }
+ * usage (Optional): {
+ * total_tokens: Long (Optional)
+ * input_tokens: Long (Optional)
+ * output_tokens: Long (Optional)
+ * input_token_details (Optional): {
+ * cached_tokens: Long (Optional)
+ * text_tokens: Long (Optional)
+ * image_tokens: Long (Optional)
+ * audio_tokens: Long (Optional)
+ * cached_tokens_details (Optional): {
+ * text_tokens: Long (Optional)
+ * image_tokens: Long (Optional)
+ * audio_tokens: Long (Optional)
+ * }
+ * }
+ * output_token_details (Optional): {
+ * text_tokens: Long (Optional)
+ * audio_tokens: Long (Optional)
+ * }
+ * }
+ * last_error (Optional): {
+ * code: String (Required)
+ * message: String (Required)
+ * param: String (Optional)
+ * type: String (Optional)
+ * details (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * additionalInfo (Optional): {
+ * String: BinaryData (Required)
+ * }
+ * debugInfo (Optional): {
+ * String: BinaryData (Required)
+ * }
+ * }
+ * }
+ * }
+ *
+ *
+ * @param agentName The name of the agent.
+ * @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 the response data for a requested list of items as paginated response with {@link PagedFlux}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedFlux listAgentConversations(String agentName, RequestOptions requestOptions) {
+ return this.serviceClient.listAgentConversationsAsync(agentName, requestOptions);
+ }
+
+ /**
+ * Get a voice agent conversation
+ *
+ * Retrieves a single conversation recorded for the specified voice agent endpoint by its id.
+ * Returns `404` when the conversation was not persisted (`store = false`) or does not exist.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * id: String (Required)
+ * object: String (Required)
+ * status: String(in_progress/completed/failed) (Required)
+ * created_at: long (Required)
+ * completed_at: Long (Optional)
+ * metadata (Optional): {
+ * String: String (Required)
+ * }
+ * usage (Optional): {
+ * total_tokens: Long (Optional)
+ * input_tokens: Long (Optional)
+ * output_tokens: Long (Optional)
+ * input_token_details (Optional): {
+ * cached_tokens: Long (Optional)
+ * text_tokens: Long (Optional)
+ * image_tokens: Long (Optional)
+ * audio_tokens: Long (Optional)
+ * cached_tokens_details (Optional): {
+ * text_tokens: Long (Optional)
+ * image_tokens: Long (Optional)
+ * audio_tokens: Long (Optional)
+ * }
+ * }
+ * output_token_details (Optional): {
+ * text_tokens: Long (Optional)
+ * audio_tokens: Long (Optional)
+ * }
+ * }
+ * last_error (Optional): {
+ * code: String (Required)
+ * message: String (Required)
+ * param: String (Optional)
+ * type: String (Optional)
+ * details (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * additionalInfo (Optional): {
+ * String: BinaryData (Required)
+ * }
+ * debugInfo (Optional): {
+ * String: BinaryData (Required)
+ * }
+ * }
+ * }
+ * }
+ *
+ *
+ * @param agentName The name of the agent.
+ * @param conversationId The id of the conversation to retrieve.
+ * @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 voice agent conversation
+ *
+ * Retrieves a single conversation recorded for the specified voice agent endpoint by its id.
+ * Returns `404` when the conversation was not persisted (`store = false`) or does not exist along with
+ * {@link Response} on successful completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> getAgentConversationWithResponse(String agentName, String conversationId,
+ RequestOptions requestOptions) {
+ return this.serviceClient.getAgentConversationWithResponseAsync(agentName, conversationId, requestOptions);
+ }
+
+ /**
+ * Delete a voice agent conversation
+ *
+ * Deletes a conversation and all of its stored data — responses, items, and any audio (cascade). This is
+ * the customer's explicit data-deletion control for voice conversations.
+ *
+ * @param agentName The name of the agent.
+ * @param conversationId The id of the conversation 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 the {@link Response} on successful completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> deleteAgentConversationWithResponse(String agentName, String conversationId,
+ RequestOptions requestOptions) {
+ return this.serviceClient.deleteAgentConversationWithResponseAsync(agentName, conversationId, requestOptions);
+ }
+
+ /**
+ * List responses in a voice agent conversation
+ *
+ * Returns a paged collection of the responses (model inference turns) recorded for the specified
+ * conversation. The per-response `output` projection may be omitted here; use the response-items route
+ * for the canonical paged output. Returns `404` when the conversation was not persisted (`store = false`).
+ * Query Parameters
+ *
+ * Query Parameters
+ * | Name | Type | Required | Description |
+ * | limit | Integer | No | A limit on the number of objects to be returned. Limit can range
+ * between 1 and 100, and the
+ * default is 20. |
+ * | order | String | No | Sort order by the `created_at` timestamp of the objects. `asc`
+ * for ascending order and`desc`
+ * for descending order. Allowed values: "asc", "desc". |
+ * | after | String | No | A cursor for use in pagination. `after` is an object ID that
+ * defines your place in the list.
+ * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your
+ * subsequent call can include after=obj_foo in order to fetch the next page of the list. |
+ * | before | String | No | A cursor for use in pagination. `before` is an object ID that
+ * defines your place in the list.
+ * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your
+ * subsequent call can include before=obj_foo in order to fetch the previous page of the list. |
+ *
+ * You can add these to a request with {@link RequestOptions#addQueryParam}
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * object: String(realtime.response) (Optional)
+ * status: String(completed/cancelled/failed/incomplete/in_progress) (Optional)
+ * status_details (Optional): {
+ * type: String(completed/cancelled/failed/incomplete) (Optional)
+ * reason: String(turn_detected/client_cancelled/max_output_tokens/content_filter) (Optional)
+ * error (Optional): {
+ * type: String (Optional)
+ * code: String (Optional)
+ * }
+ * }
+ * usage (Optional): {
+ * total_tokens: Long (Optional)
+ * input_tokens: Long (Optional)
+ * output_tokens: Long (Optional)
+ * input_token_details (Optional): {
+ * cached_tokens: Long (Optional)
+ * text_tokens: Long (Optional)
+ * image_tokens: Long (Optional)
+ * audio_tokens: Long (Optional)
+ * cached_tokens_details (Optional): {
+ * text_tokens: Long (Optional)
+ * image_tokens: Long (Optional)
+ * audio_tokens: Long (Optional)
+ * }
+ * }
+ * output_token_details (Optional): {
+ * text_tokens: Long (Optional)
+ * audio_tokens: Long (Optional)
+ * }
+ * }
+ * output_modalities (Optional): [
+ * String(text/audio) (Optional)
+ * ]
+ * max_output_tokens: BinaryData (Optional)
+ * id: String (Required)
+ * output (Optional): [
+ * (Optional){
+ * type: String(function_call/function_call_output/mcp_approval_response/mcp_list_tools/mcp_call/mcp_approval_request/message) (Required)
+ * }
+ * ]
+ * conversation_id: String (Required)
+ * audio (Optional): {
+ * output (Optional): {
+ * voice: String (Optional)
+ * voice_type: String(openai/azure-standard/azure-custom/azure-personal/avatar-voice-sync/azure-realtime-native) (Optional)
+ * voice_locale: String (Optional)
+ * format (Optional): {
+ * type: String(audio/pcm/audio/pcmu/audio/pcma) (Required)
+ * }
+ * }
+ * }
+ * metadata (Optional): {
+ * String: String (Required)
+ * }
+ * temperature: Double (Optional)
+ * created_at: Long (Optional)
+ * completed_at: Long (Optional)
+ * }
+ * }
+ *
+ *
+ * @param agentName The name of the agent.
+ * @param conversationId The id of the conversation whose responses are listed.
+ * @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 the response data for a requested list of items as paginated response with {@link PagedFlux}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedFlux listAgentConversationResponses(String agentName, String conversationId,
+ RequestOptions requestOptions) {
+ return this.serviceClient.listAgentConversationResponsesAsync(agentName, conversationId, requestOptions);
+ }
+
+ /**
+ * Get a voice agent conversation response
+ *
+ * Retrieves a single response from the specified conversation by its id, including its `output` items,
+ * `usage`, and status. Returns `404` when the conversation or response was not persisted (`store = false`).
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * object: String(realtime.response) (Optional)
+ * status: String(completed/cancelled/failed/incomplete/in_progress) (Optional)
+ * status_details (Optional): {
+ * type: String(completed/cancelled/failed/incomplete) (Optional)
+ * reason: String(turn_detected/client_cancelled/max_output_tokens/content_filter) (Optional)
+ * error (Optional): {
+ * type: String (Optional)
+ * code: String (Optional)
+ * }
+ * }
+ * usage (Optional): {
+ * total_tokens: Long (Optional)
+ * input_tokens: Long (Optional)
+ * output_tokens: Long (Optional)
+ * input_token_details (Optional): {
+ * cached_tokens: Long (Optional)
+ * text_tokens: Long (Optional)
+ * image_tokens: Long (Optional)
+ * audio_tokens: Long (Optional)
+ * cached_tokens_details (Optional): {
+ * text_tokens: Long (Optional)
+ * image_tokens: Long (Optional)
+ * audio_tokens: Long (Optional)
+ * }
+ * }
+ * output_token_details (Optional): {
+ * text_tokens: Long (Optional)
+ * audio_tokens: Long (Optional)
+ * }
+ * }
+ * output_modalities (Optional): [
+ * String(text/audio) (Optional)
+ * ]
+ * max_output_tokens: BinaryData (Optional)
+ * id: String (Required)
+ * output (Optional): [
+ * (Optional){
+ * type: String(function_call/function_call_output/mcp_approval_response/mcp_list_tools/mcp_call/mcp_approval_request/message) (Required)
+ * }
+ * ]
+ * conversation_id: String (Required)
+ * audio (Optional): {
+ * output (Optional): {
+ * voice: String (Optional)
+ * voice_type: String(openai/azure-standard/azure-custom/azure-personal/avatar-voice-sync/azure-realtime-native) (Optional)
+ * voice_locale: String (Optional)
+ * format (Optional): {
+ * type: String(audio/pcm/audio/pcmu/audio/pcma) (Required)
+ * }
+ * }
+ * }
+ * metadata (Optional): {
+ * String: String (Required)
+ * }
+ * temperature: Double (Optional)
+ * created_at: Long (Optional)
+ * completed_at: Long (Optional)
+ * }
+ * }
+ *
+ *
+ * @param agentName The name of the agent.
+ * @param conversationId The id of the conversation that contains the response.
+ * @param responseId The id of the response to retrieve.
+ * @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 voice agent conversation response
+ *
+ * Retrieves a single response from the specified conversation by its id, including its `output` items,
+ * `usage`, and status along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> getAgentConversationResponseWithResponse(String agentName, String conversationId,
+ String responseId, RequestOptions requestOptions) {
+ return this.serviceClient.getAgentConversationResponseWithResponseAsync(agentName, conversationId, responseId,
+ requestOptions);
+ }
+
+ /**
+ * List items produced by a voice agent conversation response
+ *
+ * Returns a paged collection of the output items produced by a specific response (the response's output
+ * projection). For the complete ordered conversation history — including user input and client-created
+ * tool outputs — use the conversation items route instead. Returns `404` when the conversation or
+ * response was not persisted (`store = false`).
+ * Query Parameters
+ *
+ * Query Parameters
+ * | Name | Type | Required | Description |
+ * | limit | Integer | No | A limit on the number of objects to be returned. Limit can range
+ * between 1 and 100, and the
+ * default is 20. |
+ * | order | String | No | Sort order by the `created_at` timestamp of the objects. `asc`
+ * for ascending order and`desc`
+ * for descending order. Allowed values: "asc", "desc". |
+ * | after | String | No | A cursor for use in pagination. `after` is an object ID that
+ * defines your place in the list.
+ * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your
+ * subsequent call can include after=obj_foo in order to fetch the next page of the list. |
+ * | before | String | No | A cursor for use in pagination. `before` is an object ID that
+ * defines your place in the list.
+ * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your
+ * subsequent call can include before=obj_foo in order to fetch the previous page of the list. |
+ *
+ * You can add these to a request with {@link RequestOptions#addQueryParam}
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * type: String(function_call/function_call_output/mcp_approval_response/mcp_list_tools/mcp_call/mcp_approval_request/message) (Required)
+ * }
+ * }
+ *
+ *
+ * @param agentName The name of the agent.
+ * @param conversationId The id of the conversation that contains the response.
+ * @param responseId The id of the response whose output items are listed.
+ * @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 the response data for a requested list of items as paginated response with {@link PagedFlux}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedFlux listAgentConversationResponseItems(String agentName, String conversationId,
+ String responseId, RequestOptions requestOptions) {
+ return this.serviceClient.listAgentConversationResponseItemsAsync(agentName, conversationId, responseId,
+ requestOptions);
+ }
+
+ /**
+ * List items in a voice agent conversation
+ *
+ * Returns a paged collection of items — the complete ordered conversation history, including user input,
+ * assistant output, and client-created tool outputs (transcripts + tool events). Returns `404` when the
+ * conversation was not persisted (`store = false`).
+ * Query Parameters
+ *
+ * Query Parameters
+ * | Name | Type | Required | Description |
+ * | limit | Integer | No | A limit on the number of objects to be returned. Limit can range
+ * between 1 and 100, and the
+ * default is 20. |
+ * | order | String | No | Sort order by the `created_at` timestamp of the objects. `asc`
+ * for ascending order and`desc`
+ * for descending order. Allowed values: "asc", "desc". |
+ * | after | String | No | A cursor for use in pagination. `after` is an object ID that
+ * defines your place in the list.
+ * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your
+ * subsequent call can include after=obj_foo in order to fetch the next page of the list. |
+ * | before | String | No | A cursor for use in pagination. `before` is an object ID that
+ * defines your place in the list.
+ * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your
+ * subsequent call can include before=obj_foo in order to fetch the previous page of the list. |
+ *
+ * You can add these to a request with {@link RequestOptions#addQueryParam}
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * type: String(function_call/function_call_output/mcp_approval_response/mcp_list_tools/mcp_call/mcp_approval_request/message) (Required)
+ * }
+ * }
+ *
+ *
+ * @param agentName The name of the agent.
+ * @param conversationId The id of the conversation whose items are listed.
+ * @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 the response data for a requested list of items as paginated response with {@link PagedFlux}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedFlux listAgentConversationItems(String agentName, String conversationId,
+ RequestOptions requestOptions) {
+ return this.serviceClient.listAgentConversationItemsAsync(agentName, conversationId, requestOptions);
+ }
+
+ /**
+ * Get a voice agent conversation item
+ *
+ * Retrieves a single item from the specified conversation by its id, including its transcript. An
+ * `input_audio`/`output_audio` content part indicates that audio is available for the item; the canonical per-item
+ * audio metadata is the `/items/{item_id}/audio` resource, and the bytes are streamed by
+ * `/items/{item_id}/audio/content`. Returns `404` when the conversation or item was not persisted
+ * (`store = false`).
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * type: String(function_call/function_call_output/mcp_approval_response/mcp_list_tools/mcp_call/mcp_approval_request/message) (Required)
+ * }
+ * }
+ *
+ *
+ * @param agentName The name of the agent.
+ * @param conversationId The id of the conversation that contains the item.
+ * @param itemId The id of the conversation item to retrieve.
+ * @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 voice agent conversation item
+ *
+ * Retrieves a single item from the specified conversation by its id, including its transcript along with
+ * {@link Response} on successful completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> getAgentConversationItemWithResponse(String agentName, String conversationId,
+ String itemId, RequestOptions requestOptions) {
+ return this.serviceClient.getAgentConversationItemWithResponseAsync(agentName, conversationId, itemId,
+ requestOptions);
+ }
+
+ /**
+ * Get a voice agent conversation item's audio metadata
+ *
+ * Returns metadata for a single conversation item's audio segment, including the common playback facts
+ * (role, format/codec, sample rate, channels, offset, duration) for both Foundry-managed and
+ * bring-your-own-storage (BYOS) recordings; for BYOS the response additionally includes `blob_uri`, the URI
+ * of the recording in the customer's own storage (no SAS) that the customer downloads with their own credentials.
+ * Requires the conversation to have persisted audio (`store = true`); returns `404` when the conversation,
+ * item, or its audio was not persisted.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * conversation_id: String (Required)
+ * item_id: String (Required)
+ * role: String(user/agent) (Optional)
+ * format: String(wav) (Optional)
+ * codec: String(pcm16/pcmu/pcma) (Optional)
+ * sample_rate: Integer (Optional)
+ * channels: Integer (Optional)
+ * start_offset_ms: Long (Optional)
+ * duration_ms: Long (Optional)
+ * blob_uri: String (Optional)
+ * }
+ * }
+ *
+ *
+ * @param agentName The name of the agent.
+ * @param conversationId The id of the conversation that contains the item.
+ * @param itemId The id of the conversation item whose audio metadata is retrieved.
+ * @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 voice agent conversation item's audio metadata
+ *
+ * Returns metadata for a single conversation item's audio segment, including the common playback facts
+ * (role, format/codec, sample rate, channels, offset, duration) for both Foundry-managed and
+ * bring-your-own-storage (BYOS) recordings; for BYOS the response additionally includes `blob_uri`, the URI
+ * of the recording in the customer's own storage (no SAS) that the customer downloads with their own credentials.
+ * Requires the conversation to have persisted audio (`store = true`); returns `404` when the conversation,
+ * item, or its audio was not persisted along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> getAgentConversationAudioItemWithResponse(String agentName, String conversationId,
+ String itemId, RequestOptions requestOptions) {
+ return this.serviceClient.getAgentConversationAudioItemWithResponseAsync(agentName, conversationId, itemId,
+ requestOptions);
+ }
+
+ /**
+ * Stream a voice agent conversation item's audio
+ *
+ * Streams a single conversation item's audio as a WAV (`audio/wav`) byte stream through the service (no SAS
+ * URL). This route serves Foundry-managed storage only. For bring-your-own-storage (BYOS) recordings the
+ * bytes are not proxied — the caller must download directly from customer storage using the `blob_uri`
+ * returned by the item's `/audio` metadata route — so this route returns `409 Conflict` for BYOS recordings.
+ * Returns `404` when the conversation, item, or its audio was not persisted (`store = false`).
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * BinaryData
+ * }
+ *
+ *
+ * @param agentName The name of the agent.
+ * @param conversationId The id of the conversation that contains the item.
+ * @param itemId The id of the conversation item whose audio is streamed.
+ * @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 the response body along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> downloadAgentConversationAudioItemWithResponse(String agentName,
+ String conversationId, String itemId, RequestOptions requestOptions) {
+ return this.serviceClient.downloadAgentConversationAudioItemWithResponseAsync(agentName, conversationId, itemId,
+ requestOptions);
+ }
+
+ /**
+ * Get a voice agent conversation item's generated audio metadata
+ *
+ * Returns metadata for a conversation item's generated audio. This subordinate artifact is separate from the
+ * canonical heard-audio segment and exists only when playback was interrupted and the service rendered more audio
+ * than the listener heard, including when the response ends as cancelled. Returns `404` when the conversation or
+ * item was not persisted, or when no generated audio exists beyond the heard segment.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * conversation_id: String (Required)
+ * item_id: String (Required)
+ * role: String(user/agent) (Optional)
+ * format: String(wav) (Optional)
+ * codec: String(pcm16/pcmu/pcma) (Optional)
+ * sample_rate: Integer (Optional)
+ * channels: Integer (Optional)
+ * start_offset_ms: Long (Optional)
+ * duration_ms: Long (Optional)
+ * blob_uri: String (Optional)
+ * }
+ * }
+ *
+ *
+ * @param agentName The name of the agent.
+ * @param conversationId The id of the conversation that contains the item.
+ * @param itemId The id of the conversation item whose generated audio metadata is retrieved.
+ * @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 voice agent conversation item's generated audio metadata
+ *
+ * Returns metadata for a conversation item's generated audio along with {@link Response} on successful completion
+ * of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> getAgentConversationGeneratedAudioItemWithResponse(String agentName,
+ String conversationId, String itemId, RequestOptions requestOptions) {
+ return this.serviceClient.getAgentConversationGeneratedAudioItemWithResponseAsync(agentName, conversationId,
+ itemId, requestOptions);
+ }
+
+ /**
+ * Stream a voice agent conversation item's generated audio
+ *
+ * Streams a conversation item's generated audio as a WAV (`audio/wav`) byte stream through the service. This
+ * subordinate artifact exists only when playback was interrupted and the service rendered more audio than the
+ * listener heard, including when the response ends as cancelled. This route serves Foundry-managed storage only.
+ * For bring-your-own-storage (BYOS) recordings the bytes are not proxied, so this route returns `409 Conflict`.
+ * Returns `404` when the conversation or item was not persisted, or when no generated audio exists beyond the
+ * heard segment.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * BinaryData
+ * }
+ *
+ *
+ * @param agentName The name of the agent.
+ * @param conversationId The id of the conversation that contains the item.
+ * @param itemId The id of the conversation item whose generated audio is streamed.
+ * @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 the response body along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> downloadAgentConversationGeneratedAudioItemWithResponse(String agentName,
+ String conversationId, String itemId, RequestOptions requestOptions) {
+ return this.serviceClient.downloadAgentConversationGeneratedAudioItemWithResponseAsync(agentName,
+ conversationId, itemId, requestOptions);
+ }
+
+ /**
+ * Get a voice agent conversation's merged recording metadata
+ *
+ * Returns metadata for the whole-call merged stereo recording (user audio on the left channel, agent audio
+ * on the right). The common metadata (format, sample rate, channels, channel layout, duration) is returned
+ * for both Foundry-managed and bring-your-own-storage (BYOS) recordings; for BYOS the response additionally
+ * includes `blob_uri`, the URI of the recording in the customer's own storage (no SAS) that the customer downloads
+ * with their own credentials. The recording is built once from the per-turn segments after persistence
+ * finalization succeeds. While the conversation is `in_progress`, this route returns retriable `409 Conflict`
+ * with `error.code = recording_not_ready` and a `Retry-After` header when retry guidance is available. When the
+ * conversation is `failed`, it returns terminal `409 Conflict` with `error.code = recording_unavailable`.
+ * For a `completed` conversation, metadata is available subject to the existing BYOS behavior. Requires the
+ * conversation to have persisted audio (`store = true`); otherwise returns `404`.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * conversation_id: String (Required)
+ * format: String(wav) (Required)
+ * sample_rate: int (Required)
+ * channels: int (Required)
+ * channel_layout (Required): {
+ * left: String (Required)
+ * right: String (Required)
+ * }
+ * duration_ms: long (Required)
+ * blob_uri: String (Optional)
+ * }
+ * }
+ *
+ *
+ * @param agentName The name of the agent.
+ * @param conversationId The id of the conversation whose merged recording metadata is retrieved.
+ * @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 voice agent conversation's merged recording metadata
+ *
+ * Returns metadata for the whole-call merged stereo recording (user audio on the left channel, agent audio
+ * on the right) along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> getAgentConversationAudioWithResponse(String agentName, String conversationId,
+ RequestOptions requestOptions) {
+ return this.serviceClient.getAgentConversationAudioWithResponseAsync(agentName, conversationId, requestOptions);
+ }
+
+ /**
+ * Stream a voice agent conversation's merged recording
+ *
+ * Streams the whole-call merged stereo recording as a WAV (`audio/wav`) byte stream through the service
+ * (no SAS URL). This route serves Foundry-managed storage only. For bring-your-own-storage (BYOS)
+ * recordings the bytes are not proxied — the caller must download directly from customer storage using the
+ * `blob_uri` returned by the metadata route — so this route returns `409 Conflict` for BYOS recordings.
+ * While the conversation is `in_progress`, this route returns retriable `409 Conflict` with
+ * `error.code = recording_not_ready` and a `Retry-After` header when retry guidance is available. When the
+ * conversation is `failed`, it returns terminal `409 Conflict` with `error.code = recording_unavailable`.
+ * For a `completed` conversation, content is available subject to the existing BYOS behavior. A conversation
+ * without persisted audio (`store = false`) returns `404`.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * BinaryData
+ * }
+ *
+ *
+ * @param agentName The name of the agent.
+ * @param conversationId The id of the conversation whose merged recording is streamed.
+ * @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 the response body along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> downloadAgentConversationAudioWithResponse(String agentName,
+ String conversationId, RequestOptions requestOptions) {
+ return this.serviceClient.downloadAgentConversationAudioWithResponseAsync(agentName, conversationId,
+ requestOptions);
+ }
+
+ /**
+ * List voice agent conversations
+ *
+ * Returns the conversations persisted for the specified voice agent endpoint.
+ * Conversations are present when the session's effective `store` setting is `true`, whether inherited from the
+ * agent definition or enabled by the WebSocket session override.
+ *
+ * @param agentName The name of the agent.
+ * @param limit A limit on the number of objects to be returned. Limit can range between 1 and 100, and the
+ * default is 20.
+ * @param order Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`
+ * for descending order.
+ * @param after A cursor for use in pagination. `after` is an object ID that defines your place in the list.
+ * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your
+ * subsequent call can include after=obj_foo in order to fetch the next page of the list.
+ * @param before A cursor for use in pagination. `before` is an object ID that defines your place in the list.
+ * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your
+ * subsequent call can include before=obj_foo in order to fetch the previous page of the list.
+ * @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 the response data for a requested list of items as paginated response with {@link PagedFlux}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedFlux listAgentConversations(String agentName, Integer limit, PageOrder order,
+ String after, String before) {
+ // Generated convenience method for listAgentConversations
+ RequestOptions requestOptions = new RequestOptions();
+ if (limit != null) {
+ requestOptions.addQueryParam("limit", String.valueOf(limit), false);
+ }
+ if (order != null) {
+ requestOptions.addQueryParam("order", order.toString(), false);
+ }
+ if (after != null) {
+ requestOptions.addQueryParam("after", after, false);
+ }
+ if (before != null) {
+ requestOptions.addQueryParam("before", before, false);
+ }
+ PagedFlux pagedFluxResponse = listAgentConversations(agentName, requestOptions);
+ return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> {
+ Flux> flux = (continuationTokenParam == null)
+ ? pagedFluxResponse.byPage().take(1)
+ : pagedFluxResponse.byPage(continuationTokenParam).take(1);
+ return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(),
+ pagedResponse.getStatusCode(), pagedResponse.getHeaders(),
+ pagedResponse.getValue()
+ .stream()
+ .map(protocolMethodData -> protocolMethodData.toObject(VoiceConversation.class))
+ .collect(Collectors.toList()),
+ pagedResponse.getContinuationToken(), null));
+ });
+ }
+
+ /**
+ * List voice agent conversations
+ *
+ * Returns the conversations persisted for the specified voice agent endpoint.
+ * Conversations are present when the session's effective `store` setting is `true`, whether inherited from the
+ * agent definition or enabled by the WebSocket session override.
+ *
+ * @param agentName The name of the agent.
+ * @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 the response data for a requested list of items as paginated response with {@link PagedFlux}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedFlux listAgentConversations(String agentName) {
+ // Generated convenience method for listAgentConversations
+ RequestOptions requestOptions = new RequestOptions();
+ PagedFlux pagedFluxResponse = listAgentConversations(agentName, requestOptions);
+ return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> {
+ Flux> flux = (continuationTokenParam == null)
+ ? pagedFluxResponse.byPage().take(1)
+ : pagedFluxResponse.byPage(continuationTokenParam).take(1);
+ return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(),
+ pagedResponse.getStatusCode(), pagedResponse.getHeaders(),
+ pagedResponse.getValue()
+ .stream()
+ .map(protocolMethodData -> protocolMethodData.toObject(VoiceConversation.class))
+ .collect(Collectors.toList()),
+ pagedResponse.getContinuationToken(), null));
+ });
+ }
+
+ /**
+ * Get a voice agent conversation
+ *
+ * Retrieves a single conversation recorded for the specified voice agent endpoint by its id.
+ * Returns `404` when the conversation was not persisted (`store = false`) or does not exist.
+ *
+ * @param agentName The name of the agent.
+ * @param conversationId The id of the conversation to retrieve.
+ * @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 voice agent conversation
+ *
+ * Retrieves a single conversation recorded for the specified voice agent endpoint by its id.
+ * Returns `404` when the conversation was not persisted (`store = false`) or does not exist on successful
+ * completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono getAgentConversation(String agentName, String conversationId) {
+ // Generated convenience method for getAgentConversationWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ return getAgentConversationWithResponse(agentName, conversationId, requestOptions).flatMap(FluxUtil::toMono)
+ .map(protocolMethodData -> protocolMethodData.toObject(VoiceConversation.class));
+ }
+
+ /**
+ * Delete a voice agent conversation
+ *
+ * Deletes a conversation and all of its stored data — responses, items, and any audio (cascade). This is
+ * the customer's explicit data-deletion control for voice conversations.
+ *
+ * @param agentName The name of the agent.
+ * @param conversationId The id of the conversation 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 {@link Mono} that completes when a successful response is received.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono deleteAgentConversation(String agentName, String conversationId) {
+ // Generated convenience method for deleteAgentConversationWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ return deleteAgentConversationWithResponse(agentName, conversationId, requestOptions).flatMap(FluxUtil::toMono);
+ }
+
+ /**
+ * List responses in a voice agent conversation
+ *
+ * Returns a paged collection of the responses (model inference turns) recorded for the specified
+ * conversation. The per-response `output` projection may be omitted here; use the response-items route
+ * for the canonical paged output. Returns `404` when the conversation was not persisted (`store = false`).
+ *
+ * @param agentName The name of the agent.
+ * @param conversationId The id of the conversation whose responses are listed.
+ * @param limit A limit on the number of objects to be returned. Limit can range between 1 and 100, and the
+ * default is 20.
+ * @param order Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`
+ * for descending order.
+ * @param after A cursor for use in pagination. `after` is an object ID that defines your place in the list.
+ * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your
+ * subsequent call can include after=obj_foo in order to fetch the next page of the list.
+ * @param before A cursor for use in pagination. `before` is an object ID that defines your place in the list.
+ * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your
+ * subsequent call can include before=obj_foo in order to fetch the previous page of the list.
+ * @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 the response data for a requested list of items as paginated response with {@link PagedFlux}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedFlux listAgentConversationResponses(String agentName, String conversationId,
+ Integer limit, PageOrder order, String after, String before) {
+ // Generated convenience method for listAgentConversationResponses
+ RequestOptions requestOptions = new RequestOptions();
+ if (limit != null) {
+ requestOptions.addQueryParam("limit", String.valueOf(limit), false);
+ }
+ if (order != null) {
+ requestOptions.addQueryParam("order", order.toString(), false);
+ }
+ if (after != null) {
+ requestOptions.addQueryParam("after", after, false);
+ }
+ if (before != null) {
+ requestOptions.addQueryParam("before", before, false);
+ }
+ PagedFlux pagedFluxResponse
+ = listAgentConversationResponses(agentName, conversationId, requestOptions);
+ return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> {
+ Flux> flux = (continuationTokenParam == null)
+ ? pagedFluxResponse.byPage().take(1)
+ : pagedFluxResponse.byPage(continuationTokenParam).take(1);
+ return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(),
+ pagedResponse.getStatusCode(), pagedResponse.getHeaders(),
+ pagedResponse.getValue()
+ .stream()
+ .map(protocolMethodData -> protocolMethodData.toObject(VoiceResponse.class))
+ .collect(Collectors.toList()),
+ pagedResponse.getContinuationToken(), null));
+ });
+ }
+
+ /**
+ * List responses in a voice agent conversation
+ *
+ * Returns a paged collection of the responses (model inference turns) recorded for the specified
+ * conversation. The per-response `output` projection may be omitted here; use the response-items route
+ * for the canonical paged output. Returns `404` when the conversation was not persisted (`store = false`).
+ *
+ * @param agentName The name of the agent.
+ * @param conversationId The id of the conversation whose responses are listed.
+ * @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 the response data for a requested list of items as paginated response with {@link PagedFlux}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedFlux listAgentConversationResponses(String agentName, String conversationId) {
+ // Generated convenience method for listAgentConversationResponses
+ RequestOptions requestOptions = new RequestOptions();
+ PagedFlux pagedFluxResponse
+ = listAgentConversationResponses(agentName, conversationId, requestOptions);
+ return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> {
+ Flux> flux = (continuationTokenParam == null)
+ ? pagedFluxResponse.byPage().take(1)
+ : pagedFluxResponse.byPage(continuationTokenParam).take(1);
+ return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(),
+ pagedResponse.getStatusCode(), pagedResponse.getHeaders(),
+ pagedResponse.getValue()
+ .stream()
+ .map(protocolMethodData -> protocolMethodData.toObject(VoiceResponse.class))
+ .collect(Collectors.toList()),
+ pagedResponse.getContinuationToken(), null));
+ });
+ }
+
+ /**
+ * Get a voice agent conversation response
+ *
+ * Retrieves a single response from the specified conversation by its id, including its `output` items,
+ * `usage`, and status. Returns `404` when the conversation or response was not persisted (`store = false`).
+ *
+ * @param agentName The name of the agent.
+ * @param conversationId The id of the conversation that contains the response.
+ * @param responseId The id of the response to retrieve.
+ * @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 voice agent conversation response
+ *
+ * Retrieves a single response from the specified conversation by its id, including its `output` items,
+ * `usage`, and status on successful completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono getAgentConversationResponse(String agentName, String conversationId,
+ String responseId) {
+ // Generated convenience method for getAgentConversationResponseWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ return getAgentConversationResponseWithResponse(agentName, conversationId, responseId, requestOptions)
+ .flatMap(FluxUtil::toMono)
+ .map(protocolMethodData -> protocolMethodData.toObject(VoiceResponse.class));
+ }
+
+ /**
+ * List items produced by a voice agent conversation response
+ *
+ * Returns a paged collection of the output items produced by a specific response (the response's output
+ * projection). For the complete ordered conversation history — including user input and client-created
+ * tool outputs — use the conversation items route instead. Returns `404` when the conversation or
+ * response was not persisted (`store = false`).
+ *
+ * @param agentName The name of the agent.
+ * @param conversationId The id of the conversation that contains the response.
+ * @param responseId The id of the response whose output items are listed.
+ * @param limit A limit on the number of objects to be returned. Limit can range between 1 and 100, and the
+ * default is 20.
+ * @param order Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`
+ * for descending order.
+ * @param after A cursor for use in pagination. `after` is an object ID that defines your place in the list.
+ * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your
+ * subsequent call can include after=obj_foo in order to fetch the next page of the list.
+ * @param before A cursor for use in pagination. `before` is an object ID that defines your place in the list.
+ * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your
+ * subsequent call can include before=obj_foo in order to fetch the previous page of the list.
+ * @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 the response data for a requested list of items as paginated response with {@link PagedFlux}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedFlux listAgentConversationResponseItems(String agentName,
+ String conversationId, String responseId, Integer limit, PageOrder order, String after, String before) {
+ // Generated convenience method for listAgentConversationResponseItems
+ RequestOptions requestOptions = new RequestOptions();
+ if (limit != null) {
+ requestOptions.addQueryParam("limit", String.valueOf(limit), false);
+ }
+ if (order != null) {
+ requestOptions.addQueryParam("order", order.toString(), false);
+ }
+ if (after != null) {
+ requestOptions.addQueryParam("after", after, false);
+ }
+ if (before != null) {
+ requestOptions.addQueryParam("before", before, false);
+ }
+ PagedFlux pagedFluxResponse
+ = listAgentConversationResponseItems(agentName, conversationId, responseId, requestOptions);
+ return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> {
+ Flux> flux = (continuationTokenParam == null)
+ ? pagedFluxResponse.byPage().take(1)
+ : pagedFluxResponse.byPage(continuationTokenParam).take(1);
+ return flux
+ .map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(),
+ pagedResponse.getStatusCode(), pagedResponse.getHeaders(),
+ pagedResponse.getValue()
+ .stream()
+ .map(protocolMethodData -> protocolMethodData.toObject(RealtimeConversationItem.class))
+ .collect(Collectors.toList()),
+ pagedResponse.getContinuationToken(), null));
+ });
+ }
+
+ /**
+ * List items produced by a voice agent conversation response
+ *
+ * Returns a paged collection of the output items produced by a specific response (the response's output
+ * projection). For the complete ordered conversation history — including user input and client-created
+ * tool outputs — use the conversation items route instead. Returns `404` when the conversation or
+ * response was not persisted (`store = false`).
+ *
+ * @param agentName The name of the agent.
+ * @param conversationId The id of the conversation that contains the response.
+ * @param responseId The id of the response whose output items are listed.
+ * @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 the response data for a requested list of items as paginated response with {@link PagedFlux}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedFlux listAgentConversationResponseItems(String agentName,
+ String conversationId, String responseId) {
+ // Generated convenience method for listAgentConversationResponseItems
+ RequestOptions requestOptions = new RequestOptions();
+ PagedFlux pagedFluxResponse
+ = listAgentConversationResponseItems(agentName, conversationId, responseId, requestOptions);
+ return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> {
+ Flux> flux = (continuationTokenParam == null)
+ ? pagedFluxResponse.byPage().take(1)
+ : pagedFluxResponse.byPage(continuationTokenParam).take(1);
+ return flux
+ .map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(),
+ pagedResponse.getStatusCode(), pagedResponse.getHeaders(),
+ pagedResponse.getValue()
+ .stream()
+ .map(protocolMethodData -> protocolMethodData.toObject(RealtimeConversationItem.class))
+ .collect(Collectors.toList()),
+ pagedResponse.getContinuationToken(), null));
+ });
+ }
+
+ /**
+ * List items in a voice agent conversation
+ *
+ * Returns a paged collection of items — the complete ordered conversation history, including user input,
+ * assistant output, and client-created tool outputs (transcripts + tool events). Returns `404` when the
+ * conversation was not persisted (`store = false`).
+ *
+ * @param agentName The name of the agent.
+ * @param conversationId The id of the conversation whose items are listed.
+ * @param limit A limit on the number of objects to be returned. Limit can range between 1 and 100, and the
+ * default is 20.
+ * @param order Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`
+ * for descending order.
+ * @param after A cursor for use in pagination. `after` is an object ID that defines your place in the list.
+ * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your
+ * subsequent call can include after=obj_foo in order to fetch the next page of the list.
+ * @param before A cursor for use in pagination. `before` is an object ID that defines your place in the list.
+ * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your
+ * subsequent call can include before=obj_foo in order to fetch the previous page of the list.
+ * @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 the response data for a requested list of items as paginated response with {@link PagedFlux}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedFlux listAgentConversationItems(String agentName, String conversationId,
+ Integer limit, PageOrder order, String after, String before) {
+ // Generated convenience method for listAgentConversationItems
+ RequestOptions requestOptions = new RequestOptions();
+ if (limit != null) {
+ requestOptions.addQueryParam("limit", String.valueOf(limit), false);
+ }
+ if (order != null) {
+ requestOptions.addQueryParam("order", order.toString(), false);
+ }
+ if (after != null) {
+ requestOptions.addQueryParam("after", after, false);
+ }
+ if (before != null) {
+ requestOptions.addQueryParam("before", before, false);
+ }
+ PagedFlux pagedFluxResponse = listAgentConversationItems(agentName, conversationId, requestOptions);
+ return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> {
+ Flux> flux = (continuationTokenParam == null)
+ ? pagedFluxResponse.byPage().take(1)
+ : pagedFluxResponse.byPage(continuationTokenParam).take(1);
+ return flux
+ .map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(),
+ pagedResponse.getStatusCode(), pagedResponse.getHeaders(),
+ pagedResponse.getValue()
+ .stream()
+ .map(protocolMethodData -> protocolMethodData.toObject(RealtimeConversationItem.class))
+ .collect(Collectors.toList()),
+ pagedResponse.getContinuationToken(), null));
+ });
+ }
+
+ /**
+ * List items in a voice agent conversation
+ *
+ * Returns a paged collection of items — the complete ordered conversation history, including user input,
+ * assistant output, and client-created tool outputs (transcripts + tool events). Returns `404` when the
+ * conversation was not persisted (`store = false`).
+ *
+ * @param agentName The name of the agent.
+ * @param conversationId The id of the conversation whose items are listed.
+ * @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 the response data for a requested list of items as paginated response with {@link PagedFlux}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedFlux listAgentConversationItems(String agentName, String conversationId) {
+ // Generated convenience method for listAgentConversationItems
+ RequestOptions requestOptions = new RequestOptions();
+ PagedFlux pagedFluxResponse = listAgentConversationItems(agentName, conversationId, requestOptions);
+ return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> {
+ Flux> flux = (continuationTokenParam == null)
+ ? pagedFluxResponse.byPage().take(1)
+ : pagedFluxResponse.byPage(continuationTokenParam).take(1);
+ return flux
+ .map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(),
+ pagedResponse.getStatusCode(), pagedResponse.getHeaders(),
+ pagedResponse.getValue()
+ .stream()
+ .map(protocolMethodData -> protocolMethodData.toObject(RealtimeConversationItem.class))
+ .collect(Collectors.toList()),
+ pagedResponse.getContinuationToken(), null));
+ });
+ }
+
+ /**
+ * Get a voice agent conversation item
+ *
+ * Retrieves a single item from the specified conversation by its id, including its transcript. An
+ * `input_audio`/`output_audio` content part indicates that audio is available for the item; the canonical per-item
+ * audio metadata is the `/items/{item_id}/audio` resource, and the bytes are streamed by
+ * `/items/{item_id}/audio/content`. Returns `404` when the conversation or item was not persisted
+ * (`store = false`).
+ *
+ * @param agentName The name of the agent.
+ * @param conversationId The id of the conversation that contains the item.
+ * @param itemId The id of the conversation item to retrieve.
+ * @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 voice agent conversation item
+ *
+ * Retrieves a single item from the specified conversation by its id, including its transcript on successful
+ * completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono getAgentConversationItem(String agentName, String conversationId,
+ String itemId) {
+ // Generated convenience method for getAgentConversationItemWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ return getAgentConversationItemWithResponse(agentName, conversationId, itemId, requestOptions)
+ .flatMap(FluxUtil::toMono)
+ .map(protocolMethodData -> protocolMethodData.toObject(RealtimeConversationItem.class));
+ }
+
+ /**
+ * Get a voice agent conversation item's audio metadata
+ *
+ * Returns metadata for a single conversation item's audio segment, including the common playback facts
+ * (role, format/codec, sample rate, channels, offset, duration) for both Foundry-managed and
+ * bring-your-own-storage (BYOS) recordings; for BYOS the response additionally includes `blob_uri`, the URI
+ * of the recording in the customer's own storage (no SAS) that the customer downloads with their own credentials.
+ * Requires the conversation to have persisted audio (`store = true`); returns `404` when the conversation,
+ * item, or its audio was not persisted.
+ *
+ * @param agentName The name of the agent.
+ * @param conversationId The id of the conversation that contains the item.
+ * @param itemId The id of the conversation item whose audio metadata is retrieved.
+ * @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 voice agent conversation item's audio metadata
+ *
+ * Returns metadata for a single conversation item's audio segment, including the common playback facts
+ * (role, format/codec, sample rate, channels, offset, duration) for both Foundry-managed and
+ * bring-your-own-storage (BYOS) recordings; for BYOS the response additionally includes `blob_uri`, the URI
+ * of the recording in the customer's own storage (no SAS) that the customer downloads with their own credentials.
+ * Requires the conversation to have persisted audio (`store = true`); returns `404` when the conversation,
+ * item, or its audio was not persisted on successful completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono getAgentConversationAudioItem(String agentName, String conversationId,
+ String itemId) {
+ // Generated convenience method for getAgentConversationAudioItemWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ return getAgentConversationAudioItemWithResponse(agentName, conversationId, itemId, requestOptions)
+ .flatMap(FluxUtil::toMono)
+ .map(protocolMethodData -> protocolMethodData.toObject(VoiceAudioItemResponse.class));
+ }
+
+ /**
+ * Stream a voice agent conversation item's audio
+ *
+ * Streams a single conversation item's audio as a WAV (`audio/wav`) byte stream through the service (no SAS
+ * URL). This route serves Foundry-managed storage only. For bring-your-own-storage (BYOS) recordings the
+ * bytes are not proxied — the caller must download directly from customer storage using the `blob_uri`
+ * returned by the item's `/audio` metadata route — so this route returns `409 Conflict` for BYOS recordings.
+ * Returns `404` when the conversation, item, or its audio was not persisted (`store = false`).
+ *
+ * @param agentName The name of the agent.
+ * @param conversationId The id of the conversation that contains the item.
+ * @param itemId The id of the conversation item whose audio is streamed.
+ * @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 the response body on successful completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono downloadAgentConversationAudioItem(String agentName, String conversationId, String itemId) {
+ // Generated convenience method for downloadAgentConversationAudioItemWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ return downloadAgentConversationAudioItemWithResponse(agentName, conversationId, itemId, requestOptions)
+ .flatMap(FluxUtil::toMono);
+ }
+
+ /**
+ * Get a voice agent conversation item's generated audio metadata
+ *
+ * Returns metadata for a conversation item's generated audio. This subordinate artifact is separate from the
+ * canonical heard-audio segment and exists only when playback was interrupted and the service rendered more audio
+ * than the listener heard, including when the response ends as cancelled. Returns `404` when the conversation or
+ * item was not persisted, or when no generated audio exists beyond the heard segment.
+ *
+ * @param agentName The name of the agent.
+ * @param conversationId The id of the conversation that contains the item.
+ * @param itemId The id of the conversation item whose generated audio metadata is retrieved.
+ * @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 voice agent conversation item's generated audio metadata
+ *
+ * Returns metadata for a conversation item's generated audio on successful completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono getAgentConversationGeneratedAudioItem(String agentName,
+ String conversationId, String itemId) {
+ // Generated convenience method for getAgentConversationGeneratedAudioItemWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ return getAgentConversationGeneratedAudioItemWithResponse(agentName, conversationId, itemId, requestOptions)
+ .flatMap(FluxUtil::toMono)
+ .map(protocolMethodData -> protocolMethodData.toObject(VoiceGeneratedAudioItemResponse.class));
+ }
+
+ /**
+ * Stream a voice agent conversation item's generated audio
+ *
+ * Streams a conversation item's generated audio as a WAV (`audio/wav`) byte stream through the service. This
+ * subordinate artifact exists only when playback was interrupted and the service rendered more audio than the
+ * listener heard, including when the response ends as cancelled. This route serves Foundry-managed storage only.
+ * For bring-your-own-storage (BYOS) recordings the bytes are not proxied, so this route returns `409 Conflict`.
+ * Returns `404` when the conversation or item was not persisted, or when no generated audio exists beyond the
+ * heard segment.
+ *
+ * @param agentName The name of the agent.
+ * @param conversationId The id of the conversation that contains the item.
+ * @param itemId The id of the conversation item whose generated audio is streamed.
+ * @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 the response body on successful completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono downloadAgentConversationGeneratedAudioItem(String agentName, String conversationId,
+ String itemId) {
+ // Generated convenience method for downloadAgentConversationGeneratedAudioItemWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ return downloadAgentConversationGeneratedAudioItemWithResponse(agentName, conversationId, itemId,
+ requestOptions).flatMap(FluxUtil::toMono);
+ }
+
+ /**
+ * Get a voice agent conversation's merged recording metadata
+ *
+ * Returns metadata for the whole-call merged stereo recording (user audio on the left channel, agent audio
+ * on the right). The common metadata (format, sample rate, channels, channel layout, duration) is returned
+ * for both Foundry-managed and bring-your-own-storage (BYOS) recordings; for BYOS the response additionally
+ * includes `blob_uri`, the URI of the recording in the customer's own storage (no SAS) that the customer downloads
+ * with their own credentials. The recording is built once from the per-turn segments after persistence
+ * finalization succeeds. While the conversation is `in_progress`, this route returns retriable `409 Conflict`
+ * with `error.code = recording_not_ready` and a `Retry-After` header when retry guidance is available. When the
+ * conversation is `failed`, it returns terminal `409 Conflict` with `error.code = recording_unavailable`.
+ * For a `completed` conversation, metadata is available subject to the existing BYOS behavior. Requires the
+ * conversation to have persisted audio (`store = true`); otherwise returns `404`.
+ *
+ * @param agentName The name of the agent.
+ * @param conversationId The id of the conversation whose merged recording metadata is retrieved.
+ * @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 voice agent conversation's merged recording metadata
+ *
+ * Returns metadata for the whole-call merged stereo recording (user audio on the left channel, agent audio
+ * on the right) on successful completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono getAgentConversationAudio(String agentName, String conversationId) {
+ // Generated convenience method for getAgentConversationAudioWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ return getAgentConversationAudioWithResponse(agentName, conversationId, requestOptions)
+ .flatMap(FluxUtil::toMono)
+ .map(protocolMethodData -> protocolMethodData.toObject(VoiceRecordingResponse.class));
+ }
+
+ /**
+ * Stream a voice agent conversation's merged recording
+ *
+ * Streams the whole-call merged stereo recording as a WAV (`audio/wav`) byte stream through the service
+ * (no SAS URL). This route serves Foundry-managed storage only. For bring-your-own-storage (BYOS)
+ * recordings the bytes are not proxied — the caller must download directly from customer storage using the
+ * `blob_uri` returned by the metadata route — so this route returns `409 Conflict` for BYOS recordings.
+ * While the conversation is `in_progress`, this route returns retriable `409 Conflict` with
+ * `error.code = recording_not_ready` and a `Retry-After` header when retry guidance is available. When the
+ * conversation is `failed`, it returns terminal `409 Conflict` with `error.code = recording_unavailable`.
+ * For a `completed` conversation, content is available subject to the existing BYOS behavior. A conversation
+ * without persisted audio (`store = false`) returns `404`.
+ *
+ * @param agentName The name of the agent.
+ * @param conversationId The id of the conversation whose merged recording is streamed.
+ * @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 the response body on successful completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono downloadAgentConversationAudio(String agentName, String conversationId) {
+ // Generated convenience method for downloadAgentConversationAudioWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ return downloadAgentConversationAudioWithResponse(agentName, conversationId, requestOptions)
+ .flatMap(FluxUtil::toMono);
+ }
+}
diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/BetaVoiceAgentsConversationsClient.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/BetaVoiceAgentsConversationsClient.java
new file mode 100644
index 0000000000000..440a0d52938de
--- /dev/null
+++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/BetaVoiceAgentsConversationsClient.java
@@ -0,0 +1,1451 @@
+// 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;
+
+import com.azure.ai.agents.implementation.BetaVoiceAgentsConversationsImpl;
+import com.azure.ai.agents.implementation.utils.Beta;
+import com.azure.ai.agents.models.PageOrder;
+import com.azure.ai.agents.models.RealtimeConversationItem;
+import com.azure.ai.agents.models.VoiceAudioItemResponse;
+import com.azure.ai.agents.models.VoiceConversation;
+import com.azure.ai.agents.models.VoiceGeneratedAudioItemResponse;
+import com.azure.ai.agents.models.VoiceRecordingResponse;
+import com.azure.ai.agents.models.VoiceResponse;
+import com.azure.core.annotation.Generated;
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceClient;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.exception.ClientAuthenticationException;
+import com.azure.core.exception.HttpResponseException;
+import com.azure.core.exception.ResourceModifiedException;
+import com.azure.core.exception.ResourceNotFoundException;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.RequestOptions;
+import com.azure.core.http.rest.Response;
+import com.azure.core.util.BinaryData;
+
+/**
+ * Initializes a new instance of the synchronous AgentsClient type.
+ */
+@ServiceClient(builder = AgentsClientBuilder.class)
+@Beta(warningText = "This class is in preview and may change in future releases.")
+public final class BetaVoiceAgentsConversationsClient {
+
+ @Generated
+ private final BetaVoiceAgentsConversationsImpl serviceClient;
+
+ /**
+ * Initializes an instance of BetaVoiceAgentsConversationsClient class.
+ *
+ * @param serviceClient the service client implementation.
+ */
+ @Generated
+ BetaVoiceAgentsConversationsClient(BetaVoiceAgentsConversationsImpl serviceClient) {
+ this.serviceClient = serviceClient;
+ }
+
+ /**
+ * List voice agent conversations
+ *
+ * Returns the conversations persisted for the specified voice agent endpoint.
+ * Conversations are present when the session's effective `store` setting is `true`, whether inherited from the
+ * agent definition or enabled by the WebSocket session override.
+ * Query Parameters
+ *
+ * Query Parameters
+ * | Name | Type | Required | Description |
+ * | limit | Integer | No | A limit on the number of objects to be returned. Limit can range
+ * between 1 and 100, and the
+ * default is 20. |
+ * | order | String | No | Sort order by the `created_at` timestamp of the objects. `asc`
+ * for ascending order and`desc`
+ * for descending order. Allowed values: "asc", "desc". |
+ * | after | String | No | A cursor for use in pagination. `after` is an object ID that
+ * defines your place in the list.
+ * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your
+ * subsequent call can include after=obj_foo in order to fetch the next page of the list. |
+ * | before | String | No | A cursor for use in pagination. `before` is an object ID that
+ * defines your place in the list.
+ * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your
+ * subsequent call can include before=obj_foo in order to fetch the previous page of the list. |
+ *
+ * You can add these to a request with {@link RequestOptions#addQueryParam}
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * id: String (Required)
+ * object: String (Required)
+ * status: String(in_progress/completed/failed) (Required)
+ * created_at: long (Required)
+ * completed_at: Long (Optional)
+ * metadata (Optional): {
+ * String: String (Required)
+ * }
+ * usage (Optional): {
+ * total_tokens: Long (Optional)
+ * input_tokens: Long (Optional)
+ * output_tokens: Long (Optional)
+ * input_token_details (Optional): {
+ * cached_tokens: Long (Optional)
+ * text_tokens: Long (Optional)
+ * image_tokens: Long (Optional)
+ * audio_tokens: Long (Optional)
+ * cached_tokens_details (Optional): {
+ * text_tokens: Long (Optional)
+ * image_tokens: Long (Optional)
+ * audio_tokens: Long (Optional)
+ * }
+ * }
+ * output_token_details (Optional): {
+ * text_tokens: Long (Optional)
+ * audio_tokens: Long (Optional)
+ * }
+ * }
+ * last_error (Optional): {
+ * code: String (Required)
+ * message: String (Required)
+ * param: String (Optional)
+ * type: String (Optional)
+ * details (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * additionalInfo (Optional): {
+ * String: BinaryData (Required)
+ * }
+ * debugInfo (Optional): {
+ * String: BinaryData (Required)
+ * }
+ * }
+ * }
+ * }
+ *
+ *
+ * @param agentName The name of the agent.
+ * @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 the response data for a requested list of items as paginated response with {@link PagedIterable}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listAgentConversations(String agentName, RequestOptions requestOptions) {
+ return this.serviceClient.listAgentConversations(agentName, requestOptions);
+ }
+
+ /**
+ * Get a voice agent conversation
+ *
+ * Retrieves a single conversation recorded for the specified voice agent endpoint by its id.
+ * Returns `404` when the conversation was not persisted (`store = false`) or does not exist.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * id: String (Required)
+ * object: String (Required)
+ * status: String(in_progress/completed/failed) (Required)
+ * created_at: long (Required)
+ * completed_at: Long (Optional)
+ * metadata (Optional): {
+ * String: String (Required)
+ * }
+ * usage (Optional): {
+ * total_tokens: Long (Optional)
+ * input_tokens: Long (Optional)
+ * output_tokens: Long (Optional)
+ * input_token_details (Optional): {
+ * cached_tokens: Long (Optional)
+ * text_tokens: Long (Optional)
+ * image_tokens: Long (Optional)
+ * audio_tokens: Long (Optional)
+ * cached_tokens_details (Optional): {
+ * text_tokens: Long (Optional)
+ * image_tokens: Long (Optional)
+ * audio_tokens: Long (Optional)
+ * }
+ * }
+ * output_token_details (Optional): {
+ * text_tokens: Long (Optional)
+ * audio_tokens: Long (Optional)
+ * }
+ * }
+ * last_error (Optional): {
+ * code: String (Required)
+ * message: String (Required)
+ * param: String (Optional)
+ * type: String (Optional)
+ * details (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * additionalInfo (Optional): {
+ * String: BinaryData (Required)
+ * }
+ * debugInfo (Optional): {
+ * String: BinaryData (Required)
+ * }
+ * }
+ * }
+ * }
+ *
+ *
+ * @param agentName The name of the agent.
+ * @param conversationId The id of the conversation to retrieve.
+ * @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 voice agent conversation
+ *
+ * Retrieves a single conversation recorded for the specified voice agent endpoint by its id.
+ * Returns `404` when the conversation was not persisted (`store = false`) or does not exist along with
+ * {@link Response}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response getAgentConversationWithResponse(String agentName, String conversationId,
+ RequestOptions requestOptions) {
+ return this.serviceClient.getAgentConversationWithResponse(agentName, conversationId, requestOptions);
+ }
+
+ /**
+ * Delete a voice agent conversation
+ *
+ * Deletes a conversation and all of its stored data — responses, items, and any audio (cascade). This is
+ * the customer's explicit data-deletion control for voice conversations.
+ *
+ * @param agentName The name of the agent.
+ * @param conversationId The id of the conversation 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 the {@link Response}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response deleteAgentConversationWithResponse(String agentName, String conversationId,
+ RequestOptions requestOptions) {
+ return this.serviceClient.deleteAgentConversationWithResponse(agentName, conversationId, requestOptions);
+ }
+
+ /**
+ * List responses in a voice agent conversation
+ *
+ * Returns a paged collection of the responses (model inference turns) recorded for the specified
+ * conversation. The per-response `output` projection may be omitted here; use the response-items route
+ * for the canonical paged output. Returns `404` when the conversation was not persisted (`store = false`).
+ * Query Parameters
+ *
+ * Query Parameters
+ * | Name | Type | Required | Description |
+ * | limit | Integer | No | A limit on the number of objects to be returned. Limit can range
+ * between 1 and 100, and the
+ * default is 20. |
+ * | order | String | No | Sort order by the `created_at` timestamp of the objects. `asc`
+ * for ascending order and`desc`
+ * for descending order. Allowed values: "asc", "desc". |
+ * | after | String | No | A cursor for use in pagination. `after` is an object ID that
+ * defines your place in the list.
+ * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your
+ * subsequent call can include after=obj_foo in order to fetch the next page of the list. |
+ * | before | String | No | A cursor for use in pagination. `before` is an object ID that
+ * defines your place in the list.
+ * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your
+ * subsequent call can include before=obj_foo in order to fetch the previous page of the list. |
+ *
+ * You can add these to a request with {@link RequestOptions#addQueryParam}
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * object: String(realtime.response) (Optional)
+ * status: String(completed/cancelled/failed/incomplete/in_progress) (Optional)
+ * status_details (Optional): {
+ * type: String(completed/cancelled/failed/incomplete) (Optional)
+ * reason: String(turn_detected/client_cancelled/max_output_tokens/content_filter) (Optional)
+ * error (Optional): {
+ * type: String (Optional)
+ * code: String (Optional)
+ * }
+ * }
+ * usage (Optional): {
+ * total_tokens: Long (Optional)
+ * input_tokens: Long (Optional)
+ * output_tokens: Long (Optional)
+ * input_token_details (Optional): {
+ * cached_tokens: Long (Optional)
+ * text_tokens: Long (Optional)
+ * image_tokens: Long (Optional)
+ * audio_tokens: Long (Optional)
+ * cached_tokens_details (Optional): {
+ * text_tokens: Long (Optional)
+ * image_tokens: Long (Optional)
+ * audio_tokens: Long (Optional)
+ * }
+ * }
+ * output_token_details (Optional): {
+ * text_tokens: Long (Optional)
+ * audio_tokens: Long (Optional)
+ * }
+ * }
+ * output_modalities (Optional): [
+ * String(text/audio) (Optional)
+ * ]
+ * max_output_tokens: BinaryData (Optional)
+ * id: String (Required)
+ * output (Optional): [
+ * (Optional){
+ * type: String(function_call/function_call_output/mcp_approval_response/mcp_list_tools/mcp_call/mcp_approval_request/message) (Required)
+ * }
+ * ]
+ * conversation_id: String (Required)
+ * audio (Optional): {
+ * output (Optional): {
+ * voice: String (Optional)
+ * voice_type: String(openai/azure-standard/azure-custom/azure-personal/avatar-voice-sync/azure-realtime-native) (Optional)
+ * voice_locale: String (Optional)
+ * format (Optional): {
+ * type: String(audio/pcm/audio/pcmu/audio/pcma) (Required)
+ * }
+ * }
+ * }
+ * metadata (Optional): {
+ * String: String (Required)
+ * }
+ * temperature: Double (Optional)
+ * created_at: Long (Optional)
+ * completed_at: Long (Optional)
+ * }
+ * }
+ *
+ *
+ * @param agentName The name of the agent.
+ * @param conversationId The id of the conversation whose responses are listed.
+ * @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 the response data for a requested list of items as paginated response with {@link PagedIterable}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listAgentConversationResponses(String agentName, String conversationId,
+ RequestOptions requestOptions) {
+ return this.serviceClient.listAgentConversationResponses(agentName, conversationId, requestOptions);
+ }
+
+ /**
+ * Get a voice agent conversation response
+ *
+ * Retrieves a single response from the specified conversation by its id, including its `output` items,
+ * `usage`, and status. Returns `404` when the conversation or response was not persisted (`store = false`).
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * object: String(realtime.response) (Optional)
+ * status: String(completed/cancelled/failed/incomplete/in_progress) (Optional)
+ * status_details (Optional): {
+ * type: String(completed/cancelled/failed/incomplete) (Optional)
+ * reason: String(turn_detected/client_cancelled/max_output_tokens/content_filter) (Optional)
+ * error (Optional): {
+ * type: String (Optional)
+ * code: String (Optional)
+ * }
+ * }
+ * usage (Optional): {
+ * total_tokens: Long (Optional)
+ * input_tokens: Long (Optional)
+ * output_tokens: Long (Optional)
+ * input_token_details (Optional): {
+ * cached_tokens: Long (Optional)
+ * text_tokens: Long (Optional)
+ * image_tokens: Long (Optional)
+ * audio_tokens: Long (Optional)
+ * cached_tokens_details (Optional): {
+ * text_tokens: Long (Optional)
+ * image_tokens: Long (Optional)
+ * audio_tokens: Long (Optional)
+ * }
+ * }
+ * output_token_details (Optional): {
+ * text_tokens: Long (Optional)
+ * audio_tokens: Long (Optional)
+ * }
+ * }
+ * output_modalities (Optional): [
+ * String(text/audio) (Optional)
+ * ]
+ * max_output_tokens: BinaryData (Optional)
+ * id: String (Required)
+ * output (Optional): [
+ * (Optional){
+ * type: String(function_call/function_call_output/mcp_approval_response/mcp_list_tools/mcp_call/mcp_approval_request/message) (Required)
+ * }
+ * ]
+ * conversation_id: String (Required)
+ * audio (Optional): {
+ * output (Optional): {
+ * voice: String (Optional)
+ * voice_type: String(openai/azure-standard/azure-custom/azure-personal/avatar-voice-sync/azure-realtime-native) (Optional)
+ * voice_locale: String (Optional)
+ * format (Optional): {
+ * type: String(audio/pcm/audio/pcmu/audio/pcma) (Required)
+ * }
+ * }
+ * }
+ * metadata (Optional): {
+ * String: String (Required)
+ * }
+ * temperature: Double (Optional)
+ * created_at: Long (Optional)
+ * completed_at: Long (Optional)
+ * }
+ * }
+ *
+ *
+ * @param agentName The name of the agent.
+ * @param conversationId The id of the conversation that contains the response.
+ * @param responseId The id of the response to retrieve.
+ * @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 voice agent conversation response
+ *
+ * Retrieves a single response from the specified conversation by its id, including its `output` items,
+ * `usage`, and status along with {@link Response}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response getAgentConversationResponseWithResponse(String agentName, String conversationId,
+ String responseId, RequestOptions requestOptions) {
+ return this.serviceClient.getAgentConversationResponseWithResponse(agentName, conversationId, responseId,
+ requestOptions);
+ }
+
+ /**
+ * List items produced by a voice agent conversation response
+ *
+ * Returns a paged collection of the output items produced by a specific response (the response's output
+ * projection). For the complete ordered conversation history — including user input and client-created
+ * tool outputs — use the conversation items route instead. Returns `404` when the conversation or
+ * response was not persisted (`store = false`).
+ * Query Parameters
+ *
+ * Query Parameters
+ * | Name | Type | Required | Description |
+ * | limit | Integer | No | A limit on the number of objects to be returned. Limit can range
+ * between 1 and 100, and the
+ * default is 20. |
+ * | order | String | No | Sort order by the `created_at` timestamp of the objects. `asc`
+ * for ascending order and`desc`
+ * for descending order. Allowed values: "asc", "desc". |
+ * | after | String | No | A cursor for use in pagination. `after` is an object ID that
+ * defines your place in the list.
+ * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your
+ * subsequent call can include after=obj_foo in order to fetch the next page of the list. |
+ * | before | String | No | A cursor for use in pagination. `before` is an object ID that
+ * defines your place in the list.
+ * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your
+ * subsequent call can include before=obj_foo in order to fetch the previous page of the list. |
+ *
+ * You can add these to a request with {@link RequestOptions#addQueryParam}
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * type: String(function_call/function_call_output/mcp_approval_response/mcp_list_tools/mcp_call/mcp_approval_request/message) (Required)
+ * }
+ * }
+ *
+ *
+ * @param agentName The name of the agent.
+ * @param conversationId The id of the conversation that contains the response.
+ * @param responseId The id of the response whose output items are listed.
+ * @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 the response data for a requested list of items as paginated response with {@link PagedIterable}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listAgentConversationResponseItems(String agentName, String conversationId,
+ String responseId, RequestOptions requestOptions) {
+ return this.serviceClient.listAgentConversationResponseItems(agentName, conversationId, responseId,
+ requestOptions);
+ }
+
+ /**
+ * List items in a voice agent conversation
+ *
+ * Returns a paged collection of items — the complete ordered conversation history, including user input,
+ * assistant output, and client-created tool outputs (transcripts + tool events). Returns `404` when the
+ * conversation was not persisted (`store = false`).
+ * Query Parameters
+ *
+ * Query Parameters
+ * | Name | Type | Required | Description |
+ * | limit | Integer | No | A limit on the number of objects to be returned. Limit can range
+ * between 1 and 100, and the
+ * default is 20. |
+ * | order | String | No | Sort order by the `created_at` timestamp of the objects. `asc`
+ * for ascending order and`desc`
+ * for descending order. Allowed values: "asc", "desc". |
+ * | after | String | No | A cursor for use in pagination. `after` is an object ID that
+ * defines your place in the list.
+ * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your
+ * subsequent call can include after=obj_foo in order to fetch the next page of the list. |
+ * | before | String | No | A cursor for use in pagination. `before` is an object ID that
+ * defines your place in the list.
+ * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your
+ * subsequent call can include before=obj_foo in order to fetch the previous page of the list. |
+ *
+ * You can add these to a request with {@link RequestOptions#addQueryParam}
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * type: String(function_call/function_call_output/mcp_approval_response/mcp_list_tools/mcp_call/mcp_approval_request/message) (Required)
+ * }
+ * }
+ *
+ *
+ * @param agentName The name of the agent.
+ * @param conversationId The id of the conversation whose items are listed.
+ * @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 the response data for a requested list of items as paginated response with {@link PagedIterable}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listAgentConversationItems(String agentName, String conversationId,
+ RequestOptions requestOptions) {
+ return this.serviceClient.listAgentConversationItems(agentName, conversationId, requestOptions);
+ }
+
+ /**
+ * Get a voice agent conversation item
+ *
+ * Retrieves a single item from the specified conversation by its id, including its transcript. An
+ * `input_audio`/`output_audio` content part indicates that audio is available for the item; the canonical per-item
+ * audio metadata is the `/items/{item_id}/audio` resource, and the bytes are streamed by
+ * `/items/{item_id}/audio/content`. Returns `404` when the conversation or item was not persisted
+ * (`store = false`).
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * type: String(function_call/function_call_output/mcp_approval_response/mcp_list_tools/mcp_call/mcp_approval_request/message) (Required)
+ * }
+ * }
+ *
+ *
+ * @param agentName The name of the agent.
+ * @param conversationId The id of the conversation that contains the item.
+ * @param itemId The id of the conversation item to retrieve.
+ * @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 voice agent conversation item
+ *
+ * Retrieves a single item from the specified conversation by its id, including its transcript along with
+ * {@link Response}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response getAgentConversationItemWithResponse(String agentName, String conversationId,
+ String itemId, RequestOptions requestOptions) {
+ return this.serviceClient.getAgentConversationItemWithResponse(agentName, conversationId, itemId,
+ requestOptions);
+ }
+
+ /**
+ * Get a voice agent conversation item's audio metadata
+ *
+ * Returns metadata for a single conversation item's audio segment, including the common playback facts
+ * (role, format/codec, sample rate, channels, offset, duration) for both Foundry-managed and
+ * bring-your-own-storage (BYOS) recordings; for BYOS the response additionally includes `blob_uri`, the URI
+ * of the recording in the customer's own storage (no SAS) that the customer downloads with their own credentials.
+ * Requires the conversation to have persisted audio (`store = true`); returns `404` when the conversation,
+ * item, or its audio was not persisted.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * conversation_id: String (Required)
+ * item_id: String (Required)
+ * role: String(user/agent) (Optional)
+ * format: String(wav) (Optional)
+ * codec: String(pcm16/pcmu/pcma) (Optional)
+ * sample_rate: Integer (Optional)
+ * channels: Integer (Optional)
+ * start_offset_ms: Long (Optional)
+ * duration_ms: Long (Optional)
+ * blob_uri: String (Optional)
+ * }
+ * }
+ *
+ *
+ * @param agentName The name of the agent.
+ * @param conversationId The id of the conversation that contains the item.
+ * @param itemId The id of the conversation item whose audio metadata is retrieved.
+ * @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 voice agent conversation item's audio metadata
+ *
+ * Returns metadata for a single conversation item's audio segment, including the common playback facts
+ * (role, format/codec, sample rate, channels, offset, duration) for both Foundry-managed and
+ * bring-your-own-storage (BYOS) recordings; for BYOS the response additionally includes `blob_uri`, the URI
+ * of the recording in the customer's own storage (no SAS) that the customer downloads with their own credentials.
+ * Requires the conversation to have persisted audio (`store = true`); returns `404` when the conversation,
+ * item, or its audio was not persisted along with {@link Response}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response getAgentConversationAudioItemWithResponse(String agentName, String conversationId,
+ String itemId, RequestOptions requestOptions) {
+ return this.serviceClient.getAgentConversationAudioItemWithResponse(agentName, conversationId, itemId,
+ requestOptions);
+ }
+
+ /**
+ * Stream a voice agent conversation item's audio
+ *
+ * Streams a single conversation item's audio as a WAV (`audio/wav`) byte stream through the service (no SAS
+ * URL). This route serves Foundry-managed storage only. For bring-your-own-storage (BYOS) recordings the
+ * bytes are not proxied — the caller must download directly from customer storage using the `blob_uri`
+ * returned by the item's `/audio` metadata route — so this route returns `409 Conflict` for BYOS recordings.
+ * Returns `404` when the conversation, item, or its audio was not persisted (`store = false`).
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * BinaryData
+ * }
+ *
+ *
+ * @param agentName The name of the agent.
+ * @param conversationId The id of the conversation that contains the item.
+ * @param itemId The id of the conversation item whose audio is streamed.
+ * @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 the response body along with {@link Response}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response downloadAgentConversationAudioItemWithResponse(String agentName, String conversationId,
+ String itemId, RequestOptions requestOptions) {
+ return this.serviceClient.downloadAgentConversationAudioItemWithResponse(agentName, conversationId, itemId,
+ requestOptions);
+ }
+
+ /**
+ * Get a voice agent conversation item's generated audio metadata
+ *
+ * Returns metadata for a conversation item's generated audio. This subordinate artifact is separate from the
+ * canonical heard-audio segment and exists only when playback was interrupted and the service rendered more audio
+ * than the listener heard, including when the response ends as cancelled. Returns `404` when the conversation or
+ * item was not persisted, or when no generated audio exists beyond the heard segment.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * conversation_id: String (Required)
+ * item_id: String (Required)
+ * role: String(user/agent) (Optional)
+ * format: String(wav) (Optional)
+ * codec: String(pcm16/pcmu/pcma) (Optional)
+ * sample_rate: Integer (Optional)
+ * channels: Integer (Optional)
+ * start_offset_ms: Long (Optional)
+ * duration_ms: Long (Optional)
+ * blob_uri: String (Optional)
+ * }
+ * }
+ *
+ *
+ * @param agentName The name of the agent.
+ * @param conversationId The id of the conversation that contains the item.
+ * @param itemId The id of the conversation item whose generated audio metadata is retrieved.
+ * @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 voice agent conversation item's generated audio metadata
+ *
+ * Returns metadata for a conversation item's generated audio along with {@link Response}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response getAgentConversationGeneratedAudioItemWithResponse(String agentName,
+ String conversationId, String itemId, RequestOptions requestOptions) {
+ return this.serviceClient.getAgentConversationGeneratedAudioItemWithResponse(agentName, conversationId, itemId,
+ requestOptions);
+ }
+
+ /**
+ * Stream a voice agent conversation item's generated audio
+ *
+ * Streams a conversation item's generated audio as a WAV (`audio/wav`) byte stream through the service. This
+ * subordinate artifact exists only when playback was interrupted and the service rendered more audio than the
+ * listener heard, including when the response ends as cancelled. This route serves Foundry-managed storage only.
+ * For bring-your-own-storage (BYOS) recordings the bytes are not proxied, so this route returns `409 Conflict`.
+ * Returns `404` when the conversation or item was not persisted, or when no generated audio exists beyond the
+ * heard segment.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * BinaryData
+ * }
+ *
+ *
+ * @param agentName The name of the agent.
+ * @param conversationId The id of the conversation that contains the item.
+ * @param itemId The id of the conversation item whose generated audio is streamed.
+ * @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 the response body along with {@link Response}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response downloadAgentConversationGeneratedAudioItemWithResponse(String agentName,
+ String conversationId, String itemId, RequestOptions requestOptions) {
+ return this.serviceClient.downloadAgentConversationGeneratedAudioItemWithResponse(agentName, conversationId,
+ itemId, requestOptions);
+ }
+
+ /**
+ * Get a voice agent conversation's merged recording metadata
+ *
+ * Returns metadata for the whole-call merged stereo recording (user audio on the left channel, agent audio
+ * on the right). The common metadata (format, sample rate, channels, channel layout, duration) is returned
+ * for both Foundry-managed and bring-your-own-storage (BYOS) recordings; for BYOS the response additionally
+ * includes `blob_uri`, the URI of the recording in the customer's own storage (no SAS) that the customer downloads
+ * with their own credentials. The recording is built once from the per-turn segments after persistence
+ * finalization succeeds. While the conversation is `in_progress`, this route returns retriable `409 Conflict`
+ * with `error.code = recording_not_ready` and a `Retry-After` header when retry guidance is available. When the
+ * conversation is `failed`, it returns terminal `409 Conflict` with `error.code = recording_unavailable`.
+ * For a `completed` conversation, metadata is available subject to the existing BYOS behavior. Requires the
+ * conversation to have persisted audio (`store = true`); otherwise returns `404`.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * conversation_id: String (Required)
+ * format: String(wav) (Required)
+ * sample_rate: int (Required)
+ * channels: int (Required)
+ * channel_layout (Required): {
+ * left: String (Required)
+ * right: String (Required)
+ * }
+ * duration_ms: long (Required)
+ * blob_uri: String (Optional)
+ * }
+ * }
+ *
+ *
+ * @param agentName The name of the agent.
+ * @param conversationId The id of the conversation whose merged recording metadata is retrieved.
+ * @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 voice agent conversation's merged recording metadata
+ *
+ * Returns metadata for the whole-call merged stereo recording (user audio on the left channel, agent audio
+ * on the right) along with {@link Response}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response getAgentConversationAudioWithResponse(String agentName, String conversationId,
+ RequestOptions requestOptions) {
+ return this.serviceClient.getAgentConversationAudioWithResponse(agentName, conversationId, requestOptions);
+ }
+
+ /**
+ * Stream a voice agent conversation's merged recording
+ *
+ * Streams the whole-call merged stereo recording as a WAV (`audio/wav`) byte stream through the service
+ * (no SAS URL). This route serves Foundry-managed storage only. For bring-your-own-storage (BYOS)
+ * recordings the bytes are not proxied — the caller must download directly from customer storage using the
+ * `blob_uri` returned by the metadata route — so this route returns `409 Conflict` for BYOS recordings.
+ * While the conversation is `in_progress`, this route returns retriable `409 Conflict` with
+ * `error.code = recording_not_ready` and a `Retry-After` header when retry guidance is available. When the
+ * conversation is `failed`, it returns terminal `409 Conflict` with `error.code = recording_unavailable`.
+ * For a `completed` conversation, content is available subject to the existing BYOS behavior. A conversation
+ * without persisted audio (`store = false`) returns `404`.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * BinaryData
+ * }
+ *
+ *
+ * @param agentName The name of the agent.
+ * @param conversationId The id of the conversation whose merged recording is streamed.
+ * @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 the response body along with {@link Response}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response downloadAgentConversationAudioWithResponse(String agentName, String conversationId,
+ RequestOptions requestOptions) {
+ return this.serviceClient.downloadAgentConversationAudioWithResponse(agentName, conversationId, requestOptions);
+ }
+
+ /**
+ * List voice agent conversations
+ *
+ * Returns the conversations persisted for the specified voice agent endpoint.
+ * Conversations are present when the session's effective `store` setting is `true`, whether inherited from the
+ * agent definition or enabled by the WebSocket session override.
+ *
+ * @param agentName The name of the agent.
+ * @param limit A limit on the number of objects to be returned. Limit can range between 1 and 100, and the
+ * default is 20.
+ * @param order Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`
+ * for descending order.
+ * @param after A cursor for use in pagination. `after` is an object ID that defines your place in the list.
+ * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your
+ * subsequent call can include after=obj_foo in order to fetch the next page of the list.
+ * @param before A cursor for use in pagination. `before` is an object ID that defines your place in the list.
+ * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your
+ * subsequent call can include before=obj_foo in order to fetch the previous page of the list.
+ * @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 the response data for a requested list of items as paginated response with {@link PagedIterable}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listAgentConversations(String agentName, Integer limit, PageOrder order,
+ String after, String before) {
+ // Generated convenience method for listAgentConversations
+ RequestOptions requestOptions = new RequestOptions();
+ if (limit != null) {
+ requestOptions.addQueryParam("limit", String.valueOf(limit), false);
+ }
+ if (order != null) {
+ requestOptions.addQueryParam("order", order.toString(), false);
+ }
+ if (after != null) {
+ requestOptions.addQueryParam("after", after, false);
+ }
+ if (before != null) {
+ requestOptions.addQueryParam("before", before, false);
+ }
+ return serviceClient.listAgentConversations(agentName, requestOptions)
+ .mapPage(bodyItemValue -> bodyItemValue.toObject(VoiceConversation.class));
+ }
+
+ /**
+ * List voice agent conversations
+ *
+ * Returns the conversations persisted for the specified voice agent endpoint.
+ * Conversations are present when the session's effective `store` setting is `true`, whether inherited from the
+ * agent definition or enabled by the WebSocket session override.
+ *
+ * @param agentName The name of the agent.
+ * @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 the response data for a requested list of items as paginated response with {@link PagedIterable}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listAgentConversations(String agentName) {
+ // Generated convenience method for listAgentConversations
+ RequestOptions requestOptions = new RequestOptions();
+ return serviceClient.listAgentConversations(agentName, requestOptions)
+ .mapPage(bodyItemValue -> bodyItemValue.toObject(VoiceConversation.class));
+ }
+
+ /**
+ * Get a voice agent conversation
+ *
+ * Retrieves a single conversation recorded for the specified voice agent endpoint by its id.
+ * Returns `404` when the conversation was not persisted (`store = false`) or does not exist.
+ *
+ * @param agentName The name of the agent.
+ * @param conversationId The id of the conversation to retrieve.
+ * @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 voice agent conversation
+ *
+ * Retrieves a single conversation recorded for the specified voice agent endpoint by its id.
+ * Returns `404` when the conversation was not persisted (`store = false`) or does not exist.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public VoiceConversation getAgentConversation(String agentName, String conversationId) {
+ // Generated convenience method for getAgentConversationWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ return getAgentConversationWithResponse(agentName, conversationId, requestOptions).getValue()
+ .toObject(VoiceConversation.class);
+ }
+
+ /**
+ * Delete a voice agent conversation
+ *
+ * Deletes a conversation and all of its stored data — responses, items, and any audio (cascade). This is
+ * the customer's explicit data-deletion control for voice conversations.
+ *
+ * @param agentName The name of the agent.
+ * @param conversationId The id of the conversation 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.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public void deleteAgentConversation(String agentName, String conversationId) {
+ // Generated convenience method for deleteAgentConversationWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ deleteAgentConversationWithResponse(agentName, conversationId, requestOptions).getValue();
+ }
+
+ /**
+ * List responses in a voice agent conversation
+ *
+ * Returns a paged collection of the responses (model inference turns) recorded for the specified
+ * conversation. The per-response `output` projection may be omitted here; use the response-items route
+ * for the canonical paged output. Returns `404` when the conversation was not persisted (`store = false`).
+ *
+ * @param agentName The name of the agent.
+ * @param conversationId The id of the conversation whose responses are listed.
+ * @param limit A limit on the number of objects to be returned. Limit can range between 1 and 100, and the
+ * default is 20.
+ * @param order Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`
+ * for descending order.
+ * @param after A cursor for use in pagination. `after` is an object ID that defines your place in the list.
+ * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your
+ * subsequent call can include after=obj_foo in order to fetch the next page of the list.
+ * @param before A cursor for use in pagination. `before` is an object ID that defines your place in the list.
+ * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your
+ * subsequent call can include before=obj_foo in order to fetch the previous page of the list.
+ * @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 the response data for a requested list of items as paginated response with {@link PagedIterable}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listAgentConversationResponses(String agentName, String conversationId,
+ Integer limit, PageOrder order, String after, String before) {
+ // Generated convenience method for listAgentConversationResponses
+ RequestOptions requestOptions = new RequestOptions();
+ if (limit != null) {
+ requestOptions.addQueryParam("limit", String.valueOf(limit), false);
+ }
+ if (order != null) {
+ requestOptions.addQueryParam("order", order.toString(), false);
+ }
+ if (after != null) {
+ requestOptions.addQueryParam("after", after, false);
+ }
+ if (before != null) {
+ requestOptions.addQueryParam("before", before, false);
+ }
+ return serviceClient.listAgentConversationResponses(agentName, conversationId, requestOptions)
+ .mapPage(bodyItemValue -> bodyItemValue.toObject(VoiceResponse.class));
+ }
+
+ /**
+ * List responses in a voice agent conversation
+ *
+ * Returns a paged collection of the responses (model inference turns) recorded for the specified
+ * conversation. The per-response `output` projection may be omitted here; use the response-items route
+ * for the canonical paged output. Returns `404` when the conversation was not persisted (`store = false`).
+ *
+ * @param agentName The name of the agent.
+ * @param conversationId The id of the conversation whose responses are listed.
+ * @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 the response data for a requested list of items as paginated response with {@link PagedIterable}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listAgentConversationResponses(String agentName, String conversationId) {
+ // Generated convenience method for listAgentConversationResponses
+ RequestOptions requestOptions = new RequestOptions();
+ return serviceClient.listAgentConversationResponses(agentName, conversationId, requestOptions)
+ .mapPage(bodyItemValue -> bodyItemValue.toObject(VoiceResponse.class));
+ }
+
+ /**
+ * Get a voice agent conversation response
+ *
+ * Retrieves a single response from the specified conversation by its id, including its `output` items,
+ * `usage`, and status. Returns `404` when the conversation or response was not persisted (`store = false`).
+ *
+ * @param agentName The name of the agent.
+ * @param conversationId The id of the conversation that contains the response.
+ * @param responseId The id of the response to retrieve.
+ * @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 voice agent conversation response
+ *
+ * Retrieves a single response from the specified conversation by its id, including its `output` items,
+ * `usage`, and status.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public VoiceResponse getAgentConversationResponse(String agentName, String conversationId, String responseId) {
+ // Generated convenience method for getAgentConversationResponseWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ return getAgentConversationResponseWithResponse(agentName, conversationId, responseId, requestOptions)
+ .getValue()
+ .toObject(VoiceResponse.class);
+ }
+
+ /**
+ * List items produced by a voice agent conversation response
+ *
+ * Returns a paged collection of the output items produced by a specific response (the response's output
+ * projection). For the complete ordered conversation history — including user input and client-created
+ * tool outputs — use the conversation items route instead. Returns `404` when the conversation or
+ * response was not persisted (`store = false`).
+ *
+ * @param agentName The name of the agent.
+ * @param conversationId The id of the conversation that contains the response.
+ * @param responseId The id of the response whose output items are listed.
+ * @param limit A limit on the number of objects to be returned. Limit can range between 1 and 100, and the
+ * default is 20.
+ * @param order Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`
+ * for descending order.
+ * @param after A cursor for use in pagination. `after` is an object ID that defines your place in the list.
+ * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your
+ * subsequent call can include after=obj_foo in order to fetch the next page of the list.
+ * @param before A cursor for use in pagination. `before` is an object ID that defines your place in the list.
+ * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your
+ * subsequent call can include before=obj_foo in order to fetch the previous page of the list.
+ * @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 the response data for a requested list of items as paginated response with {@link PagedIterable}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listAgentConversationResponseItems(String agentName,
+ String conversationId, String responseId, Integer limit, PageOrder order, String after, String before) {
+ // Generated convenience method for listAgentConversationResponseItems
+ RequestOptions requestOptions = new RequestOptions();
+ if (limit != null) {
+ requestOptions.addQueryParam("limit", String.valueOf(limit), false);
+ }
+ if (order != null) {
+ requestOptions.addQueryParam("order", order.toString(), false);
+ }
+ if (after != null) {
+ requestOptions.addQueryParam("after", after, false);
+ }
+ if (before != null) {
+ requestOptions.addQueryParam("before", before, false);
+ }
+ return serviceClient.listAgentConversationResponseItems(agentName, conversationId, responseId, requestOptions)
+ .mapPage(bodyItemValue -> bodyItemValue.toObject(RealtimeConversationItem.class));
+ }
+
+ /**
+ * List items produced by a voice agent conversation response
+ *
+ * Returns a paged collection of the output items produced by a specific response (the response's output
+ * projection). For the complete ordered conversation history — including user input and client-created
+ * tool outputs — use the conversation items route instead. Returns `404` when the conversation or
+ * response was not persisted (`store = false`).
+ *
+ * @param agentName The name of the agent.
+ * @param conversationId The id of the conversation that contains the response.
+ * @param responseId The id of the response whose output items are listed.
+ * @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 the response data for a requested list of items as paginated response with {@link PagedIterable}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listAgentConversationResponseItems(String agentName,
+ String conversationId, String responseId) {
+ // Generated convenience method for listAgentConversationResponseItems
+ RequestOptions requestOptions = new RequestOptions();
+ return serviceClient.listAgentConversationResponseItems(agentName, conversationId, responseId, requestOptions)
+ .mapPage(bodyItemValue -> bodyItemValue.toObject(RealtimeConversationItem.class));
+ }
+
+ /**
+ * List items in a voice agent conversation
+ *
+ * Returns a paged collection of items — the complete ordered conversation history, including user input,
+ * assistant output, and client-created tool outputs (transcripts + tool events). Returns `404` when the
+ * conversation was not persisted (`store = false`).
+ *
+ * @param agentName The name of the agent.
+ * @param conversationId The id of the conversation whose items are listed.
+ * @param limit A limit on the number of objects to be returned. Limit can range between 1 and 100, and the
+ * default is 20.
+ * @param order Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`
+ * for descending order.
+ * @param after A cursor for use in pagination. `after` is an object ID that defines your place in the list.
+ * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your
+ * subsequent call can include after=obj_foo in order to fetch the next page of the list.
+ * @param before A cursor for use in pagination. `before` is an object ID that defines your place in the list.
+ * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your
+ * subsequent call can include before=obj_foo in order to fetch the previous page of the list.
+ * @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 the response data for a requested list of items as paginated response with {@link PagedIterable}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listAgentConversationItems(String agentName, String conversationId,
+ Integer limit, PageOrder order, String after, String before) {
+ // Generated convenience method for listAgentConversationItems
+ RequestOptions requestOptions = new RequestOptions();
+ if (limit != null) {
+ requestOptions.addQueryParam("limit", String.valueOf(limit), false);
+ }
+ if (order != null) {
+ requestOptions.addQueryParam("order", order.toString(), false);
+ }
+ if (after != null) {
+ requestOptions.addQueryParam("after", after, false);
+ }
+ if (before != null) {
+ requestOptions.addQueryParam("before", before, false);
+ }
+ return serviceClient.listAgentConversationItems(agentName, conversationId, requestOptions)
+ .mapPage(bodyItemValue -> bodyItemValue.toObject(RealtimeConversationItem.class));
+ }
+
+ /**
+ * List items in a voice agent conversation
+ *
+ * Returns a paged collection of items — the complete ordered conversation history, including user input,
+ * assistant output, and client-created tool outputs (transcripts + tool events). Returns `404` when the
+ * conversation was not persisted (`store = false`).
+ *
+ * @param agentName The name of the agent.
+ * @param conversationId The id of the conversation whose items are listed.
+ * @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 the response data for a requested list of items as paginated response with {@link PagedIterable}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listAgentConversationItems(String agentName, String conversationId) {
+ // Generated convenience method for listAgentConversationItems
+ RequestOptions requestOptions = new RequestOptions();
+ return serviceClient.listAgentConversationItems(agentName, conversationId, requestOptions)
+ .mapPage(bodyItemValue -> bodyItemValue.toObject(RealtimeConversationItem.class));
+ }
+
+ /**
+ * Get a voice agent conversation item
+ *
+ * Retrieves a single item from the specified conversation by its id, including its transcript. An
+ * `input_audio`/`output_audio` content part indicates that audio is available for the item; the canonical per-item
+ * audio metadata is the `/items/{item_id}/audio` resource, and the bytes are streamed by
+ * `/items/{item_id}/audio/content`. Returns `404` when the conversation or item was not persisted
+ * (`store = false`).
+ *
+ * @param agentName The name of the agent.
+ * @param conversationId The id of the conversation that contains the item.
+ * @param itemId The id of the conversation item to retrieve.
+ * @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 voice agent conversation item
+ *
+ * Retrieves a single item from the specified conversation by its id, including its transcript.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public RealtimeConversationItem getAgentConversationItem(String agentName, String conversationId, String itemId) {
+ // Generated convenience method for getAgentConversationItemWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ return getAgentConversationItemWithResponse(agentName, conversationId, itemId, requestOptions).getValue()
+ .toObject(RealtimeConversationItem.class);
+ }
+
+ /**
+ * Get a voice agent conversation item's audio metadata
+ *
+ * Returns metadata for a single conversation item's audio segment, including the common playback facts
+ * (role, format/codec, sample rate, channels, offset, duration) for both Foundry-managed and
+ * bring-your-own-storage (BYOS) recordings; for BYOS the response additionally includes `blob_uri`, the URI
+ * of the recording in the customer's own storage (no SAS) that the customer downloads with their own credentials.
+ * Requires the conversation to have persisted audio (`store = true`); returns `404` when the conversation,
+ * item, or its audio was not persisted.
+ *
+ * @param agentName The name of the agent.
+ * @param conversationId The id of the conversation that contains the item.
+ * @param itemId The id of the conversation item whose audio metadata is retrieved.
+ * @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 voice agent conversation item's audio metadata
+ *
+ * Returns metadata for a single conversation item's audio segment, including the common playback facts
+ * (role, format/codec, sample rate, channels, offset, duration) for both Foundry-managed and
+ * bring-your-own-storage (BYOS) recordings; for BYOS the response additionally includes `blob_uri`, the URI
+ * of the recording in the customer's own storage (no SAS) that the customer downloads with their own credentials.
+ * Requires the conversation to have persisted audio (`store = true`); returns `404` when the conversation,
+ * item, or its audio was not persisted.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public VoiceAudioItemResponse getAgentConversationAudioItem(String agentName, String conversationId,
+ String itemId) {
+ // Generated convenience method for getAgentConversationAudioItemWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ return getAgentConversationAudioItemWithResponse(agentName, conversationId, itemId, requestOptions).getValue()
+ .toObject(VoiceAudioItemResponse.class);
+ }
+
+ /**
+ * Stream a voice agent conversation item's audio
+ *
+ * Streams a single conversation item's audio as a WAV (`audio/wav`) byte stream through the service (no SAS
+ * URL). This route serves Foundry-managed storage only. For bring-your-own-storage (BYOS) recordings the
+ * bytes are not proxied — the caller must download directly from customer storage using the `blob_uri`
+ * returned by the item's `/audio` metadata route — so this route returns `409 Conflict` for BYOS recordings.
+ * Returns `404` when the conversation, item, or its audio was not persisted (`store = false`).
+ *
+ * @param agentName The name of the agent.
+ * @param conversationId The id of the conversation that contains the item.
+ * @param itemId The id of the conversation item whose audio is streamed.
+ * @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 the response.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public BinaryData downloadAgentConversationAudioItem(String agentName, String conversationId, String itemId) {
+ // Generated convenience method for downloadAgentConversationAudioItemWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ return downloadAgentConversationAudioItemWithResponse(agentName, conversationId, itemId, requestOptions)
+ .getValue();
+ }
+
+ /**
+ * Get a voice agent conversation item's generated audio metadata
+ *
+ * Returns metadata for a conversation item's generated audio. This subordinate artifact is separate from the
+ * canonical heard-audio segment and exists only when playback was interrupted and the service rendered more audio
+ * than the listener heard, including when the response ends as cancelled. Returns `404` when the conversation or
+ * item was not persisted, or when no generated audio exists beyond the heard segment.
+ *
+ * @param agentName The name of the agent.
+ * @param conversationId The id of the conversation that contains the item.
+ * @param itemId The id of the conversation item whose generated audio metadata is retrieved.
+ * @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 voice agent conversation item's generated audio metadata
+ *
+ * Returns metadata for a conversation item's generated audio.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public VoiceGeneratedAudioItemResponse getAgentConversationGeneratedAudioItem(String agentName,
+ String conversationId, String itemId) {
+ // Generated convenience method for getAgentConversationGeneratedAudioItemWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ return getAgentConversationGeneratedAudioItemWithResponse(agentName, conversationId, itemId, requestOptions)
+ .getValue()
+ .toObject(VoiceGeneratedAudioItemResponse.class);
+ }
+
+ /**
+ * Stream a voice agent conversation item's generated audio
+ *
+ * Streams a conversation item's generated audio as a WAV (`audio/wav`) byte stream through the service. This
+ * subordinate artifact exists only when playback was interrupted and the service rendered more audio than the
+ * listener heard, including when the response ends as cancelled. This route serves Foundry-managed storage only.
+ * For bring-your-own-storage (BYOS) recordings the bytes are not proxied, so this route returns `409 Conflict`.
+ * Returns `404` when the conversation or item was not persisted, or when no generated audio exists beyond the
+ * heard segment.
+ *
+ * @param agentName The name of the agent.
+ * @param conversationId The id of the conversation that contains the item.
+ * @param itemId The id of the conversation item whose generated audio is streamed.
+ * @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 the response.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public BinaryData downloadAgentConversationGeneratedAudioItem(String agentName, String conversationId,
+ String itemId) {
+ // Generated convenience method for downloadAgentConversationGeneratedAudioItemWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ return downloadAgentConversationGeneratedAudioItemWithResponse(agentName, conversationId, itemId,
+ requestOptions).getValue();
+ }
+
+ /**
+ * Get a voice agent conversation's merged recording metadata
+ *
+ * Returns metadata for the whole-call merged stereo recording (user audio on the left channel, agent audio
+ * on the right). The common metadata (format, sample rate, channels, channel layout, duration) is returned
+ * for both Foundry-managed and bring-your-own-storage (BYOS) recordings; for BYOS the response additionally
+ * includes `blob_uri`, the URI of the recording in the customer's own storage (no SAS) that the customer downloads
+ * with their own credentials. The recording is built once from the per-turn segments after persistence
+ * finalization succeeds. While the conversation is `in_progress`, this route returns retriable `409 Conflict`
+ * with `error.code = recording_not_ready` and a `Retry-After` header when retry guidance is available. When the
+ * conversation is `failed`, it returns terminal `409 Conflict` with `error.code = recording_unavailable`.
+ * For a `completed` conversation, metadata is available subject to the existing BYOS behavior. Requires the
+ * conversation to have persisted audio (`store = true`); otherwise returns `404`.
+ *
+ * @param agentName The name of the agent.
+ * @param conversationId The id of the conversation whose merged recording metadata is retrieved.
+ * @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 voice agent conversation's merged recording metadata
+ *
+ * Returns metadata for the whole-call merged stereo recording (user audio on the left channel, agent audio
+ * on the right).
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public VoiceRecordingResponse getAgentConversationAudio(String agentName, String conversationId) {
+ // Generated convenience method for getAgentConversationAudioWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ return getAgentConversationAudioWithResponse(agentName, conversationId, requestOptions).getValue()
+ .toObject(VoiceRecordingResponse.class);
+ }
+
+ /**
+ * Stream a voice agent conversation's merged recording
+ *
+ * Streams the whole-call merged stereo recording as a WAV (`audio/wav`) byte stream through the service
+ * (no SAS URL). This route serves Foundry-managed storage only. For bring-your-own-storage (BYOS)
+ * recordings the bytes are not proxied — the caller must download directly from customer storage using the
+ * `blob_uri` returned by the metadata route — so this route returns `409 Conflict` for BYOS recordings.
+ * While the conversation is `in_progress`, this route returns retriable `409 Conflict` with
+ * `error.code = recording_not_ready` and a `Retry-After` header when retry guidance is available. When the
+ * conversation is `failed`, it returns terminal `409 Conflict` with `error.code = recording_unavailable`.
+ * For a `completed` conversation, content is available subject to the existing BYOS behavior. A conversation
+ * without persisted audio (`store = false`) returns `404`.
+ *
+ * @param agentName The name of the agent.
+ * @param conversationId The id of the conversation whose merged recording is streamed.
+ * @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 the response.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public BinaryData downloadAgentConversationAudio(String agentName, String conversationId) {
+ // Generated convenience method for downloadAgentConversationAudioWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ return downloadAgentConversationAudioWithResponse(agentName, conversationId, requestOptions).getValue();
+ }
+}
diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/BetaVoiceAgentsTelephonyAsyncClient.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/BetaVoiceAgentsTelephonyAsyncClient.java
new file mode 100644
index 0000000000000..34ad2f837b204
--- /dev/null
+++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/BetaVoiceAgentsTelephonyAsyncClient.java
@@ -0,0 +1,2444 @@
+// 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;
+
+import com.azure.ai.agents.implementation.BetaVoiceAgentsTelephoniesImpl;
+import com.azure.ai.agents.implementation.JsonMergePatchHelper;
+import com.azure.ai.agents.implementation.models.ReplaceTelephonyTransferTargetsRequest;
+import com.azure.ai.agents.implementation.models.TransferTelephonyCallRequest;
+import com.azure.ai.agents.implementation.utils.Beta;
+import com.azure.ai.agents.models.CreateTelephonyBindingRequest;
+import com.azure.ai.agents.models.CreateTelephonyCallJobRequest;
+import com.azure.ai.agents.models.CreateTelephonyCampaignRequest;
+import com.azure.ai.agents.models.ImportTelephonyCampaignRecipientsRequest;
+import com.azure.ai.agents.models.PageOrder;
+import com.azure.ai.agents.models.PublishTelephonyCampaignRequest;
+import com.azure.ai.agents.models.TelephonyBinding;
+import com.azure.ai.agents.models.TelephonyBindingListItem;
+import com.azure.ai.agents.models.TelephonyBindingStatus;
+import com.azure.ai.agents.models.TelephonyCallJob;
+import com.azure.ai.agents.models.TelephonyCallRecord;
+import com.azure.ai.agents.models.TelephonyCallStatus;
+import com.azure.ai.agents.models.TelephonyCallSummary;
+import com.azure.ai.agents.models.TelephonyCampaign;
+import com.azure.ai.agents.models.TelephonyCampaignRecipientImport;
+import com.azure.ai.agents.models.TelephonyOperation;
+import com.azure.ai.agents.models.TelephonyOperationResource;
+import com.azure.ai.agents.models.TelephonyProvider;
+import com.azure.ai.agents.models.TelephonyTransferTarget;
+import com.azure.ai.agents.models.TelephonyTransferTargets;
+import com.azure.ai.agents.models.UpdateTelephonyBindingRequest;
+import com.azure.core.annotation.Generated;
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceClient;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.exception.ClientAuthenticationException;
+import com.azure.core.exception.HttpResponseException;
+import com.azure.core.exception.ResourceModifiedException;
+import com.azure.core.exception.ResourceNotFoundException;
+import com.azure.core.http.rest.PagedFlux;
+import com.azure.core.http.rest.PagedResponse;
+import com.azure.core.http.rest.PagedResponseBase;
+import com.azure.core.http.rest.RequestOptions;
+import com.azure.core.http.rest.Response;
+import com.azure.core.util.BinaryData;
+import com.azure.core.util.FluxUtil;
+import com.azure.core.util.polling.PollerFlux;
+import java.time.OffsetDateTime;
+import java.util.List;
+import java.util.stream.Collectors;
+import reactor.core.publisher.Flux;
+import reactor.core.publisher.Mono;
+
+/**
+ * Initializes a new instance of the asynchronous AgentsClient type.
+ */
+@ServiceClient(builder = AgentsClientBuilder.class, isAsync = true)
+@Beta(warningText = "This class is in preview and may change in future releases.")
+public final class BetaVoiceAgentsTelephonyAsyncClient {
+
+ @Generated
+ private final BetaVoiceAgentsTelephoniesImpl serviceClient;
+
+ /**
+ * Initializes an instance of BetaVoiceAgentsTelephonyAsyncClient class.
+ *
+ * @param serviceClient the service client implementation.
+ */
+ @Generated
+ BetaVoiceAgentsTelephonyAsyncClient(BetaVoiceAgentsTelephoniesImpl serviceClient) {
+ this.serviceClient = serviceClient;
+ }
+
+ /**
+ * Create an agent telephony binding
+ *
+ * Creates a telephony binding for the voice agent named in the path.
+ * Header Parameters
+ *
+ * Header Parameters
+ * | Name | Type | Required | Description |
+ * | repeatability-request-id | String | No | Repeatability request ID header |
+ * | repeatability-first-sent | String | No | Repeatability first sent header as
+ * HTTP-date |
+ *
+ * You can add these to a request with {@link RequestOptions#addHeader}
+ * Request Body Schema
+ *
+ *
+ * {@code
+ * {
+ * provider: String(teams_phone_extension/twilio) (Required)
+ * connection_name: String (Required)
+ * label: String (Optional)
+ * }
+ * }
+ *
+ *
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * provider: String(teams_phone_extension/twilio) (Required)
+ * id: String (Required)
+ * connection_name: String (Required)
+ * label: String (Optional)
+ * status: String(active/suspended) (Required)
+ * incoming_call_url: String (Required)
+ * }
+ * }
+ *
+ *
+ * Response Headers
+ *
+ * Response Headers
+ * | Name | Type | Description |
+ * | ETag | String | The entity tag to send in the `If-Match` header when updating or deleting the
+ * binding. |
+ *
+ *
+ * @param agentName The name of the voice agent that owns the binding.
+ * @param telephonyBinding The provider-specific binding to create.
+ * @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 telephony binding owned by a voice agent along with {@link Response} on successful completion of
+ * {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> createTelephonyBindingWithResponse(String agentName, BinaryData telephonyBinding,
+ RequestOptions requestOptions) {
+ return this.serviceClient.createTelephonyBindingWithResponseAsync(agentName, telephonyBinding, requestOptions);
+ }
+
+ /**
+ * List agent telephony bindings
+ *
+ * Returns the telephony bindings owned by the voice agent named in the path.
+ * Query Parameters
+ *
+ * Query Parameters
+ * | Name | Type | Required | Description |
+ * | provider | String | No | Filters bindings by provider. Allowed values:
+ * "teams_phone_extension", "twilio". |
+ * | status | String | No | Filters bindings by lifecycle status. Allowed values: "active",
+ * "suspended". |
+ * | limit | Integer | No | A limit on the number of objects to be returned. Limit can range
+ * between 1 and 100, and the
+ * default is 20. |
+ * | order | String | No | Sort order by the `created_at` timestamp of the objects. `asc`
+ * for ascending order and`desc`
+ * for descending order. Allowed values: "asc", "desc". |
+ * | after | String | No | A cursor for use in pagination. `after` is an object ID that
+ * defines your place in the list.
+ * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your
+ * subsequent call can include after=obj_foo in order to fetch the next page of the list. |
+ * | before | String | No | A cursor for use in pagination. `before` is an object ID that
+ * defines your place in the list.
+ * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your
+ * subsequent call can include before=obj_foo in order to fetch the previous page of the list. |
+ *
+ * You can add these to a request with {@link RequestOptions#addQueryParam}
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * provider: String(teams_phone_extension/twilio) (Required)
+ * id: String (Required)
+ * connection_name: String (Required)
+ * label: String (Optional)
+ * status: String(active/suspended) (Required)
+ * incoming_call_url: String (Required)
+ * etag: String (Required)
+ * }
+ * }
+ *
+ *
+ * @param agentName The name of the voice agent whose bindings are listed.
+ * @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 the response data for a requested list of items as paginated response with {@link PagedFlux}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedFlux listTelephonyBindings(String agentName, RequestOptions requestOptions) {
+ return this.serviceClient.listTelephonyBindingsAsync(agentName, requestOptions);
+ }
+
+ /**
+ * Get an agent telephony binding
+ *
+ * Retrieves a telephony binding owned by the voice agent named in the path.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * provider: String(teams_phone_extension/twilio) (Required)
+ * id: String (Required)
+ * connection_name: String (Required)
+ * label: String (Optional)
+ * status: String(active/suspended) (Required)
+ * incoming_call_url: String (Required)
+ * }
+ * }
+ *
+ *
+ * Response Headers
+ *
+ * Response Headers
+ * | Name | Type | Description |
+ * | ETag | String | The entity tag to send in the `If-Match` header when updating or deleting the
+ * binding. |
+ *
+ *
+ * @param agentName The name of the voice agent that owns the binding.
+ * @param bindingId The service-generated binding identifier.
+ * @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 an agent telephony binding
+ *
+ * Retrieves a telephony binding owned by the voice agent named in the path along with {@link Response} on
+ * successful completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> getTelephonyBindingWithResponse(String agentName, String bindingId,
+ RequestOptions requestOptions) {
+ return this.serviceClient.getTelephonyBindingWithResponseAsync(agentName, bindingId, requestOptions);
+ }
+
+ /**
+ * Update an agent telephony binding
+ *
+ * Updates a telephony binding owned by the voice agent named in the path.
+ * Request Body Schema
+ *
+ *
+ * {@code
+ * {
+ * status: String(active/suspended) (Optional)
+ * label: String (Optional)
+ * connection_name: String (Optional)
+ * phone_number: String (Optional)
+ * }
+ * }
+ *
+ *
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * provider: String(teams_phone_extension/twilio) (Required)
+ * id: String (Required)
+ * connection_name: String (Required)
+ * label: String (Optional)
+ * status: String(active/suspended) (Required)
+ * incoming_call_url: String (Required)
+ * }
+ * }
+ *
+ *
+ * Response Headers
+ *
+ * Response Headers
+ * | Name | Type | Description |
+ * | ETag | String | The entity tag to send in the `If-Match` header when updating or deleting the
+ * binding. |
+ *
+ *
+ * @param agentName The name of the voice agent that owns the binding.
+ * @param bindingId The service-generated binding identifier.
+ * @param ifMatch The entity tag returned by the latest read. The request fails if the resource changed since that
+ * read.
+ * @param body The binding properties to update.
+ * @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 telephony binding owned by a voice agent along with {@link Response} on successful completion of
+ * {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> updateTelephonyBindingWithResponse(String agentName, String bindingId,
+ String ifMatch, BinaryData body, RequestOptions requestOptions) {
+ return this.serviceClient.updateTelephonyBindingWithResponseAsync(agentName, bindingId, ifMatch, body,
+ requestOptions);
+ }
+
+ /**
+ * Delete an agent telephony binding
+ *
+ * Deletes a telephony binding owned by the voice agent named in the path.
+ *
+ * @param agentName The name of the voice agent that owns the binding.
+ * @param bindingId The service-generated binding identifier.
+ * @param ifMatch The entity tag returned by the latest read. The request fails if the resource changed since that
+ * read.
+ * @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 the {@link Response} on successful completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> deleteTelephonyBindingWithResponse(String agentName, String bindingId, String ifMatch,
+ RequestOptions requestOptions) {
+ return this.serviceClient.deleteTelephonyBindingWithResponseAsync(agentName, bindingId, ifMatch,
+ requestOptions);
+ }
+
+ /**
+ * List agent telephony calls
+ *
+ * Returns the durable inbound call history for the voice agent named in the path.
+ * Query Parameters
+ *
+ * Query Parameters
+ * | Name | Type | Required | Description |
+ * | provider | String | No | Filters calls by provider. Allowed values:
+ * "teams_phone_extension", "twilio". |
+ * | status | String | No | Filters calls by lifecycle status. Allowed values:
+ * "in_progress", "success", "failed". |
+ * | started_after | OffsetDateTime | No | Includes calls that started at or after this Unix
+ * timestamp in seconds. |
+ * | started_before | OffsetDateTime | No | Includes calls that started at or before this
+ * Unix timestamp in seconds. |
+ * | limit | Integer | No | A limit on the number of objects to be returned. Limit can range
+ * between 1 and 100, and the
+ * default is 20. |
+ * | order | String | No | Sort order by the `created_at` timestamp of the objects. `asc`
+ * for ascending order and`desc`
+ * for descending order. Allowed values: "asc", "desc". |
+ * | after | String | No | A cursor for use in pagination. `after` is an object ID that
+ * defines your place in the list.
+ * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your
+ * subsequent call can include after=obj_foo in order to fetch the next page of the list. |
+ * | before | String | No | A cursor for use in pagination. `before` is an object ID that
+ * defines your place in the list.
+ * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your
+ * subsequent call can include before=obj_foo in order to fetch the previous page of the list. |
+ *
+ * You can add these to a request with {@link RequestOptions#addQueryParam}
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * id: String (Required)
+ * provider: String(teams_phone_extension/twilio) (Required)
+ * provider_call_id: String (Optional)
+ * caller_number: String (Optional)
+ * provider_number: String (Optional)
+ * status: String(in_progress/success/failed) (Required)
+ * phase: String(received/validated/admitted/answering/answered/media_connected/agent_session_ready/bridging/managing/completed/rejected/failed) (Required)
+ * started_at: long (Required)
+ * answered_at: Long (Optional)
+ * media_connected_at: Long (Optional)
+ * agent_session_ready_at: Long (Optional)
+ * ended_at: Long (Optional)
+ * duration_ms: Long (Optional)
+ * end_reason: String(invalid_webhook_payload/webhook_validation_failed/binding_not_found/binding_suspended/admission_rejected/admission_check_failed/route_agent_mismatch/invalid_binding_configuration/credential_resolution_failed/provider_resource_mismatch/endpoint_resolution_failed/ingress_setup_failed/live_call_conflict/live_call_persistence_failed/answer_failed/provider_disconnected/provider_busy/provider_no_answer/provider_cancelled/provider_failed/provider_stream_error/provider_stream_stopped/agent_session_connect_failed/media_stream_ended/bridge_cancelled/bridge_failed/managed_hangup/managed_transfer/manage_hangup_failed/manage_transfer_failed) (Optional)
+ * provider_status_code: Integer (Optional)
+ * provider_sub_code: Integer (Optional)
+ * provider_message: String (Optional)
+ * }
+ * }
+ *
+ *
+ * @param agentName The name of the voice agent whose calls are listed.
+ * @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 the response data for a requested list of items as paginated response with {@link PagedFlux}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedFlux listTelephonyCalls(String agentName, RequestOptions requestOptions) {
+ return this.serviceClient.listTelephonyCallsAsync(agentName, requestOptions);
+ }
+
+ /**
+ * Get an agent telephony call
+ *
+ * Retrieves a durable inbound call record owned by the voice agent named in the path.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * id: String (Required)
+ * provider: String(teams_phone_extension/twilio) (Required)
+ * provider_call_id: String (Optional)
+ * caller_number: String (Optional)
+ * provider_number: String (Optional)
+ * status: String(in_progress/success/failed) (Required)
+ * phase: String(received/validated/admitted/answering/answered/media_connected/agent_session_ready/bridging/managing/completed/rejected/failed) (Required)
+ * started_at: long (Required)
+ * answered_at: Long (Optional)
+ * media_connected_at: Long (Optional)
+ * agent_session_ready_at: Long (Optional)
+ * ended_at: Long (Optional)
+ * duration_ms: Long (Optional)
+ * end_reason: String(invalid_webhook_payload/webhook_validation_failed/binding_not_found/binding_suspended/admission_rejected/admission_check_failed/route_agent_mismatch/invalid_binding_configuration/credential_resolution_failed/provider_resource_mismatch/endpoint_resolution_failed/ingress_setup_failed/live_call_conflict/live_call_persistence_failed/answer_failed/provider_disconnected/provider_busy/provider_no_answer/provider_cancelled/provider_failed/provider_stream_error/provider_stream_stopped/agent_session_connect_failed/media_stream_ended/bridge_cancelled/bridge_failed/managed_hangup/managed_transfer/manage_hangup_failed/manage_transfer_failed) (Optional)
+ * provider_status_code: Integer (Optional)
+ * provider_sub_code: Integer (Optional)
+ * provider_message: String (Optional)
+ * timing (Required): {
+ * received_at: Long (Optional)
+ * validated_at: Long (Optional)
+ * admitted_at: Long (Optional)
+ * answer_requested_at: Long (Optional)
+ * answered_at: Long (Optional)
+ * media_connected_at: Long (Optional)
+ * agent_session_ready_at: Long (Optional)
+ * first_caller_audio_at: Long (Optional)
+ * first_agent_audio_at: Long (Optional)
+ * ended_at: Long (Optional)
+ * duration_basis: String(answered/received) (Optional)
+ * timestamp_source: String(provider/gateway/derived) (Required)
+ * }
+ * trace (Optional): {
+ * status: String(pending/emitting/available/not_recorded/not_applicable/failed) (Required)
+ * trace_id: String (Optional)
+ * root_span_id: String (Optional)
+ * conversation_id: String (Optional)
+ * mode: String(live/post_call) (Optional)
+ * }
+ * events (Required): [
+ * (Required){
+ * sequence: long (Required)
+ * name: String(telephony.webhook.received/telephony.webhook.validation/telephony.binding.resolve/telephony.provider.answer/telephony.media.connect/telephony.agent_session.connect/telephony.media.first_caller_audio/telephony.media.first_agent_audio/telephony.call.transfer/telephony.call.hangup/telephony.call.disconnect) (Required)
+ * source: String(gateway/teams_phone_extension/twilio/voice_agent) (Required)
+ * outcome: String(observed/started/succeeded/failed/rejected/cancelled) (Required)
+ * observed_at: long (Required)
+ * occurred_at: Long (Optional)
+ * timestamp_source: String(provider/gateway/derived) (Required)
+ * reason: String(invalid_webhook_payload/webhook_validation_failed/binding_not_found/binding_suspended/admission_rejected/admission_check_failed/route_agent_mismatch/invalid_binding_configuration/credential_resolution_failed/provider_resource_mismatch/endpoint_resolution_failed/ingress_setup_failed/live_call_conflict/live_call_persistence_failed/answer_failed/provider_disconnected/provider_busy/provider_no_answer/provider_cancelled/provider_failed/provider_stream_error/provider_stream_stopped/agent_session_connect_failed/media_stream_ended/bridge_cancelled/bridge_failed/managed_hangup/managed_transfer/manage_hangup_failed/manage_transfer_failed) (Optional)
+ * provider_event_id: String (Optional)
+ * provider_sequence: Long (Optional)
+ * provider_status_code: Integer (Optional)
+ * provider_sub_code: Integer (Optional)
+ * }
+ * ]
+ * events_truncated: boolean (Required)
+ * }
+ * }
+ *
+ *
+ * @param agentName The name of the voice agent that owns the call record.
+ * @param callId The service-generated call identifier.
+ * @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 an agent telephony call
+ *
+ * Retrieves a durable inbound call record owned by the voice agent named in the path along with {@link Response} on
+ * successful completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> getTelephonyCallWithResponse(String agentName, String callId,
+ RequestOptions requestOptions) {
+ return this.serviceClient.getTelephonyCallWithResponseAsync(agentName, callId, requestOptions);
+ }
+
+ /**
+ * Transfer an active agent telephony call
+ *
+ * Transfers an active inbound call to a configured target for the voice agent named in the path.
+ * Request Body Schema
+ *
+ *
+ * {@code
+ * {
+ * target: String (Required)
+ * }
+ * }
+ *
+ *
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * id: String (Required)
+ * provider: String(teams_phone_extension/twilio) (Required)
+ * provider_call_id: String (Optional)
+ * caller_number: String (Optional)
+ * provider_number: String (Optional)
+ * status: String(in_progress/success/failed) (Required)
+ * phase: String(received/validated/admitted/answering/answered/media_connected/agent_session_ready/bridging/managing/completed/rejected/failed) (Required)
+ * started_at: long (Required)
+ * answered_at: Long (Optional)
+ * media_connected_at: Long (Optional)
+ * agent_session_ready_at: Long (Optional)
+ * ended_at: Long (Optional)
+ * duration_ms: Long (Optional)
+ * end_reason: String(invalid_webhook_payload/webhook_validation_failed/binding_not_found/binding_suspended/admission_rejected/admission_check_failed/route_agent_mismatch/invalid_binding_configuration/credential_resolution_failed/provider_resource_mismatch/endpoint_resolution_failed/ingress_setup_failed/live_call_conflict/live_call_persistence_failed/answer_failed/provider_disconnected/provider_busy/provider_no_answer/provider_cancelled/provider_failed/provider_stream_error/provider_stream_stopped/agent_session_connect_failed/media_stream_ended/bridge_cancelled/bridge_failed/managed_hangup/managed_transfer/manage_hangup_failed/manage_transfer_failed) (Optional)
+ * provider_status_code: Integer (Optional)
+ * provider_sub_code: Integer (Optional)
+ * provider_message: String (Optional)
+ * timing (Required): {
+ * received_at: Long (Optional)
+ * validated_at: Long (Optional)
+ * admitted_at: Long (Optional)
+ * answer_requested_at: Long (Optional)
+ * answered_at: Long (Optional)
+ * media_connected_at: Long (Optional)
+ * agent_session_ready_at: Long (Optional)
+ * first_caller_audio_at: Long (Optional)
+ * first_agent_audio_at: Long (Optional)
+ * ended_at: Long (Optional)
+ * duration_basis: String(answered/received) (Optional)
+ * timestamp_source: String(provider/gateway/derived) (Required)
+ * }
+ * trace (Optional): {
+ * status: String(pending/emitting/available/not_recorded/not_applicable/failed) (Required)
+ * trace_id: String (Optional)
+ * root_span_id: String (Optional)
+ * conversation_id: String (Optional)
+ * mode: String(live/post_call) (Optional)
+ * }
+ * events (Required): [
+ * (Required){
+ * sequence: long (Required)
+ * name: String(telephony.webhook.received/telephony.webhook.validation/telephony.binding.resolve/telephony.provider.answer/telephony.media.connect/telephony.agent_session.connect/telephony.media.first_caller_audio/telephony.media.first_agent_audio/telephony.call.transfer/telephony.call.hangup/telephony.call.disconnect) (Required)
+ * source: String(gateway/teams_phone_extension/twilio/voice_agent) (Required)
+ * outcome: String(observed/started/succeeded/failed/rejected/cancelled) (Required)
+ * observed_at: long (Required)
+ * occurred_at: Long (Optional)
+ * timestamp_source: String(provider/gateway/derived) (Required)
+ * reason: String(invalid_webhook_payload/webhook_validation_failed/binding_not_found/binding_suspended/admission_rejected/admission_check_failed/route_agent_mismatch/invalid_binding_configuration/credential_resolution_failed/provider_resource_mismatch/endpoint_resolution_failed/ingress_setup_failed/live_call_conflict/live_call_persistence_failed/answer_failed/provider_disconnected/provider_busy/provider_no_answer/provider_cancelled/provider_failed/provider_stream_error/provider_stream_stopped/agent_session_connect_failed/media_stream_ended/bridge_cancelled/bridge_failed/managed_hangup/managed_transfer/manage_hangup_failed/manage_transfer_failed) (Optional)
+ * provider_event_id: String (Optional)
+ * provider_sequence: Long (Optional)
+ * provider_status_code: Integer (Optional)
+ * provider_sub_code: Integer (Optional)
+ * }
+ * ]
+ * events_truncated: boolean (Required)
+ * }
+ * }
+ *
+ *
+ * @param agentName The name of the voice agent that owns the active call.
+ * @param callId The service-generated call identifier.
+ * @param transferTelephonyCallRequest The transferTelephonyCallRequest parameter.
+ * @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 detailed diagnostics for a durable inbound call to a voice agent along with {@link Response} on
+ * successful completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> transferTelephonyCallWithResponse(String agentName, String callId,
+ BinaryData transferTelephonyCallRequest, RequestOptions requestOptions) {
+ return this.serviceClient.transferTelephonyCallWithResponseAsync(agentName, callId,
+ transferTelephonyCallRequest, requestOptions);
+ }
+
+ /**
+ * End an active agent telephony call
+ *
+ * Ends an active inbound call owned by the voice agent named in the path.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * id: String (Required)
+ * provider: String(teams_phone_extension/twilio) (Required)
+ * provider_call_id: String (Optional)
+ * caller_number: String (Optional)
+ * provider_number: String (Optional)
+ * status: String(in_progress/success/failed) (Required)
+ * phase: String(received/validated/admitted/answering/answered/media_connected/agent_session_ready/bridging/managing/completed/rejected/failed) (Required)
+ * started_at: long (Required)
+ * answered_at: Long (Optional)
+ * media_connected_at: Long (Optional)
+ * agent_session_ready_at: Long (Optional)
+ * ended_at: Long (Optional)
+ * duration_ms: Long (Optional)
+ * end_reason: String(invalid_webhook_payload/webhook_validation_failed/binding_not_found/binding_suspended/admission_rejected/admission_check_failed/route_agent_mismatch/invalid_binding_configuration/credential_resolution_failed/provider_resource_mismatch/endpoint_resolution_failed/ingress_setup_failed/live_call_conflict/live_call_persistence_failed/answer_failed/provider_disconnected/provider_busy/provider_no_answer/provider_cancelled/provider_failed/provider_stream_error/provider_stream_stopped/agent_session_connect_failed/media_stream_ended/bridge_cancelled/bridge_failed/managed_hangup/managed_transfer/manage_hangup_failed/manage_transfer_failed) (Optional)
+ * provider_status_code: Integer (Optional)
+ * provider_sub_code: Integer (Optional)
+ * provider_message: String (Optional)
+ * timing (Required): {
+ * received_at: Long (Optional)
+ * validated_at: Long (Optional)
+ * admitted_at: Long (Optional)
+ * answer_requested_at: Long (Optional)
+ * answered_at: Long (Optional)
+ * media_connected_at: Long (Optional)
+ * agent_session_ready_at: Long (Optional)
+ * first_caller_audio_at: Long (Optional)
+ * first_agent_audio_at: Long (Optional)
+ * ended_at: Long (Optional)
+ * duration_basis: String(answered/received) (Optional)
+ * timestamp_source: String(provider/gateway/derived) (Required)
+ * }
+ * trace (Optional): {
+ * status: String(pending/emitting/available/not_recorded/not_applicable/failed) (Required)
+ * trace_id: String (Optional)
+ * root_span_id: String (Optional)
+ * conversation_id: String (Optional)
+ * mode: String(live/post_call) (Optional)
+ * }
+ * events (Required): [
+ * (Required){
+ * sequence: long (Required)
+ * name: String(telephony.webhook.received/telephony.webhook.validation/telephony.binding.resolve/telephony.provider.answer/telephony.media.connect/telephony.agent_session.connect/telephony.media.first_caller_audio/telephony.media.first_agent_audio/telephony.call.transfer/telephony.call.hangup/telephony.call.disconnect) (Required)
+ * source: String(gateway/teams_phone_extension/twilio/voice_agent) (Required)
+ * outcome: String(observed/started/succeeded/failed/rejected/cancelled) (Required)
+ * observed_at: long (Required)
+ * occurred_at: Long (Optional)
+ * timestamp_source: String(provider/gateway/derived) (Required)
+ * reason: String(invalid_webhook_payload/webhook_validation_failed/binding_not_found/binding_suspended/admission_rejected/admission_check_failed/route_agent_mismatch/invalid_binding_configuration/credential_resolution_failed/provider_resource_mismatch/endpoint_resolution_failed/ingress_setup_failed/live_call_conflict/live_call_persistence_failed/answer_failed/provider_disconnected/provider_busy/provider_no_answer/provider_cancelled/provider_failed/provider_stream_error/provider_stream_stopped/agent_session_connect_failed/media_stream_ended/bridge_cancelled/bridge_failed/managed_hangup/managed_transfer/manage_hangup_failed/manage_transfer_failed) (Optional)
+ * provider_event_id: String (Optional)
+ * provider_sequence: Long (Optional)
+ * provider_status_code: Integer (Optional)
+ * provider_sub_code: Integer (Optional)
+ * }
+ * ]
+ * events_truncated: boolean (Required)
+ * }
+ * }
+ *
+ *
+ * @param agentName The name of the voice agent that owns the active call.
+ * @param callId The service-generated call identifier.
+ * @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 detailed diagnostics for a durable inbound call to a voice agent along with {@link Response} on
+ * successful completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> endTelephonyCallWithResponse(String agentName, String callId,
+ RequestOptions requestOptions) {
+ return this.serviceClient.endTelephonyCallWithResponseAsync(agentName, callId, requestOptions);
+ }
+
+ /**
+ * Get agent telephony transfer targets
+ *
+ * Returns all transfer targets configured for the voice agent named in the path.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * transfer_targets (Required): [
+ * (Required){
+ * name: String (Required)
+ * description: String (Required)
+ * destination (Required): {
+ * kind: String(pstn/teams/sip) (Required)
+ * }
+ * }
+ * ]
+ * }
+ * }
+ *
+ *
+ * Response Headers
+ *
+ * Response Headers
+ * | Name | Type | Description |
+ * | ETag | String | The entity tag to send in the `If-Match` header when replacing the transfer
+ * targets. |
+ *
+ *
+ * @param agentName The name of the voice agent whose transfer targets are retrieved.
+ * @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 agent telephony transfer targets
+ *
+ * Returns all transfer targets configured for the voice agent named in the path along with {@link Response} on
+ * successful completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> getTelephonyTransferTargetsWithResponse(String agentName,
+ RequestOptions requestOptions) {
+ return this.serviceClient.getTelephonyTransferTargetsWithResponseAsync(agentName, requestOptions);
+ }
+
+ /**
+ * Replace agent telephony transfer targets
+ *
+ * Replaces all transfer targets configured for the voice agent named in the path.
+ * Request Body Schema
+ *
+ *
+ * {@code
+ * {
+ * transfer_targets (Required): [
+ * (Required){
+ * name: String (Required)
+ * description: String (Required)
+ * destination (Required): {
+ * kind: String(pstn/teams/sip) (Required)
+ * }
+ * }
+ * ]
+ * }
+ * }
+ *
+ *
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * transfer_targets (Required): [
+ * (Required){
+ * name: String (Required)
+ * description: String (Required)
+ * destination (Required): {
+ * kind: String(pstn/teams/sip) (Required)
+ * }
+ * }
+ * ]
+ * }
+ * }
+ *
+ *
+ * Response Headers
+ *
+ * Response Headers
+ * | Name | Type | Description |
+ * | ETag | String | The entity tag to send in the `If-Match` header when replacing the transfer
+ * targets. |
+ *
+ *
+ * @param agentName The name of the voice agent whose transfer targets are replaced.
+ * @param ifMatch The entity tag returned by the latest read. The request fails if the resource changed since that
+ * read.
+ * @param replaceTelephonyTransferTargetsRequest The replaceTelephonyTransferTargetsRequest parameter.
+ * @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 the telephony transfer targets configured for one voice agent along with {@link Response} on successful
+ * completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> replaceTelephonyTransferTargetsWithResponse(String agentName, String ifMatch,
+ BinaryData replaceTelephonyTransferTargetsRequest, RequestOptions requestOptions) {
+ return this.serviceClient.replaceTelephonyTransferTargetsWithResponseAsync(agentName, ifMatch,
+ replaceTelephonyTransferTargetsRequest, requestOptions);
+ }
+
+ /**
+ * Create an outbound telephony call job
+ *
+ * Creates one durable direct outbound call job. The latest agent definition is resolved when each attempt executes.
+ * Request Body Schema
+ *
+ *
+ * {@code
+ * {
+ * destination (Required): {
+ * type: String(phone_number) (Required)
+ * value: String (Required)
+ * }
+ * connection_name: String (Required)
+ * source: String (Required)
+ * purpose: String (Optional)
+ * structured_inputs (Optional): {
+ * String: BinaryData (Required)
+ * }
+ * schedule (Optional): {
+ * not_before: Long (Optional)
+ * expires_at: Long (Optional)
+ * }
+ * retry_policy (Optional): {
+ * type: String(fixed_interval) (Required)
+ * max_attempts: Integer (Optional)
+ * }
+ * }
+ * }
+ *
+ *
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * destination (Required): {
+ * type: String(phone_number) (Required)
+ * value: String (Required)
+ * }
+ * connection_name: String (Required)
+ * source: String (Required)
+ * purpose: String (Optional)
+ * structured_inputs (Optional): {
+ * String: BinaryData (Required)
+ * }
+ * schedule (Optional): {
+ * not_before: Long (Optional)
+ * expires_at: Long (Optional)
+ * }
+ * id: String (Required)
+ * object: String (Required)
+ * agent_name: String (Required)
+ * status: String(accepted/waiting_for_schedule/queued/dispatching/in_progress/waiting_for_retry/cancellation_requested/completed/blocked/expired/failed/cancelled) (Required)
+ * cancellation (Optional): {
+ * requested_by: String (Required)
+ * mode: String (Required)
+ * requested_at: long (Required)
+ * revision: long (Required)
+ * }
+ * retry_policy (Required): {
+ * type: String(fixed_interval) (Required)
+ * max_attempts: int (Required)
+ * }
+ * attempt_count: int (Required)
+ * next_attempt_at: Long (Optional)
+ * terminal_reason: String(no_answer/no_answer_timeout/answer_failed/bridge_cancelled/bridge_failed/voice_session_configuration_invalid/connection_project_mismatch/outbound_connection_changed/outbound_connection_unavailable/telephony_binding_invalid/telephony_binding_not_found/telephony_binding_inactive/telephony_binding_changed/campaign_not_found/campaign_cancelled/campaign_completed/campaign_failed/origination_fence_not_recorded/origination_reconciliation_timeout/cancellation_reconciliation_timeout/provider_callback_timeout_cancellation_reconciliation_timeout) (Optional)
+ * revision: long (Required)
+ * created_at: long (Required)
+ * updated_at: long (Required)
+ * }
+ * }
+ *
+ *
+ * Response Headers
+ *
+ * Response Headers
+ * | Name | Type | Description |
+ * | ETag | String | The ETag response header. |
+ * | Location | String | The Location response header. |
+ * | Retry-After | Duration | The Retry-After response header. |
+ *
+ *
+ * @param agentName The name of the voice agent that executes the call.
+ * @param idempotencyKey A customer-generated idempotency key. Reusing it with an equivalent request returns the
+ * same call job.
+ * @param body The direct outbound call to create.
+ * @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 durable direct or campaign-created outbound call intent along with {@link Response} on successful
+ * completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> createTelephonyCallJobWithResponse(String agentName, String idempotencyKey,
+ BinaryData body, RequestOptions requestOptions) {
+ return this.serviceClient.createTelephonyCallJobWithResponseAsync(agentName, idempotencyKey, body,
+ requestOptions);
+ }
+
+ /**
+ * Get an outbound telephony call job
+ *
+ * Retrieves a durable direct or campaign-created outbound call job.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * destination (Required): {
+ * type: String(phone_number) (Required)
+ * value: String (Required)
+ * }
+ * connection_name: String (Required)
+ * source: String (Required)
+ * purpose: String (Optional)
+ * structured_inputs (Optional): {
+ * String: BinaryData (Required)
+ * }
+ * schedule (Optional): {
+ * not_before: Long (Optional)
+ * expires_at: Long (Optional)
+ * }
+ * id: String (Required)
+ * object: String (Required)
+ * agent_name: String (Required)
+ * status: String(accepted/waiting_for_schedule/queued/dispatching/in_progress/waiting_for_retry/cancellation_requested/completed/blocked/expired/failed/cancelled) (Required)
+ * cancellation (Optional): {
+ * requested_by: String (Required)
+ * mode: String (Required)
+ * requested_at: long (Required)
+ * revision: long (Required)
+ * }
+ * retry_policy (Required): {
+ * type: String(fixed_interval) (Required)
+ * max_attempts: int (Required)
+ * }
+ * attempt_count: int (Required)
+ * next_attempt_at: Long (Optional)
+ * terminal_reason: String(no_answer/no_answer_timeout/answer_failed/bridge_cancelled/bridge_failed/voice_session_configuration_invalid/connection_project_mismatch/outbound_connection_changed/outbound_connection_unavailable/telephony_binding_invalid/telephony_binding_not_found/telephony_binding_inactive/telephony_binding_changed/campaign_not_found/campaign_cancelled/campaign_completed/campaign_failed/origination_fence_not_recorded/origination_reconciliation_timeout/cancellation_reconciliation_timeout/provider_callback_timeout_cancellation_reconciliation_timeout) (Optional)
+ * revision: long (Required)
+ * created_at: long (Required)
+ * updated_at: long (Required)
+ * }
+ * }
+ *
+ *
+ * Response Headers
+ *
+ * Response Headers
+ * | Name | Type | Description |
+ * | ETag | String | The ETag response header. |
+ *
+ *
+ * @param agentName The agentName parameter.
+ * @param callJobId The callJobId parameter.
+ * @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 an outbound telephony call job
+ *
+ * Retrieves a durable direct or campaign-created outbound call job along with {@link Response} on successful
+ * completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> getTelephonyCallJobWithResponse(String agentName, String callJobId,
+ RequestOptions requestOptions) {
+ return this.serviceClient.getTelephonyCallJobWithResponseAsync(agentName, callJobId, requestOptions);
+ }
+
+ /**
+ * Cancel an outbound telephony call job
+ *
+ * Requests cancellation of a durable outbound call job. A connected call is allowed to finish.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * destination (Required): {
+ * type: String(phone_number) (Required)
+ * value: String (Required)
+ * }
+ * connection_name: String (Required)
+ * source: String (Required)
+ * purpose: String (Optional)
+ * structured_inputs (Optional): {
+ * String: BinaryData (Required)
+ * }
+ * schedule (Optional): {
+ * not_before: Long (Optional)
+ * expires_at: Long (Optional)
+ * }
+ * id: String (Required)
+ * object: String (Required)
+ * agent_name: String (Required)
+ * status: String(accepted/waiting_for_schedule/queued/dispatching/in_progress/waiting_for_retry/cancellation_requested/completed/blocked/expired/failed/cancelled) (Required)
+ * cancellation (Optional): {
+ * requested_by: String (Required)
+ * mode: String (Required)
+ * requested_at: long (Required)
+ * revision: long (Required)
+ * }
+ * retry_policy (Required): {
+ * type: String(fixed_interval) (Required)
+ * max_attempts: int (Required)
+ * }
+ * attempt_count: int (Required)
+ * next_attempt_at: Long (Optional)
+ * terminal_reason: String(no_answer/no_answer_timeout/answer_failed/bridge_cancelled/bridge_failed/voice_session_configuration_invalid/connection_project_mismatch/outbound_connection_changed/outbound_connection_unavailable/telephony_binding_invalid/telephony_binding_not_found/telephony_binding_inactive/telephony_binding_changed/campaign_not_found/campaign_cancelled/campaign_completed/campaign_failed/origination_fence_not_recorded/origination_reconciliation_timeout/cancellation_reconciliation_timeout/provider_callback_timeout_cancellation_reconciliation_timeout) (Optional)
+ * revision: long (Required)
+ * created_at: long (Required)
+ * updated_at: long (Required)
+ * }
+ * }
+ *
+ *
+ * Response Headers
+ *
+ * Response Headers
+ * | Name | Type | Description |
+ * | ETag | String | The ETag response header. |
+ * | Location | String | The Location response header. |
+ * | Retry-After | Duration | The Retry-After response header. |
+ *
+ *
+ * @param agentName The agentName parameter.
+ * @param callJobId The callJobId parameter.
+ * @param ifMatch The entity tag returned by the latest read. The request fails if the resource changed since that
+ * read.
+ * @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 durable direct or campaign-created outbound call intent along with {@link Response} on successful
+ * completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> cancelTelephonyCallJobWithResponse(String agentName, String callJobId,
+ String ifMatch, RequestOptions requestOptions) {
+ return this.serviceClient.cancelTelephonyCallJobWithResponseAsync(agentName, callJobId, ifMatch,
+ requestOptions);
+ }
+
+ /**
+ * Create an outbound telephony campaign
+ *
+ * Creates a draft outbound campaign. Recipients are imported and validated before the campaign can be published.
+ * Request Body Schema
+ *
+ *
+ * {@code
+ * {
+ * display_name: String (Required)
+ * connection_name: String (Required)
+ * source: String (Required)
+ * purpose: String (Optional)
+ * schedule (Optional): {
+ * type: String(immediate/scheduled) (Required)
+ * start_at: Long (Optional)
+ * }
+ * retry_policy (Optional): {
+ * type: String(fixed_interval) (Required)
+ * max_attempts: Integer (Optional)
+ * }
+ * }
+ * }
+ *
+ *
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * display_name: String (Required)
+ * connection_name: String (Required)
+ * source: String (Required)
+ * purpose: String (Optional)
+ * schedule (Optional): {
+ * type: String(immediate/scheduled) (Required)
+ * start_at: Long (Optional)
+ * }
+ * id: String (Required)
+ * object: String (Required)
+ * agent_name: String (Required)
+ * configuration_status: String(draft/importing/validating/publishing/published/publish_failed) (Required)
+ * execution_status: String(none/scheduled/running/paused/completed/failed/cancelled) (Required)
+ * retry_policy (Required): {
+ * type: String(fixed_interval) (Required)
+ * max_attempts: int (Required)
+ * }
+ * latest_successful_validation_id: String (Optional)
+ * active_validation_id: String (Optional)
+ * active_recipient_import_id: String (Optional)
+ * published_at: Long (Optional)
+ * call_job_counts (Required): {
+ * total: long (Required)
+ * pending: long (Required)
+ * in_progress: long (Required)
+ * completed: long (Required)
+ * failed: long (Required)
+ * blocked: long (Required)
+ * cancelled: long (Required)
+ * expired: long (Required)
+ * }
+ * created_at: long (Required)
+ * updated_at: long (Required)
+ * }
+ * }
+ *
+ *
+ * Response Headers
+ *
+ * Response Headers
+ * | Name | Type | Description |
+ * | Location | String | The Location response header. |
+ *
+ *
+ * @param agentName The agentName parameter.
+ * @param body The body parameter.
+ * @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 durable outbound campaign owned by a voice agent along with {@link Response} on successful completion
+ * of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> createTelephonyCampaignWithResponse(String agentName, BinaryData body,
+ RequestOptions requestOptions) {
+ return this.serviceClient.createTelephonyCampaignWithResponseAsync(agentName, body, requestOptions);
+ }
+
+ /**
+ * Get an outbound telephony campaign
+ *
+ * Retrieves an outbound campaign, including configuration, execution state, and aggregate call-job counts.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * display_name: String (Required)
+ * connection_name: String (Required)
+ * source: String (Required)
+ * purpose: String (Optional)
+ * schedule (Optional): {
+ * type: String(immediate/scheduled) (Required)
+ * start_at: Long (Optional)
+ * }
+ * id: String (Required)
+ * object: String (Required)
+ * agent_name: String (Required)
+ * configuration_status: String(draft/importing/validating/publishing/published/publish_failed) (Required)
+ * execution_status: String(none/scheduled/running/paused/completed/failed/cancelled) (Required)
+ * retry_policy (Required): {
+ * type: String(fixed_interval) (Required)
+ * max_attempts: int (Required)
+ * }
+ * latest_successful_validation_id: String (Optional)
+ * active_validation_id: String (Optional)
+ * active_recipient_import_id: String (Optional)
+ * published_at: Long (Optional)
+ * call_job_counts (Required): {
+ * total: long (Required)
+ * pending: long (Required)
+ * in_progress: long (Required)
+ * completed: long (Required)
+ * failed: long (Required)
+ * blocked: long (Required)
+ * cancelled: long (Required)
+ * expired: long (Required)
+ * }
+ * created_at: long (Required)
+ * updated_at: long (Required)
+ * }
+ * }
+ *
+ *
+ * @param agentName The agentName parameter.
+ * @param campaignId The campaignId parameter.
+ * @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 an outbound telephony campaign
+ *
+ * Retrieves an outbound campaign, including configuration, execution state, and aggregate call-job counts along
+ * with {@link Response} on successful completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> getTelephonyCampaignWithResponse(String agentName, String campaignId,
+ RequestOptions requestOptions) {
+ return this.serviceClient.getTelephonyCampaignWithResponseAsync(agentName, campaignId, requestOptions);
+ }
+
+ /**
+ * Import outbound telephony campaign recipients
+ *
+ * Starts an asynchronous import of campaign recipients from a Dataset CSV, JSON array, or JSONL file.
+ * Request Body Schema
+ *
+ *
+ * {@code
+ * {
+ * source (Required): {
+ * type: String (Required)
+ * dataset_name: String (Required)
+ * dataset_version: String (Required)
+ * file_name: String (Required)
+ * format: String(csv/json/jsonl) (Required)
+ * }
+ * mapping (Optional): {
+ * destination: String (Optional)
+ * recipient_key: String (Optional)
+ * recipient_item_key: String (Optional)
+ * not_before: String (Optional)
+ * expires_at: String (Optional)
+ * }
+ * duplicate_handling: String(reject/keep_each/merge) (Optional)
+ * }
+ * }
+ *
+ *
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * id: String (Required)
+ * object: String (Required)
+ * kind: String(recipient_import/validation/publish) (Required)
+ * status: String(not_started/running/succeeded/failed/cancelled/unknown) (Required)
+ * campaign_id: String (Required)
+ * recipient_import_id: String (Optional)
+ * created_at: Long (Optional)
+ * }
+ * }
+ *
+ *
+ * @param agentName The agentName parameter.
+ * @param campaignId The campaignId parameter.
+ * @param idempotencyKey The idempotencyKey parameter.
+ * @param body The body parameter.
+ * @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 the {@link PollerFlux} for polling of an accepted outbound campaign operation.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public PollerFlux beginImportTelephonyCampaignRecipients(String agentName,
+ String campaignId, String idempotencyKey, BinaryData body, RequestOptions requestOptions) {
+ return this.serviceClient.beginImportTelephonyCampaignRecipientsAsync(agentName, campaignId, idempotencyKey,
+ body, requestOptions);
+ }
+
+ /**
+ * Get an outbound telephony campaign recipient import
+ *
+ * Retrieves the durable status and counters for a campaign recipient import.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * id: String (Required)
+ * object: String (Required)
+ * campaign_id: String (Required)
+ * status: String(running/succeeded/failed) (Required)
+ * source (Required): {
+ * type: String (Required)
+ * dataset_name: String (Required)
+ * dataset_version: String (Required)
+ * file_name: String (Required)
+ * format: String(csv/json/jsonl) (Required)
+ * }
+ * mapping (Optional): {
+ * destination: String (Required)
+ * recipient_key: String (Required)
+ * recipient_item_key: String (Optional)
+ * not_before: String (Optional)
+ * expires_at: String (Optional)
+ * }
+ * duplicate_handling: String(reject/keep_each/merge) (Required)
+ * rows_processed: long (Required)
+ * eligible_recipient_count: long (Required)
+ * invalid_recipient_count: long (Required)
+ * error_code: String (Optional)
+ * error_message: String (Optional)
+ * created_at: long (Required)
+ * updated_at: long (Required)
+ * }
+ * }
+ *
+ *
+ * @param agentName The agentName parameter.
+ * @param campaignId The campaignId parameter.
+ * @param importId The importId parameter.
+ * @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 an outbound telephony campaign recipient import
+ *
+ * Retrieves the durable status and counters for a campaign recipient import along with {@link Response} on
+ * successful completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> getTelephonyCampaignRecipientImportWithResponse(String agentName,
+ String campaignId, String importId, RequestOptions requestOptions) {
+ return this.serviceClient.getTelephonyCampaignRecipientImportWithResponseAsync(agentName, campaignId, importId,
+ requestOptions);
+ }
+
+ /**
+ * Validate an outbound telephony campaign
+ *
+ * Starts asynchronous validation of the current campaign draft and imported recipient snapshot.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * id: String (Required)
+ * object: String (Required)
+ * kind: String(recipient_import/validation/publish) (Required)
+ * status: String(not_started/running/succeeded/failed/cancelled/unknown) (Required)
+ * campaign_id: String (Required)
+ * recipient_import_id: String (Optional)
+ * created_at: Long (Optional)
+ * }
+ * }
+ *
+ *
+ * @param agentName The agentName parameter.
+ * @param campaignId The campaignId parameter.
+ * @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 the {@link PollerFlux} for polling of an accepted outbound campaign operation.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public PollerFlux beginValidateTelephonyCampaign(String agentName, String campaignId,
+ RequestOptions requestOptions) {
+ return this.serviceClient.beginValidateTelephonyCampaignAsync(agentName, campaignId, requestOptions);
+ }
+
+ /**
+ * Publish an outbound telephony campaign
+ *
+ * Permanently locks the validated campaign draft and starts asynchronous call-job materialization.
+ * Request Body Schema
+ *
+ *
+ * {@code
+ * {
+ * validation_id: String (Required)
+ * }
+ * }
+ *
+ *
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * id: String (Required)
+ * object: String (Required)
+ * kind: String(recipient_import/validation/publish) (Required)
+ * status: String(not_started/running/succeeded/failed/cancelled/unknown) (Required)
+ * campaign_id: String (Required)
+ * recipient_import_id: String (Optional)
+ * created_at: Long (Optional)
+ * }
+ * }
+ *
+ *
+ * @param agentName The agentName parameter.
+ * @param campaignId The campaignId parameter.
+ * @param body The body parameter.
+ * @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 the {@link PollerFlux} for polling of an accepted outbound campaign operation.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public PollerFlux beginPublishTelephonyCampaign(String agentName, String campaignId,
+ BinaryData body, RequestOptions requestOptions) {
+ return this.serviceClient.beginPublishTelephonyCampaignAsync(agentName, campaignId, body, requestOptions);
+ }
+
+ /**
+ * Pause an outbound telephony campaign
+ *
+ * Pauses dispatch of call jobs owned by a published campaign.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * display_name: String (Required)
+ * connection_name: String (Required)
+ * source: String (Required)
+ * purpose: String (Optional)
+ * schedule (Optional): {
+ * type: String(immediate/scheduled) (Required)
+ * start_at: Long (Optional)
+ * }
+ * id: String (Required)
+ * object: String (Required)
+ * agent_name: String (Required)
+ * configuration_status: String(draft/importing/validating/publishing/published/publish_failed) (Required)
+ * execution_status: String(none/scheduled/running/paused/completed/failed/cancelled) (Required)
+ * retry_policy (Required): {
+ * type: String(fixed_interval) (Required)
+ * max_attempts: int (Required)
+ * }
+ * latest_successful_validation_id: String (Optional)
+ * active_validation_id: String (Optional)
+ * active_recipient_import_id: String (Optional)
+ * published_at: Long (Optional)
+ * call_job_counts (Required): {
+ * total: long (Required)
+ * pending: long (Required)
+ * in_progress: long (Required)
+ * completed: long (Required)
+ * failed: long (Required)
+ * blocked: long (Required)
+ * cancelled: long (Required)
+ * expired: long (Required)
+ * }
+ * created_at: long (Required)
+ * updated_at: long (Required)
+ * }
+ * }
+ *
+ *
+ * @param agentName The agentName parameter.
+ * @param campaignId The campaignId parameter.
+ * @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 durable outbound campaign owned by a voice agent along with {@link Response} on successful completion
+ * of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> pauseTelephonyCampaignWithResponse(String agentName, String campaignId,
+ RequestOptions requestOptions) {
+ return this.serviceClient.pauseTelephonyCampaignWithResponseAsync(agentName, campaignId, requestOptions);
+ }
+
+ /**
+ * Resume an outbound telephony campaign
+ *
+ * Resumes dispatch of call jobs owned by a paused campaign.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * display_name: String (Required)
+ * connection_name: String (Required)
+ * source: String (Required)
+ * purpose: String (Optional)
+ * schedule (Optional): {
+ * type: String(immediate/scheduled) (Required)
+ * start_at: Long (Optional)
+ * }
+ * id: String (Required)
+ * object: String (Required)
+ * agent_name: String (Required)
+ * configuration_status: String(draft/importing/validating/publishing/published/publish_failed) (Required)
+ * execution_status: String(none/scheduled/running/paused/completed/failed/cancelled) (Required)
+ * retry_policy (Required): {
+ * type: String(fixed_interval) (Required)
+ * max_attempts: int (Required)
+ * }
+ * latest_successful_validation_id: String (Optional)
+ * active_validation_id: String (Optional)
+ * active_recipient_import_id: String (Optional)
+ * published_at: Long (Optional)
+ * call_job_counts (Required): {
+ * total: long (Required)
+ * pending: long (Required)
+ * in_progress: long (Required)
+ * completed: long (Required)
+ * failed: long (Required)
+ * blocked: long (Required)
+ * cancelled: long (Required)
+ * expired: long (Required)
+ * }
+ * created_at: long (Required)
+ * updated_at: long (Required)
+ * }
+ * }
+ *
+ *
+ * @param agentName The agentName parameter.
+ * @param campaignId The campaignId parameter.
+ * @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 durable outbound campaign owned by a voice agent along with {@link Response} on successful completion
+ * of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> resumeTelephonyCampaignWithResponse(String agentName, String campaignId,
+ RequestOptions requestOptions) {
+ return this.serviceClient.resumeTelephonyCampaignWithResponseAsync(agentName, campaignId, requestOptions);
+ }
+
+ /**
+ * Cancel an outbound telephony campaign
+ *
+ * Cancels a campaign and prevents any further call-job dispatch.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * display_name: String (Required)
+ * connection_name: String (Required)
+ * source: String (Required)
+ * purpose: String (Optional)
+ * schedule (Optional): {
+ * type: String(immediate/scheduled) (Required)
+ * start_at: Long (Optional)
+ * }
+ * id: String (Required)
+ * object: String (Required)
+ * agent_name: String (Required)
+ * configuration_status: String(draft/importing/validating/publishing/published/publish_failed) (Required)
+ * execution_status: String(none/scheduled/running/paused/completed/failed/cancelled) (Required)
+ * retry_policy (Required): {
+ * type: String(fixed_interval) (Required)
+ * max_attempts: int (Required)
+ * }
+ * latest_successful_validation_id: String (Optional)
+ * active_validation_id: String (Optional)
+ * active_recipient_import_id: String (Optional)
+ * published_at: Long (Optional)
+ * call_job_counts (Required): {
+ * total: long (Required)
+ * pending: long (Required)
+ * in_progress: long (Required)
+ * completed: long (Required)
+ * failed: long (Required)
+ * blocked: long (Required)
+ * cancelled: long (Required)
+ * expired: long (Required)
+ * }
+ * created_at: long (Required)
+ * updated_at: long (Required)
+ * }
+ * }
+ *
+ *
+ * @param agentName The agentName parameter.
+ * @param campaignId The campaignId parameter.
+ * @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 durable outbound campaign owned by a voice agent along with {@link Response} on successful completion
+ * of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> cancelTelephonyCampaignWithResponse(String agentName, String campaignId,
+ RequestOptions requestOptions) {
+ return this.serviceClient.cancelTelephonyCampaignWithResponseAsync(agentName, campaignId, requestOptions);
+ }
+
+ /**
+ * Get an outbound telephony operation
+ *
+ * Retrieves an asynchronous outbound campaign operation.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * id: String (Required)
+ * object: String (Required)
+ * status: String(not_started/running/succeeded/failed/cancelled/unknown) (Required)
+ * created_at: Long (Optional)
+ * error (Optional): {
+ * code: String (Required)
+ * message: String (Required)
+ * param: String (Optional)
+ * type: String (Optional)
+ * details (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * additionalInfo (Optional): {
+ * String: BinaryData (Required)
+ * }
+ * debugInfo (Optional): {
+ * String: BinaryData (Required)
+ * }
+ * }
+ * resource (Optional): {
+ * id: String (Required)
+ * type: String (Required)
+ * }
+ * }
+ * }
+ *
+ *
+ * @param agentName The agentName parameter.
+ * @param operationId The operationId parameter.
+ * @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 an outbound telephony operation
+ *
+ * Retrieves an asynchronous outbound campaign operation along with {@link Response} on successful completion of
+ * {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> getTelephonyOperationWithResponse(String agentName, String operationId,
+ RequestOptions requestOptions) {
+ return this.serviceClient.getTelephonyOperationWithResponseAsync(agentName, operationId, requestOptions);
+ }
+
+ /**
+ * Create an agent telephony binding
+ *
+ * Creates a telephony binding for the voice agent named in the path.
+ *
+ * @param agentName The name of the voice agent that owns the binding.
+ * @param telephonyBinding The provider-specific binding to create.
+ * @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 telephony binding owned by a voice agent on successful completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono createTelephonyBinding(String agentName,
+ CreateTelephonyBindingRequest telephonyBinding) {
+ // Generated convenience method for createTelephonyBindingWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ return createTelephonyBindingWithResponse(agentName, BinaryData.fromObject(telephonyBinding), requestOptions)
+ .flatMap(FluxUtil::toMono)
+ .map(protocolMethodData -> protocolMethodData.toObject(TelephonyBinding.class));
+ }
+
+ /**
+ * List agent telephony bindings
+ *
+ * Returns the telephony bindings owned by the voice agent named in the path.
+ *
+ * @param agentName The name of the voice agent whose bindings are listed.
+ * @param provider Filters bindings by provider.
+ * @param status Filters bindings by lifecycle status.
+ * @param limit A limit on the number of objects to be returned. Limit can range between 1 and 100, and the
+ * default is 20.
+ * @param order Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`
+ * for descending order.
+ * @param after A cursor for use in pagination. `after` is an object ID that defines your place in the list.
+ * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your
+ * subsequent call can include after=obj_foo in order to fetch the next page of the list.
+ * @param before A cursor for use in pagination. `before` is an object ID that defines your place in the list.
+ * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your
+ * subsequent call can include before=obj_foo in order to fetch the previous page of the list.
+ * @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 the response data for a requested list of items as paginated response with {@link PagedFlux}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedFlux listTelephonyBindings(String agentName, TelephonyProvider provider,
+ TelephonyBindingStatus status, Integer limit, PageOrder order, String after, String before) {
+ // Generated convenience method for listTelephonyBindings
+ RequestOptions requestOptions = new RequestOptions();
+ if (provider != null) {
+ requestOptions.addQueryParam("provider", provider.toString(), false);
+ }
+ if (status != null) {
+ requestOptions.addQueryParam("status", status.toString(), false);
+ }
+ if (limit != null) {
+ requestOptions.addQueryParam("limit", String.valueOf(limit), false);
+ }
+ if (order != null) {
+ requestOptions.addQueryParam("order", order.toString(), false);
+ }
+ if (after != null) {
+ requestOptions.addQueryParam("after", after, false);
+ }
+ if (before != null) {
+ requestOptions.addQueryParam("before", before, false);
+ }
+ PagedFlux pagedFluxResponse = listTelephonyBindings(agentName, requestOptions);
+ return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> {
+ Flux> flux = (continuationTokenParam == null)
+ ? pagedFluxResponse.byPage().take(1)
+ : pagedFluxResponse.byPage(continuationTokenParam).take(1);
+ return flux
+ .map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(),
+ pagedResponse.getStatusCode(), pagedResponse.getHeaders(),
+ pagedResponse.getValue()
+ .stream()
+ .map(protocolMethodData -> protocolMethodData.toObject(TelephonyBindingListItem.class))
+ .collect(Collectors.toList()),
+ pagedResponse.getContinuationToken(), null));
+ });
+ }
+
+ /**
+ * List agent telephony bindings
+ *
+ * Returns the telephony bindings owned by the voice agent named in the path.
+ *
+ * @param agentName The name of the voice agent whose bindings are listed.
+ * @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 the response data for a requested list of items as paginated response with {@link PagedFlux}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedFlux listTelephonyBindings(String agentName) {
+ // Generated convenience method for listTelephonyBindings
+ RequestOptions requestOptions = new RequestOptions();
+ PagedFlux pagedFluxResponse = listTelephonyBindings(agentName, requestOptions);
+ return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> {
+ Flux> flux = (continuationTokenParam == null)
+ ? pagedFluxResponse.byPage().take(1)
+ : pagedFluxResponse.byPage(continuationTokenParam).take(1);
+ return flux
+ .map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(),
+ pagedResponse.getStatusCode(), pagedResponse.getHeaders(),
+ pagedResponse.getValue()
+ .stream()
+ .map(protocolMethodData -> protocolMethodData.toObject(TelephonyBindingListItem.class))
+ .collect(Collectors.toList()),
+ pagedResponse.getContinuationToken(), null));
+ });
+ }
+
+ /**
+ * Get an agent telephony binding
+ *
+ * Retrieves a telephony binding owned by the voice agent named in the path.
+ *
+ * @param agentName The name of the voice agent that owns the binding.
+ * @param bindingId The service-generated binding identifier.
+ * @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 an agent telephony binding
+ *
+ * Retrieves a telephony binding owned by the voice agent named in the path on successful completion of
+ * {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono getTelephonyBinding(String agentName, String bindingId) {
+ // Generated convenience method for getTelephonyBindingWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ return getTelephonyBindingWithResponse(agentName, bindingId, requestOptions).flatMap(FluxUtil::toMono)
+ .map(protocolMethodData -> protocolMethodData.toObject(TelephonyBinding.class));
+ }
+
+ /**
+ * Update an agent telephony binding
+ *
+ * Updates a telephony binding owned by the voice agent named in the path.
+ *
+ * @param agentName The name of the voice agent that owns the binding.
+ * @param bindingId The service-generated binding identifier.
+ * @param ifMatch The entity tag returned by the latest read. The request fails if the resource changed since that
+ * read.
+ * @param body The binding properties to update.
+ * @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 telephony binding owned by a voice agent on successful completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono updateTelephonyBinding(String agentName, String bindingId, String ifMatch,
+ UpdateTelephonyBindingRequest body) {
+ // Generated convenience method for updateTelephonyBindingWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ JsonMergePatchHelper.getUpdateTelephonyBindingRequestAccessor().prepareModelForJsonMergePatch(body, true);
+ BinaryData bodyInBinaryData = BinaryData.fromObject(body);
+ // BinaryData.fromObject() will not fire serialization, use getLength() to fire serialization.
+ bodyInBinaryData.getLength();
+ JsonMergePatchHelper.getUpdateTelephonyBindingRequestAccessor().prepareModelForJsonMergePatch(body, false);
+ return updateTelephonyBindingWithResponse(agentName, bindingId, ifMatch, bodyInBinaryData, requestOptions)
+ .flatMap(FluxUtil::toMono)
+ .map(protocolMethodData -> protocolMethodData.toObject(TelephonyBinding.class));
+ }
+
+ /**
+ * Delete an agent telephony binding
+ *
+ * Deletes a telephony binding owned by the voice agent named in the path.
+ *
+ * @param agentName The name of the voice agent that owns the binding.
+ * @param bindingId The service-generated binding identifier.
+ * @param ifMatch The entity tag returned by the latest read. The request fails if the resource changed since that
+ * read.
+ * @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 {@link Mono} that completes when a successful response is received.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono deleteTelephonyBinding(String agentName, String bindingId, String ifMatch) {
+ // Generated convenience method for deleteTelephonyBindingWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ return deleteTelephonyBindingWithResponse(agentName, bindingId, ifMatch, requestOptions)
+ .flatMap(FluxUtil::toMono);
+ }
+
+ /**
+ * List agent telephony calls
+ *
+ * Returns the durable inbound call history for the voice agent named in the path.
+ *
+ * @param agentName The name of the voice agent whose calls are listed.
+ * @param provider Filters calls by provider.
+ * @param status Filters calls by lifecycle status.
+ * @param startedAfter Includes calls that started at or after this Unix timestamp in seconds.
+ * @param startedBefore Includes calls that started at or before this Unix timestamp in seconds.
+ * @param limit A limit on the number of objects to be returned. Limit can range between 1 and 100, and the
+ * default is 20.
+ * @param order Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`
+ * for descending order.
+ * @param after A cursor for use in pagination. `after` is an object ID that defines your place in the list.
+ * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your
+ * subsequent call can include after=obj_foo in order to fetch the next page of the list.
+ * @param before A cursor for use in pagination. `before` is an object ID that defines your place in the list.
+ * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your
+ * subsequent call can include before=obj_foo in order to fetch the previous page of the list.
+ * @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 the response data for a requested list of items as paginated response with {@link PagedFlux}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedFlux listTelephonyCalls(String agentName, TelephonyProvider provider,
+ TelephonyCallStatus status, OffsetDateTime startedAfter, OffsetDateTime startedBefore, Integer limit,
+ PageOrder order, String after, String before) {
+ // Generated convenience method for listTelephonyCalls
+ RequestOptions requestOptions = new RequestOptions();
+ if (provider != null) {
+ requestOptions.addQueryParam("provider", provider.toString(), false);
+ }
+ if (status != null) {
+ requestOptions.addQueryParam("status", status.toString(), false);
+ }
+ if (startedAfter != null) {
+ requestOptions.addQueryParam("started_after", String.valueOf(startedAfter.toEpochSecond()), false);
+ }
+ if (startedBefore != null) {
+ requestOptions.addQueryParam("started_before", String.valueOf(startedBefore.toEpochSecond()), false);
+ }
+ if (limit != null) {
+ requestOptions.addQueryParam("limit", String.valueOf(limit), false);
+ }
+ if (order != null) {
+ requestOptions.addQueryParam("order", order.toString(), false);
+ }
+ if (after != null) {
+ requestOptions.addQueryParam("after", after, false);
+ }
+ if (before != null) {
+ requestOptions.addQueryParam("before", before, false);
+ }
+ PagedFlux pagedFluxResponse = listTelephonyCalls(agentName, requestOptions);
+ return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> {
+ Flux> flux = (continuationTokenParam == null)
+ ? pagedFluxResponse.byPage().take(1)
+ : pagedFluxResponse.byPage(continuationTokenParam).take(1);
+ return flux
+ .map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(),
+ pagedResponse.getStatusCode(), pagedResponse.getHeaders(),
+ pagedResponse.getValue()
+ .stream()
+ .map(protocolMethodData -> protocolMethodData.toObject(TelephonyCallSummary.class))
+ .collect(Collectors.toList()),
+ pagedResponse.getContinuationToken(), null));
+ });
+ }
+
+ /**
+ * List agent telephony calls
+ *
+ * Returns the durable inbound call history for the voice agent named in the path.
+ *
+ * @param agentName The name of the voice agent whose calls are listed.
+ * @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 the response data for a requested list of items as paginated response with {@link PagedFlux}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedFlux listTelephonyCalls(String agentName) {
+ // Generated convenience method for listTelephonyCalls
+ RequestOptions requestOptions = new RequestOptions();
+ PagedFlux pagedFluxResponse = listTelephonyCalls(agentName, requestOptions);
+ return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> {
+ Flux> flux = (continuationTokenParam == null)
+ ? pagedFluxResponse.byPage().take(1)
+ : pagedFluxResponse.byPage(continuationTokenParam).take(1);
+ return flux
+ .map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(),
+ pagedResponse.getStatusCode(), pagedResponse.getHeaders(),
+ pagedResponse.getValue()
+ .stream()
+ .map(protocolMethodData -> protocolMethodData.toObject(TelephonyCallSummary.class))
+ .collect(Collectors.toList()),
+ pagedResponse.getContinuationToken(), null));
+ });
+ }
+
+ /**
+ * Get an agent telephony call
+ *
+ * Retrieves a durable inbound call record owned by the voice agent named in the path.
+ *
+ * @param agentName The name of the voice agent that owns the call record.
+ * @param callId The service-generated call identifier.
+ * @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 an agent telephony call
+ *
+ * Retrieves a durable inbound call record owned by the voice agent named in the path on successful completion of
+ * {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono getTelephonyCall(String agentName, String callId) {
+ // Generated convenience method for getTelephonyCallWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ return getTelephonyCallWithResponse(agentName, callId, requestOptions).flatMap(FluxUtil::toMono)
+ .map(protocolMethodData -> protocolMethodData.toObject(TelephonyCallRecord.class));
+ }
+
+ /**
+ * Transfer an active agent telephony call
+ *
+ * Transfers an active inbound call to a configured target for the voice agent named in the path.
+ *
+ * @param agentName The name of the voice agent that owns the active call.
+ * @param callId The service-generated call identifier.
+ * @param target The name of a transfer target configured for the voice agent.
+ * @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 detailed diagnostics for a durable inbound call to a voice agent on successful completion of
+ * {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono transferTelephonyCall(String agentName, String callId, String target) {
+ // Generated convenience method for transferTelephonyCallWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ TransferTelephonyCallRequest transferTelephonyCallRequestObj = new TransferTelephonyCallRequest(target);
+ BinaryData transferTelephonyCallRequest = BinaryData.fromObject(transferTelephonyCallRequestObj);
+ return transferTelephonyCallWithResponse(agentName, callId, transferTelephonyCallRequest, requestOptions)
+ .flatMap(FluxUtil::toMono)
+ .map(protocolMethodData -> protocolMethodData.toObject(TelephonyCallRecord.class));
+ }
+
+ /**
+ * End an active agent telephony call
+ *
+ * Ends an active inbound call owned by the voice agent named in the path.
+ *
+ * @param agentName The name of the voice agent that owns the active call.
+ * @param callId The service-generated call identifier.
+ * @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 detailed diagnostics for a durable inbound call to a voice agent on successful completion of
+ * {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono endTelephonyCall(String agentName, String callId) {
+ // Generated convenience method for endTelephonyCallWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ return endTelephonyCallWithResponse(agentName, callId, requestOptions).flatMap(FluxUtil::toMono)
+ .map(protocolMethodData -> protocolMethodData.toObject(TelephonyCallRecord.class));
+ }
+
+ /**
+ * Get agent telephony transfer targets
+ *
+ * Returns all transfer targets configured for the voice agent named in the path.
+ *
+ * @param agentName The name of the voice agent whose transfer targets are retrieved.
+ * @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 agent telephony transfer targets
+ *
+ * Returns all transfer targets configured for the voice agent named in the path on successful completion of
+ * {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono getTelephonyTransferTargets(String agentName) {
+ // Generated convenience method for getTelephonyTransferTargetsWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ return getTelephonyTransferTargetsWithResponse(agentName, requestOptions).flatMap(FluxUtil::toMono)
+ .map(protocolMethodData -> protocolMethodData.toObject(TelephonyTransferTargets.class));
+ }
+
+ /**
+ * Replace agent telephony transfer targets
+ *
+ * Replaces all transfer targets configured for the voice agent named in the path.
+ *
+ * @param agentName The name of the voice agent whose transfer targets are replaced.
+ * @param ifMatch The entity tag returned by the latest read. The request fails if the resource changed since that
+ * read.
+ * @param transferTargets The complete set of destinations to which the voice agent may transfer calls. An empty
+ * array clears all targets when replacing the configuration.
+ * @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 the telephony transfer targets configured for one voice agent on successful completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono replaceTelephonyTransferTargets(String agentName, String ifMatch,
+ List transferTargets) {
+ // Generated convenience method for replaceTelephonyTransferTargetsWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ ReplaceTelephonyTransferTargetsRequest replaceTelephonyTransferTargetsRequestObj
+ = new ReplaceTelephonyTransferTargetsRequest(transferTargets);
+ BinaryData replaceTelephonyTransferTargetsRequest
+ = BinaryData.fromObject(replaceTelephonyTransferTargetsRequestObj);
+ return replaceTelephonyTransferTargetsWithResponse(agentName, ifMatch, replaceTelephonyTransferTargetsRequest,
+ requestOptions).flatMap(FluxUtil::toMono)
+ .map(protocolMethodData -> protocolMethodData.toObject(TelephonyTransferTargets.class));
+ }
+
+ /**
+ * Create an outbound telephony call job
+ *
+ * Creates one durable direct outbound call job. The latest agent definition is resolved when each attempt executes.
+ *
+ * @param agentName The name of the voice agent that executes the call.
+ * @param idempotencyKey A customer-generated idempotency key. Reusing it with an equivalent request returns the
+ * same call job.
+ * @param body The direct outbound call to create.
+ * @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 durable direct or campaign-created outbound call intent on successful completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono createTelephonyCallJob(String agentName, String idempotencyKey,
+ CreateTelephonyCallJobRequest body) {
+ // Generated convenience method for createTelephonyCallJobWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ return createTelephonyCallJobWithResponse(agentName, idempotencyKey, BinaryData.fromObject(body),
+ requestOptions).flatMap(FluxUtil::toMono)
+ .map(protocolMethodData -> protocolMethodData.toObject(TelephonyCallJob.class));
+ }
+
+ /**
+ * Get an outbound telephony call job
+ *
+ * Retrieves a durable direct or campaign-created outbound call job.
+ *
+ * @param agentName The agentName parameter.
+ * @param callJobId The callJobId parameter.
+ * @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 an outbound telephony call job
+ *
+ * Retrieves a durable direct or campaign-created outbound call job on successful completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono getTelephonyCallJob(String agentName, String callJobId) {
+ // Generated convenience method for getTelephonyCallJobWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ return getTelephonyCallJobWithResponse(agentName, callJobId, requestOptions).flatMap(FluxUtil::toMono)
+ .map(protocolMethodData -> protocolMethodData.toObject(TelephonyCallJob.class));
+ }
+
+ /**
+ * Cancel an outbound telephony call job
+ *
+ * Requests cancellation of a durable outbound call job. A connected call is allowed to finish.
+ *
+ * @param agentName The agentName parameter.
+ * @param callJobId The callJobId parameter.
+ * @param ifMatch The entity tag returned by the latest read. The request fails if the resource changed since that
+ * read.
+ * @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 durable direct or campaign-created outbound call intent on successful completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono cancelTelephonyCallJob(String agentName, String callJobId, String ifMatch) {
+ // Generated convenience method for cancelTelephonyCallJobWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ return cancelTelephonyCallJobWithResponse(agentName, callJobId, ifMatch, requestOptions)
+ .flatMap(FluxUtil::toMono)
+ .map(protocolMethodData -> protocolMethodData.toObject(TelephonyCallJob.class));
+ }
+
+ /**
+ * Create an outbound telephony campaign
+ *
+ * Creates a draft outbound campaign. Recipients are imported and validated before the campaign can be published.
+ *
+ * @param agentName The agentName parameter.
+ * @param body The body parameter.
+ * @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 durable outbound campaign owned by a voice agent on successful completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono createTelephonyCampaign(String agentName, CreateTelephonyCampaignRequest body) {
+ // Generated convenience method for createTelephonyCampaignWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ return createTelephonyCampaignWithResponse(agentName, BinaryData.fromObject(body), requestOptions)
+ .flatMap(FluxUtil::toMono)
+ .map(protocolMethodData -> protocolMethodData.toObject(TelephonyCampaign.class));
+ }
+
+ /**
+ * Get an outbound telephony campaign
+ *
+ * Retrieves an outbound campaign, including configuration, execution state, and aggregate call-job counts.
+ *
+ * @param agentName The agentName parameter.
+ * @param campaignId The campaignId parameter.
+ * @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 an outbound telephony campaign
+ *
+ * Retrieves an outbound campaign, including configuration, execution state, and aggregate call-job counts on
+ * successful completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono getTelephonyCampaign(String agentName, String campaignId) {
+ // Generated convenience method for getTelephonyCampaignWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ return getTelephonyCampaignWithResponse(agentName, campaignId, requestOptions).flatMap(FluxUtil::toMono)
+ .map(protocolMethodData -> protocolMethodData.toObject(TelephonyCampaign.class));
+ }
+
+ /**
+ * Import outbound telephony campaign recipients
+ *
+ * Starts an asynchronous import of campaign recipients from a Dataset CSV, JSON array, or JSONL file.
+ *
+ * @param agentName The agentName parameter.
+ * @param campaignId The campaignId parameter.
+ * @param idempotencyKey The idempotencyKey parameter.
+ * @param body The body parameter.
+ * @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 the {@link PollerFlux} for polling of an accepted outbound campaign operation.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public PollerFlux beginImportTelephonyCampaignRecipients(
+ String agentName, String campaignId, String idempotencyKey, ImportTelephonyCampaignRecipientsRequest body) {
+ // Generated convenience method for beginImportTelephonyCampaignRecipientsWithModel
+ RequestOptions requestOptions = new RequestOptions();
+ return serviceClient.beginImportTelephonyCampaignRecipientsWithModelAsync(agentName, campaignId, idempotencyKey,
+ BinaryData.fromObject(body), requestOptions);
+ }
+
+ /**
+ * Get an outbound telephony campaign recipient import
+ *
+ * Retrieves the durable status and counters for a campaign recipient import.
+ *
+ * @param agentName The agentName parameter.
+ * @param campaignId The campaignId parameter.
+ * @param importId The importId parameter.
+ * @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 an outbound telephony campaign recipient import
+ *
+ * Retrieves the durable status and counters for a campaign recipient import on successful completion of
+ * {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono getTelephonyCampaignRecipientImport(String agentName,
+ String campaignId, String importId) {
+ // Generated convenience method for getTelephonyCampaignRecipientImportWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ return getTelephonyCampaignRecipientImportWithResponse(agentName, campaignId, importId, requestOptions)
+ .flatMap(FluxUtil::toMono)
+ .map(protocolMethodData -> protocolMethodData.toObject(TelephonyCampaignRecipientImport.class));
+ }
+
+ /**
+ * Validate an outbound telephony campaign
+ *
+ * Starts asynchronous validation of the current campaign draft and imported recipient snapshot.
+ *
+ * @param agentName The agentName parameter.
+ * @param campaignId The campaignId parameter.
+ * @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 the {@link PollerFlux} for polling of an accepted outbound campaign operation.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public PollerFlux beginValidateTelephonyCampaign(String agentName,
+ String campaignId) {
+ // Generated convenience method for beginValidateTelephonyCampaignWithModel
+ RequestOptions requestOptions = new RequestOptions();
+ return serviceClient.beginValidateTelephonyCampaignWithModelAsync(agentName, campaignId, requestOptions);
+ }
+
+ /**
+ * Publish an outbound telephony campaign
+ *
+ * Permanently locks the validated campaign draft and starts asynchronous call-job materialization.
+ *
+ * @param agentName The agentName parameter.
+ * @param campaignId The campaignId parameter.
+ * @param body The body parameter.
+ * @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 the {@link PollerFlux} for polling of an accepted outbound campaign operation.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public PollerFlux beginPublishTelephonyCampaign(String agentName,
+ String campaignId, PublishTelephonyCampaignRequest body) {
+ // Generated convenience method for beginPublishTelephonyCampaignWithModel
+ RequestOptions requestOptions = new RequestOptions();
+ return serviceClient.beginPublishTelephonyCampaignWithModelAsync(agentName, campaignId,
+ BinaryData.fromObject(body), requestOptions);
+ }
+
+ /**
+ * Pause an outbound telephony campaign
+ *
+ * Pauses dispatch of call jobs owned by a published campaign.
+ *
+ * @param agentName The agentName parameter.
+ * @param campaignId The campaignId parameter.
+ * @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 durable outbound campaign owned by a voice agent on successful completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono pauseTelephonyCampaign(String agentName, String campaignId) {
+ // Generated convenience method for pauseTelephonyCampaignWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ return pauseTelephonyCampaignWithResponse(agentName, campaignId, requestOptions).flatMap(FluxUtil::toMono)
+ .map(protocolMethodData -> protocolMethodData.toObject(TelephonyCampaign.class));
+ }
+
+ /**
+ * Resume an outbound telephony campaign
+ *
+ * Resumes dispatch of call jobs owned by a paused campaign.
+ *
+ * @param agentName The agentName parameter.
+ * @param campaignId The campaignId parameter.
+ * @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 durable outbound campaign owned by a voice agent on successful completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono resumeTelephonyCampaign(String agentName, String campaignId) {
+ // Generated convenience method for resumeTelephonyCampaignWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ return resumeTelephonyCampaignWithResponse(agentName, campaignId, requestOptions).flatMap(FluxUtil::toMono)
+ .map(protocolMethodData -> protocolMethodData.toObject(TelephonyCampaign.class));
+ }
+
+ /**
+ * Cancel an outbound telephony campaign
+ *
+ * Cancels a campaign and prevents any further call-job dispatch.
+ *
+ * @param agentName The agentName parameter.
+ * @param campaignId The campaignId parameter.
+ * @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 durable outbound campaign owned by a voice agent on successful completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono cancelTelephonyCampaign(String agentName, String campaignId) {
+ // Generated convenience method for cancelTelephonyCampaignWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ return cancelTelephonyCampaignWithResponse(agentName, campaignId, requestOptions).flatMap(FluxUtil::toMono)
+ .map(protocolMethodData -> protocolMethodData.toObject(TelephonyCampaign.class));
+ }
+
+ /**
+ * Get an outbound telephony operation
+ *
+ * Retrieves an asynchronous outbound campaign operation.
+ *
+ * @param agentName The agentName parameter.
+ * @param operationId The operationId parameter.
+ * @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 an outbound telephony operation
+ *
+ * Retrieves an asynchronous outbound campaign operation on successful completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono getTelephonyOperation(String agentName, String operationId) {
+ // Generated convenience method for getTelephonyOperationWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ return getTelephonyOperationWithResponse(agentName, operationId, requestOptions).flatMap(FluxUtil::toMono)
+ .map(protocolMethodData -> protocolMethodData.toObject(TelephonyOperation.class));
+ }
+}
diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/BetaVoiceAgentsTelephonyClient.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/BetaVoiceAgentsTelephonyClient.java
new file mode 100644
index 0000000000000..cd760fc3301ac
--- /dev/null
+++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/BetaVoiceAgentsTelephonyClient.java
@@ -0,0 +1,2356 @@
+// 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;
+
+import com.azure.ai.agents.implementation.BetaVoiceAgentsTelephoniesImpl;
+import com.azure.ai.agents.implementation.JsonMergePatchHelper;
+import com.azure.ai.agents.implementation.models.ReplaceTelephonyTransferTargetsRequest;
+import com.azure.ai.agents.implementation.models.TransferTelephonyCallRequest;
+import com.azure.ai.agents.implementation.utils.Beta;
+import com.azure.ai.agents.models.CreateTelephonyBindingRequest;
+import com.azure.ai.agents.models.CreateTelephonyCallJobRequest;
+import com.azure.ai.agents.models.CreateTelephonyCampaignRequest;
+import com.azure.ai.agents.models.ImportTelephonyCampaignRecipientsRequest;
+import com.azure.ai.agents.models.PageOrder;
+import com.azure.ai.agents.models.PublishTelephonyCampaignRequest;
+import com.azure.ai.agents.models.TelephonyBinding;
+import com.azure.ai.agents.models.TelephonyBindingListItem;
+import com.azure.ai.agents.models.TelephonyBindingStatus;
+import com.azure.ai.agents.models.TelephonyCallJob;
+import com.azure.ai.agents.models.TelephonyCallRecord;
+import com.azure.ai.agents.models.TelephonyCallStatus;
+import com.azure.ai.agents.models.TelephonyCallSummary;
+import com.azure.ai.agents.models.TelephonyCampaign;
+import com.azure.ai.agents.models.TelephonyCampaignRecipientImport;
+import com.azure.ai.agents.models.TelephonyOperation;
+import com.azure.ai.agents.models.TelephonyOperationResource;
+import com.azure.ai.agents.models.TelephonyProvider;
+import com.azure.ai.agents.models.TelephonyTransferTarget;
+import com.azure.ai.agents.models.TelephonyTransferTargets;
+import com.azure.ai.agents.models.UpdateTelephonyBindingRequest;
+import com.azure.core.annotation.Generated;
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceClient;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.exception.ClientAuthenticationException;
+import com.azure.core.exception.HttpResponseException;
+import com.azure.core.exception.ResourceModifiedException;
+import com.azure.core.exception.ResourceNotFoundException;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.RequestOptions;
+import com.azure.core.http.rest.Response;
+import com.azure.core.util.BinaryData;
+import com.azure.core.util.polling.SyncPoller;
+import java.time.OffsetDateTime;
+import java.util.List;
+
+/**
+ * Initializes a new instance of the synchronous AgentsClient type.
+ */
+@ServiceClient(builder = AgentsClientBuilder.class)
+@Beta(warningText = "This class is in preview and may change in future releases.")
+public final class BetaVoiceAgentsTelephonyClient {
+
+ @Generated
+ private final BetaVoiceAgentsTelephoniesImpl serviceClient;
+
+ /**
+ * Initializes an instance of BetaVoiceAgentsTelephonyClient class.
+ *
+ * @param serviceClient the service client implementation.
+ */
+ @Generated
+ BetaVoiceAgentsTelephonyClient(BetaVoiceAgentsTelephoniesImpl serviceClient) {
+ this.serviceClient = serviceClient;
+ }
+
+ /**
+ * Create an agent telephony binding
+ *
+ * Creates a telephony binding for the voice agent named in the path.
+ * Header Parameters
+ *
+ * Header Parameters
+ * | Name | Type | Required | Description |
+ * | repeatability-request-id | String | No | Repeatability request ID header |
+ * | repeatability-first-sent | String | No | Repeatability first sent header as
+ * HTTP-date |
+ *
+ * You can add these to a request with {@link RequestOptions#addHeader}
+ * Request Body Schema
+ *
+ *
+ * {@code
+ * {
+ * provider: String(teams_phone_extension/twilio) (Required)
+ * connection_name: String (Required)
+ * label: String (Optional)
+ * }
+ * }
+ *
+ *
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * provider: String(teams_phone_extension/twilio) (Required)
+ * id: String (Required)
+ * connection_name: String (Required)
+ * label: String (Optional)
+ * status: String(active/suspended) (Required)
+ * incoming_call_url: String (Required)
+ * }
+ * }
+ *
+ *
+ * Response Headers
+ *
+ * Response Headers
+ * | Name | Type | Description |
+ * | ETag | String | The entity tag to send in the `If-Match` header when updating or deleting the
+ * binding. |
+ *
+ *
+ * @param agentName The name of the voice agent that owns the binding.
+ * @param telephonyBinding The provider-specific binding to create.
+ * @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 telephony binding owned by a voice agent along with {@link Response}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response createTelephonyBindingWithResponse(String agentName, BinaryData telephonyBinding,
+ RequestOptions requestOptions) {
+ return this.serviceClient.createTelephonyBindingWithResponse(agentName, telephonyBinding, requestOptions);
+ }
+
+ /**
+ * List agent telephony bindings
+ *
+ * Returns the telephony bindings owned by the voice agent named in the path.
+ * Query Parameters
+ *
+ * Query Parameters
+ * | Name | Type | Required | Description |
+ * | provider | String | No | Filters bindings by provider. Allowed values:
+ * "teams_phone_extension", "twilio". |
+ * | status | String | No | Filters bindings by lifecycle status. Allowed values: "active",
+ * "suspended". |
+ * | limit | Integer | No | A limit on the number of objects to be returned. Limit can range
+ * between 1 and 100, and the
+ * default is 20. |
+ * | order | String | No | Sort order by the `created_at` timestamp of the objects. `asc`
+ * for ascending order and`desc`
+ * for descending order. Allowed values: "asc", "desc". |
+ * | after | String | No | A cursor for use in pagination. `after` is an object ID that
+ * defines your place in the list.
+ * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your
+ * subsequent call can include after=obj_foo in order to fetch the next page of the list. |
+ * | before | String | No | A cursor for use in pagination. `before` is an object ID that
+ * defines your place in the list.
+ * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your
+ * subsequent call can include before=obj_foo in order to fetch the previous page of the list. |
+ *
+ * You can add these to a request with {@link RequestOptions#addQueryParam}
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * provider: String(teams_phone_extension/twilio) (Required)
+ * id: String (Required)
+ * connection_name: String (Required)
+ * label: String (Optional)
+ * status: String(active/suspended) (Required)
+ * incoming_call_url: String (Required)
+ * etag: String (Required)
+ * }
+ * }
+ *
+ *
+ * @param agentName The name of the voice agent whose bindings are listed.
+ * @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 the response data for a requested list of items as paginated response with {@link PagedIterable}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listTelephonyBindings(String agentName, RequestOptions requestOptions) {
+ return this.serviceClient.listTelephonyBindings(agentName, requestOptions);
+ }
+
+ /**
+ * Get an agent telephony binding
+ *
+ * Retrieves a telephony binding owned by the voice agent named in the path.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * provider: String(teams_phone_extension/twilio) (Required)
+ * id: String (Required)
+ * connection_name: String (Required)
+ * label: String (Optional)
+ * status: String(active/suspended) (Required)
+ * incoming_call_url: String (Required)
+ * }
+ * }
+ *
+ *
+ * Response Headers
+ *
+ * Response Headers
+ * | Name | Type | Description |
+ * | ETag | String | The entity tag to send in the `If-Match` header when updating or deleting the
+ * binding. |
+ *
+ *
+ * @param agentName The name of the voice agent that owns the binding.
+ * @param bindingId The service-generated binding identifier.
+ * @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 an agent telephony binding
+ *
+ * Retrieves a telephony binding owned by the voice agent named in the path along with {@link Response}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response getTelephonyBindingWithResponse(String agentName, String bindingId,
+ RequestOptions requestOptions) {
+ return this.serviceClient.getTelephonyBindingWithResponse(agentName, bindingId, requestOptions);
+ }
+
+ /**
+ * Update an agent telephony binding
+ *
+ * Updates a telephony binding owned by the voice agent named in the path.
+ * Request Body Schema
+ *
+ *
+ * {@code
+ * {
+ * status: String(active/suspended) (Optional)
+ * label: String (Optional)
+ * connection_name: String (Optional)
+ * phone_number: String (Optional)
+ * }
+ * }
+ *
+ *
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * provider: String(teams_phone_extension/twilio) (Required)
+ * id: String (Required)
+ * connection_name: String (Required)
+ * label: String (Optional)
+ * status: String(active/suspended) (Required)
+ * incoming_call_url: String (Required)
+ * }
+ * }
+ *
+ *
+ * Response Headers
+ *
+ * Response Headers
+ * | Name | Type | Description |
+ * | ETag | String | The entity tag to send in the `If-Match` header when updating or deleting the
+ * binding. |
+ *
+ *
+ * @param agentName The name of the voice agent that owns the binding.
+ * @param bindingId The service-generated binding identifier.
+ * @param ifMatch The entity tag returned by the latest read. The request fails if the resource changed since that
+ * read.
+ * @param body The binding properties to update.
+ * @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 telephony binding owned by a voice agent along with {@link Response}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response updateTelephonyBindingWithResponse(String agentName, String bindingId, String ifMatch,
+ BinaryData body, RequestOptions requestOptions) {
+ return this.serviceClient.updateTelephonyBindingWithResponse(agentName, bindingId, ifMatch, body,
+ requestOptions);
+ }
+
+ /**
+ * Delete an agent telephony binding
+ *
+ * Deletes a telephony binding owned by the voice agent named in the path.
+ *
+ * @param agentName The name of the voice agent that owns the binding.
+ * @param bindingId The service-generated binding identifier.
+ * @param ifMatch The entity tag returned by the latest read. The request fails if the resource changed since that
+ * read.
+ * @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 the {@link Response}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response deleteTelephonyBindingWithResponse(String agentName, String bindingId, String ifMatch,
+ RequestOptions requestOptions) {
+ return this.serviceClient.deleteTelephonyBindingWithResponse(agentName, bindingId, ifMatch, requestOptions);
+ }
+
+ /**
+ * List agent telephony calls
+ *
+ * Returns the durable inbound call history for the voice agent named in the path.
+ * Query Parameters
+ *
+ * Query Parameters
+ * | Name | Type | Required | Description |
+ * | provider | String | No | Filters calls by provider. Allowed values:
+ * "teams_phone_extension", "twilio". |
+ * | status | String | No | Filters calls by lifecycle status. Allowed values:
+ * "in_progress", "success", "failed". |
+ * | started_after | OffsetDateTime | No | Includes calls that started at or after this Unix
+ * timestamp in seconds. |
+ * | started_before | OffsetDateTime | No | Includes calls that started at or before this
+ * Unix timestamp in seconds. |
+ * | limit | Integer | No | A limit on the number of objects to be returned. Limit can range
+ * between 1 and 100, and the
+ * default is 20. |
+ * | order | String | No | Sort order by the `created_at` timestamp of the objects. `asc`
+ * for ascending order and`desc`
+ * for descending order. Allowed values: "asc", "desc". |
+ * | after | String | No | A cursor for use in pagination. `after` is an object ID that
+ * defines your place in the list.
+ * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your
+ * subsequent call can include after=obj_foo in order to fetch the next page of the list. |
+ * | before | String | No | A cursor for use in pagination. `before` is an object ID that
+ * defines your place in the list.
+ * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your
+ * subsequent call can include before=obj_foo in order to fetch the previous page of the list. |
+ *
+ * You can add these to a request with {@link RequestOptions#addQueryParam}
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * id: String (Required)
+ * provider: String(teams_phone_extension/twilio) (Required)
+ * provider_call_id: String (Optional)
+ * caller_number: String (Optional)
+ * provider_number: String (Optional)
+ * status: String(in_progress/success/failed) (Required)
+ * phase: String(received/validated/admitted/answering/answered/media_connected/agent_session_ready/bridging/managing/completed/rejected/failed) (Required)
+ * started_at: long (Required)
+ * answered_at: Long (Optional)
+ * media_connected_at: Long (Optional)
+ * agent_session_ready_at: Long (Optional)
+ * ended_at: Long (Optional)
+ * duration_ms: Long (Optional)
+ * end_reason: String(invalid_webhook_payload/webhook_validation_failed/binding_not_found/binding_suspended/admission_rejected/admission_check_failed/route_agent_mismatch/invalid_binding_configuration/credential_resolution_failed/provider_resource_mismatch/endpoint_resolution_failed/ingress_setup_failed/live_call_conflict/live_call_persistence_failed/answer_failed/provider_disconnected/provider_busy/provider_no_answer/provider_cancelled/provider_failed/provider_stream_error/provider_stream_stopped/agent_session_connect_failed/media_stream_ended/bridge_cancelled/bridge_failed/managed_hangup/managed_transfer/manage_hangup_failed/manage_transfer_failed) (Optional)
+ * provider_status_code: Integer (Optional)
+ * provider_sub_code: Integer (Optional)
+ * provider_message: String (Optional)
+ * }
+ * }
+ *
+ *
+ * @param agentName The name of the voice agent whose calls are listed.
+ * @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 the response data for a requested list of items as paginated response with {@link PagedIterable}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listTelephonyCalls(String agentName, RequestOptions requestOptions) {
+ return this.serviceClient.listTelephonyCalls(agentName, requestOptions);
+ }
+
+ /**
+ * Get an agent telephony call
+ *
+ * Retrieves a durable inbound call record owned by the voice agent named in the path.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * id: String (Required)
+ * provider: String(teams_phone_extension/twilio) (Required)
+ * provider_call_id: String (Optional)
+ * caller_number: String (Optional)
+ * provider_number: String (Optional)
+ * status: String(in_progress/success/failed) (Required)
+ * phase: String(received/validated/admitted/answering/answered/media_connected/agent_session_ready/bridging/managing/completed/rejected/failed) (Required)
+ * started_at: long (Required)
+ * answered_at: Long (Optional)
+ * media_connected_at: Long (Optional)
+ * agent_session_ready_at: Long (Optional)
+ * ended_at: Long (Optional)
+ * duration_ms: Long (Optional)
+ * end_reason: String(invalid_webhook_payload/webhook_validation_failed/binding_not_found/binding_suspended/admission_rejected/admission_check_failed/route_agent_mismatch/invalid_binding_configuration/credential_resolution_failed/provider_resource_mismatch/endpoint_resolution_failed/ingress_setup_failed/live_call_conflict/live_call_persistence_failed/answer_failed/provider_disconnected/provider_busy/provider_no_answer/provider_cancelled/provider_failed/provider_stream_error/provider_stream_stopped/agent_session_connect_failed/media_stream_ended/bridge_cancelled/bridge_failed/managed_hangup/managed_transfer/manage_hangup_failed/manage_transfer_failed) (Optional)
+ * provider_status_code: Integer (Optional)
+ * provider_sub_code: Integer (Optional)
+ * provider_message: String (Optional)
+ * timing (Required): {
+ * received_at: Long (Optional)
+ * validated_at: Long (Optional)
+ * admitted_at: Long (Optional)
+ * answer_requested_at: Long (Optional)
+ * answered_at: Long (Optional)
+ * media_connected_at: Long (Optional)
+ * agent_session_ready_at: Long (Optional)
+ * first_caller_audio_at: Long (Optional)
+ * first_agent_audio_at: Long (Optional)
+ * ended_at: Long (Optional)
+ * duration_basis: String(answered/received) (Optional)
+ * timestamp_source: String(provider/gateway/derived) (Required)
+ * }
+ * trace (Optional): {
+ * status: String(pending/emitting/available/not_recorded/not_applicable/failed) (Required)
+ * trace_id: String (Optional)
+ * root_span_id: String (Optional)
+ * conversation_id: String (Optional)
+ * mode: String(live/post_call) (Optional)
+ * }
+ * events (Required): [
+ * (Required){
+ * sequence: long (Required)
+ * name: String(telephony.webhook.received/telephony.webhook.validation/telephony.binding.resolve/telephony.provider.answer/telephony.media.connect/telephony.agent_session.connect/telephony.media.first_caller_audio/telephony.media.first_agent_audio/telephony.call.transfer/telephony.call.hangup/telephony.call.disconnect) (Required)
+ * source: String(gateway/teams_phone_extension/twilio/voice_agent) (Required)
+ * outcome: String(observed/started/succeeded/failed/rejected/cancelled) (Required)
+ * observed_at: long (Required)
+ * occurred_at: Long (Optional)
+ * timestamp_source: String(provider/gateway/derived) (Required)
+ * reason: String(invalid_webhook_payload/webhook_validation_failed/binding_not_found/binding_suspended/admission_rejected/admission_check_failed/route_agent_mismatch/invalid_binding_configuration/credential_resolution_failed/provider_resource_mismatch/endpoint_resolution_failed/ingress_setup_failed/live_call_conflict/live_call_persistence_failed/answer_failed/provider_disconnected/provider_busy/provider_no_answer/provider_cancelled/provider_failed/provider_stream_error/provider_stream_stopped/agent_session_connect_failed/media_stream_ended/bridge_cancelled/bridge_failed/managed_hangup/managed_transfer/manage_hangup_failed/manage_transfer_failed) (Optional)
+ * provider_event_id: String (Optional)
+ * provider_sequence: Long (Optional)
+ * provider_status_code: Integer (Optional)
+ * provider_sub_code: Integer (Optional)
+ * }
+ * ]
+ * events_truncated: boolean (Required)
+ * }
+ * }
+ *
+ *
+ * @param agentName The name of the voice agent that owns the call record.
+ * @param callId The service-generated call identifier.
+ * @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 an agent telephony call
+ *
+ * Retrieves a durable inbound call record owned by the voice agent named in the path along with {@link Response}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response getTelephonyCallWithResponse(String agentName, String callId,
+ RequestOptions requestOptions) {
+ return this.serviceClient.getTelephonyCallWithResponse(agentName, callId, requestOptions);
+ }
+
+ /**
+ * Transfer an active agent telephony call
+ *
+ * Transfers an active inbound call to a configured target for the voice agent named in the path.
+ * Request Body Schema
+ *
+ *
+ * {@code
+ * {
+ * target: String (Required)
+ * }
+ * }
+ *
+ *
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * id: String (Required)
+ * provider: String(teams_phone_extension/twilio) (Required)
+ * provider_call_id: String (Optional)
+ * caller_number: String (Optional)
+ * provider_number: String (Optional)
+ * status: String(in_progress/success/failed) (Required)
+ * phase: String(received/validated/admitted/answering/answered/media_connected/agent_session_ready/bridging/managing/completed/rejected/failed) (Required)
+ * started_at: long (Required)
+ * answered_at: Long (Optional)
+ * media_connected_at: Long (Optional)
+ * agent_session_ready_at: Long (Optional)
+ * ended_at: Long (Optional)
+ * duration_ms: Long (Optional)
+ * end_reason: String(invalid_webhook_payload/webhook_validation_failed/binding_not_found/binding_suspended/admission_rejected/admission_check_failed/route_agent_mismatch/invalid_binding_configuration/credential_resolution_failed/provider_resource_mismatch/endpoint_resolution_failed/ingress_setup_failed/live_call_conflict/live_call_persistence_failed/answer_failed/provider_disconnected/provider_busy/provider_no_answer/provider_cancelled/provider_failed/provider_stream_error/provider_stream_stopped/agent_session_connect_failed/media_stream_ended/bridge_cancelled/bridge_failed/managed_hangup/managed_transfer/manage_hangup_failed/manage_transfer_failed) (Optional)
+ * provider_status_code: Integer (Optional)
+ * provider_sub_code: Integer (Optional)
+ * provider_message: String (Optional)
+ * timing (Required): {
+ * received_at: Long (Optional)
+ * validated_at: Long (Optional)
+ * admitted_at: Long (Optional)
+ * answer_requested_at: Long (Optional)
+ * answered_at: Long (Optional)
+ * media_connected_at: Long (Optional)
+ * agent_session_ready_at: Long (Optional)
+ * first_caller_audio_at: Long (Optional)
+ * first_agent_audio_at: Long (Optional)
+ * ended_at: Long (Optional)
+ * duration_basis: String(answered/received) (Optional)
+ * timestamp_source: String(provider/gateway/derived) (Required)
+ * }
+ * trace (Optional): {
+ * status: String(pending/emitting/available/not_recorded/not_applicable/failed) (Required)
+ * trace_id: String (Optional)
+ * root_span_id: String (Optional)
+ * conversation_id: String (Optional)
+ * mode: String(live/post_call) (Optional)
+ * }
+ * events (Required): [
+ * (Required){
+ * sequence: long (Required)
+ * name: String(telephony.webhook.received/telephony.webhook.validation/telephony.binding.resolve/telephony.provider.answer/telephony.media.connect/telephony.agent_session.connect/telephony.media.first_caller_audio/telephony.media.first_agent_audio/telephony.call.transfer/telephony.call.hangup/telephony.call.disconnect) (Required)
+ * source: String(gateway/teams_phone_extension/twilio/voice_agent) (Required)
+ * outcome: String(observed/started/succeeded/failed/rejected/cancelled) (Required)
+ * observed_at: long (Required)
+ * occurred_at: Long (Optional)
+ * timestamp_source: String(provider/gateway/derived) (Required)
+ * reason: String(invalid_webhook_payload/webhook_validation_failed/binding_not_found/binding_suspended/admission_rejected/admission_check_failed/route_agent_mismatch/invalid_binding_configuration/credential_resolution_failed/provider_resource_mismatch/endpoint_resolution_failed/ingress_setup_failed/live_call_conflict/live_call_persistence_failed/answer_failed/provider_disconnected/provider_busy/provider_no_answer/provider_cancelled/provider_failed/provider_stream_error/provider_stream_stopped/agent_session_connect_failed/media_stream_ended/bridge_cancelled/bridge_failed/managed_hangup/managed_transfer/manage_hangup_failed/manage_transfer_failed) (Optional)
+ * provider_event_id: String (Optional)
+ * provider_sequence: Long (Optional)
+ * provider_status_code: Integer (Optional)
+ * provider_sub_code: Integer (Optional)
+ * }
+ * ]
+ * events_truncated: boolean (Required)
+ * }
+ * }
+ *
+ *
+ * @param agentName The name of the voice agent that owns the active call.
+ * @param callId The service-generated call identifier.
+ * @param transferTelephonyCallRequest The transferTelephonyCallRequest parameter.
+ * @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 detailed diagnostics for a durable inbound call to a voice agent along with {@link Response}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response transferTelephonyCallWithResponse(String agentName, String callId,
+ BinaryData transferTelephonyCallRequest, RequestOptions requestOptions) {
+ return this.serviceClient.transferTelephonyCallWithResponse(agentName, callId, transferTelephonyCallRequest,
+ requestOptions);
+ }
+
+ /**
+ * End an active agent telephony call
+ *
+ * Ends an active inbound call owned by the voice agent named in the path.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * id: String (Required)
+ * provider: String(teams_phone_extension/twilio) (Required)
+ * provider_call_id: String (Optional)
+ * caller_number: String (Optional)
+ * provider_number: String (Optional)
+ * status: String(in_progress/success/failed) (Required)
+ * phase: String(received/validated/admitted/answering/answered/media_connected/agent_session_ready/bridging/managing/completed/rejected/failed) (Required)
+ * started_at: long (Required)
+ * answered_at: Long (Optional)
+ * media_connected_at: Long (Optional)
+ * agent_session_ready_at: Long (Optional)
+ * ended_at: Long (Optional)
+ * duration_ms: Long (Optional)
+ * end_reason: String(invalid_webhook_payload/webhook_validation_failed/binding_not_found/binding_suspended/admission_rejected/admission_check_failed/route_agent_mismatch/invalid_binding_configuration/credential_resolution_failed/provider_resource_mismatch/endpoint_resolution_failed/ingress_setup_failed/live_call_conflict/live_call_persistence_failed/answer_failed/provider_disconnected/provider_busy/provider_no_answer/provider_cancelled/provider_failed/provider_stream_error/provider_stream_stopped/agent_session_connect_failed/media_stream_ended/bridge_cancelled/bridge_failed/managed_hangup/managed_transfer/manage_hangup_failed/manage_transfer_failed) (Optional)
+ * provider_status_code: Integer (Optional)
+ * provider_sub_code: Integer (Optional)
+ * provider_message: String (Optional)
+ * timing (Required): {
+ * received_at: Long (Optional)
+ * validated_at: Long (Optional)
+ * admitted_at: Long (Optional)
+ * answer_requested_at: Long (Optional)
+ * answered_at: Long (Optional)
+ * media_connected_at: Long (Optional)
+ * agent_session_ready_at: Long (Optional)
+ * first_caller_audio_at: Long (Optional)
+ * first_agent_audio_at: Long (Optional)
+ * ended_at: Long (Optional)
+ * duration_basis: String(answered/received) (Optional)
+ * timestamp_source: String(provider/gateway/derived) (Required)
+ * }
+ * trace (Optional): {
+ * status: String(pending/emitting/available/not_recorded/not_applicable/failed) (Required)
+ * trace_id: String (Optional)
+ * root_span_id: String (Optional)
+ * conversation_id: String (Optional)
+ * mode: String(live/post_call) (Optional)
+ * }
+ * events (Required): [
+ * (Required){
+ * sequence: long (Required)
+ * name: String(telephony.webhook.received/telephony.webhook.validation/telephony.binding.resolve/telephony.provider.answer/telephony.media.connect/telephony.agent_session.connect/telephony.media.first_caller_audio/telephony.media.first_agent_audio/telephony.call.transfer/telephony.call.hangup/telephony.call.disconnect) (Required)
+ * source: String(gateway/teams_phone_extension/twilio/voice_agent) (Required)
+ * outcome: String(observed/started/succeeded/failed/rejected/cancelled) (Required)
+ * observed_at: long (Required)
+ * occurred_at: Long (Optional)
+ * timestamp_source: String(provider/gateway/derived) (Required)
+ * reason: String(invalid_webhook_payload/webhook_validation_failed/binding_not_found/binding_suspended/admission_rejected/admission_check_failed/route_agent_mismatch/invalid_binding_configuration/credential_resolution_failed/provider_resource_mismatch/endpoint_resolution_failed/ingress_setup_failed/live_call_conflict/live_call_persistence_failed/answer_failed/provider_disconnected/provider_busy/provider_no_answer/provider_cancelled/provider_failed/provider_stream_error/provider_stream_stopped/agent_session_connect_failed/media_stream_ended/bridge_cancelled/bridge_failed/managed_hangup/managed_transfer/manage_hangup_failed/manage_transfer_failed) (Optional)
+ * provider_event_id: String (Optional)
+ * provider_sequence: Long (Optional)
+ * provider_status_code: Integer (Optional)
+ * provider_sub_code: Integer (Optional)
+ * }
+ * ]
+ * events_truncated: boolean (Required)
+ * }
+ * }
+ *
+ *
+ * @param agentName The name of the voice agent that owns the active call.
+ * @param callId The service-generated call identifier.
+ * @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 detailed diagnostics for a durable inbound call to a voice agent along with {@link Response}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response endTelephonyCallWithResponse(String agentName, String callId,
+ RequestOptions requestOptions) {
+ return this.serviceClient.endTelephonyCallWithResponse(agentName, callId, requestOptions);
+ }
+
+ /**
+ * Get agent telephony transfer targets
+ *
+ * Returns all transfer targets configured for the voice agent named in the path.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * transfer_targets (Required): [
+ * (Required){
+ * name: String (Required)
+ * description: String (Required)
+ * destination (Required): {
+ * kind: String(pstn/teams/sip) (Required)
+ * }
+ * }
+ * ]
+ * }
+ * }
+ *
+ *
+ * Response Headers
+ *
+ * Response Headers
+ * | Name | Type | Description |
+ * | ETag | String | The entity tag to send in the `If-Match` header when replacing the transfer
+ * targets. |
+ *
+ *
+ * @param agentName The name of the voice agent whose transfer targets are retrieved.
+ * @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 agent telephony transfer targets
+ *
+ * Returns all transfer targets configured for the voice agent named in the path along with {@link Response}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response getTelephonyTransferTargetsWithResponse(String agentName,
+ RequestOptions requestOptions) {
+ return this.serviceClient.getTelephonyTransferTargetsWithResponse(agentName, requestOptions);
+ }
+
+ /**
+ * Replace agent telephony transfer targets
+ *
+ * Replaces all transfer targets configured for the voice agent named in the path.
+ * Request Body Schema
+ *
+ *
+ * {@code
+ * {
+ * transfer_targets (Required): [
+ * (Required){
+ * name: String (Required)
+ * description: String (Required)
+ * destination (Required): {
+ * kind: String(pstn/teams/sip) (Required)
+ * }
+ * }
+ * ]
+ * }
+ * }
+ *
+ *
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * transfer_targets (Required): [
+ * (Required){
+ * name: String (Required)
+ * description: String (Required)
+ * destination (Required): {
+ * kind: String(pstn/teams/sip) (Required)
+ * }
+ * }
+ * ]
+ * }
+ * }
+ *
+ *
+ * Response Headers
+ *
+ * Response Headers
+ * | Name | Type | Description |
+ * | ETag | String | The entity tag to send in the `If-Match` header when replacing the transfer
+ * targets. |
+ *
+ *
+ * @param agentName The name of the voice agent whose transfer targets are replaced.
+ * @param ifMatch The entity tag returned by the latest read. The request fails if the resource changed since that
+ * read.
+ * @param replaceTelephonyTransferTargetsRequest The replaceTelephonyTransferTargetsRequest parameter.
+ * @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 the telephony transfer targets configured for one voice agent along with {@link Response}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response replaceTelephonyTransferTargetsWithResponse(String agentName, String ifMatch,
+ BinaryData replaceTelephonyTransferTargetsRequest, RequestOptions requestOptions) {
+ return this.serviceClient.replaceTelephonyTransferTargetsWithResponse(agentName, ifMatch,
+ replaceTelephonyTransferTargetsRequest, requestOptions);
+ }
+
+ /**
+ * Create an outbound telephony call job
+ *
+ * Creates one durable direct outbound call job. The latest agent definition is resolved when each attempt executes.
+ * Request Body Schema
+ *
+ *
+ * {@code
+ * {
+ * destination (Required): {
+ * type: String(phone_number) (Required)
+ * value: String (Required)
+ * }
+ * connection_name: String (Required)
+ * source: String (Required)
+ * purpose: String (Optional)
+ * structured_inputs (Optional): {
+ * String: BinaryData (Required)
+ * }
+ * schedule (Optional): {
+ * not_before: Long (Optional)
+ * expires_at: Long (Optional)
+ * }
+ * retry_policy (Optional): {
+ * type: String(fixed_interval) (Required)
+ * max_attempts: Integer (Optional)
+ * }
+ * }
+ * }
+ *
+ *
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * destination (Required): {
+ * type: String(phone_number) (Required)
+ * value: String (Required)
+ * }
+ * connection_name: String (Required)
+ * source: String (Required)
+ * purpose: String (Optional)
+ * structured_inputs (Optional): {
+ * String: BinaryData (Required)
+ * }
+ * schedule (Optional): {
+ * not_before: Long (Optional)
+ * expires_at: Long (Optional)
+ * }
+ * id: String (Required)
+ * object: String (Required)
+ * agent_name: String (Required)
+ * status: String(accepted/waiting_for_schedule/queued/dispatching/in_progress/waiting_for_retry/cancellation_requested/completed/blocked/expired/failed/cancelled) (Required)
+ * cancellation (Optional): {
+ * requested_by: String (Required)
+ * mode: String (Required)
+ * requested_at: long (Required)
+ * revision: long (Required)
+ * }
+ * retry_policy (Required): {
+ * type: String(fixed_interval) (Required)
+ * max_attempts: int (Required)
+ * }
+ * attempt_count: int (Required)
+ * next_attempt_at: Long (Optional)
+ * terminal_reason: String(no_answer/no_answer_timeout/answer_failed/bridge_cancelled/bridge_failed/voice_session_configuration_invalid/connection_project_mismatch/outbound_connection_changed/outbound_connection_unavailable/telephony_binding_invalid/telephony_binding_not_found/telephony_binding_inactive/telephony_binding_changed/campaign_not_found/campaign_cancelled/campaign_completed/campaign_failed/origination_fence_not_recorded/origination_reconciliation_timeout/cancellation_reconciliation_timeout/provider_callback_timeout_cancellation_reconciliation_timeout) (Optional)
+ * revision: long (Required)
+ * created_at: long (Required)
+ * updated_at: long (Required)
+ * }
+ * }
+ *
+ *
+ * Response Headers
+ *
+ * Response Headers
+ * | Name | Type | Description |
+ * | ETag | String | The ETag response header. |
+ * | Location | String | The Location response header. |
+ * | Retry-After | Duration | The Retry-After response header. |
+ *
+ *
+ * @param agentName The name of the voice agent that executes the call.
+ * @param idempotencyKey A customer-generated idempotency key. Reusing it with an equivalent request returns the
+ * same call job.
+ * @param body The direct outbound call to create.
+ * @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 durable direct or campaign-created outbound call intent along with {@link Response}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response createTelephonyCallJobWithResponse(String agentName, String idempotencyKey,
+ BinaryData body, RequestOptions requestOptions) {
+ return this.serviceClient.createTelephonyCallJobWithResponse(agentName, idempotencyKey, body, requestOptions);
+ }
+
+ /**
+ * Get an outbound telephony call job
+ *
+ * Retrieves a durable direct or campaign-created outbound call job.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * destination (Required): {
+ * type: String(phone_number) (Required)
+ * value: String (Required)
+ * }
+ * connection_name: String (Required)
+ * source: String (Required)
+ * purpose: String (Optional)
+ * structured_inputs (Optional): {
+ * String: BinaryData (Required)
+ * }
+ * schedule (Optional): {
+ * not_before: Long (Optional)
+ * expires_at: Long (Optional)
+ * }
+ * id: String (Required)
+ * object: String (Required)
+ * agent_name: String (Required)
+ * status: String(accepted/waiting_for_schedule/queued/dispatching/in_progress/waiting_for_retry/cancellation_requested/completed/blocked/expired/failed/cancelled) (Required)
+ * cancellation (Optional): {
+ * requested_by: String (Required)
+ * mode: String (Required)
+ * requested_at: long (Required)
+ * revision: long (Required)
+ * }
+ * retry_policy (Required): {
+ * type: String(fixed_interval) (Required)
+ * max_attempts: int (Required)
+ * }
+ * attempt_count: int (Required)
+ * next_attempt_at: Long (Optional)
+ * terminal_reason: String(no_answer/no_answer_timeout/answer_failed/bridge_cancelled/bridge_failed/voice_session_configuration_invalid/connection_project_mismatch/outbound_connection_changed/outbound_connection_unavailable/telephony_binding_invalid/telephony_binding_not_found/telephony_binding_inactive/telephony_binding_changed/campaign_not_found/campaign_cancelled/campaign_completed/campaign_failed/origination_fence_not_recorded/origination_reconciliation_timeout/cancellation_reconciliation_timeout/provider_callback_timeout_cancellation_reconciliation_timeout) (Optional)
+ * revision: long (Required)
+ * created_at: long (Required)
+ * updated_at: long (Required)
+ * }
+ * }
+ *
+ *
+ * Response Headers
+ *
+ * Response Headers
+ * | Name | Type | Description |
+ * | ETag | String | The ETag response header. |
+ *
+ *
+ * @param agentName The agentName parameter.
+ * @param callJobId The callJobId parameter.
+ * @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 an outbound telephony call job
+ *
+ * Retrieves a durable direct or campaign-created outbound call job along with {@link Response}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response getTelephonyCallJobWithResponse(String agentName, String callJobId,
+ RequestOptions requestOptions) {
+ return this.serviceClient.getTelephonyCallJobWithResponse(agentName, callJobId, requestOptions);
+ }
+
+ /**
+ * Cancel an outbound telephony call job
+ *
+ * Requests cancellation of a durable outbound call job. A connected call is allowed to finish.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * destination (Required): {
+ * type: String(phone_number) (Required)
+ * value: String (Required)
+ * }
+ * connection_name: String (Required)
+ * source: String (Required)
+ * purpose: String (Optional)
+ * structured_inputs (Optional): {
+ * String: BinaryData (Required)
+ * }
+ * schedule (Optional): {
+ * not_before: Long (Optional)
+ * expires_at: Long (Optional)
+ * }
+ * id: String (Required)
+ * object: String (Required)
+ * agent_name: String (Required)
+ * status: String(accepted/waiting_for_schedule/queued/dispatching/in_progress/waiting_for_retry/cancellation_requested/completed/blocked/expired/failed/cancelled) (Required)
+ * cancellation (Optional): {
+ * requested_by: String (Required)
+ * mode: String (Required)
+ * requested_at: long (Required)
+ * revision: long (Required)
+ * }
+ * retry_policy (Required): {
+ * type: String(fixed_interval) (Required)
+ * max_attempts: int (Required)
+ * }
+ * attempt_count: int (Required)
+ * next_attempt_at: Long (Optional)
+ * terminal_reason: String(no_answer/no_answer_timeout/answer_failed/bridge_cancelled/bridge_failed/voice_session_configuration_invalid/connection_project_mismatch/outbound_connection_changed/outbound_connection_unavailable/telephony_binding_invalid/telephony_binding_not_found/telephony_binding_inactive/telephony_binding_changed/campaign_not_found/campaign_cancelled/campaign_completed/campaign_failed/origination_fence_not_recorded/origination_reconciliation_timeout/cancellation_reconciliation_timeout/provider_callback_timeout_cancellation_reconciliation_timeout) (Optional)
+ * revision: long (Required)
+ * created_at: long (Required)
+ * updated_at: long (Required)
+ * }
+ * }
+ *
+ *
+ * Response Headers
+ *
+ * Response Headers
+ * | Name | Type | Description |
+ * | ETag | String | The ETag response header. |
+ * | Location | String | The Location response header. |
+ * | Retry-After | Duration | The Retry-After response header. |
+ *
+ *
+ * @param agentName The agentName parameter.
+ * @param callJobId The callJobId parameter.
+ * @param ifMatch The entity tag returned by the latest read. The request fails if the resource changed since that
+ * read.
+ * @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 durable direct or campaign-created outbound call intent along with {@link Response}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response cancelTelephonyCallJobWithResponse(String agentName, String callJobId, String ifMatch,
+ RequestOptions requestOptions) {
+ return this.serviceClient.cancelTelephonyCallJobWithResponse(agentName, callJobId, ifMatch, requestOptions);
+ }
+
+ /**
+ * Create an outbound telephony campaign
+ *
+ * Creates a draft outbound campaign. Recipients are imported and validated before the campaign can be published.
+ * Request Body Schema
+ *
+ *
+ * {@code
+ * {
+ * display_name: String (Required)
+ * connection_name: String (Required)
+ * source: String (Required)
+ * purpose: String (Optional)
+ * schedule (Optional): {
+ * type: String(immediate/scheduled) (Required)
+ * start_at: Long (Optional)
+ * }
+ * retry_policy (Optional): {
+ * type: String(fixed_interval) (Required)
+ * max_attempts: Integer (Optional)
+ * }
+ * }
+ * }
+ *
+ *
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * display_name: String (Required)
+ * connection_name: String (Required)
+ * source: String (Required)
+ * purpose: String (Optional)
+ * schedule (Optional): {
+ * type: String(immediate/scheduled) (Required)
+ * start_at: Long (Optional)
+ * }
+ * id: String (Required)
+ * object: String (Required)
+ * agent_name: String (Required)
+ * configuration_status: String(draft/importing/validating/publishing/published/publish_failed) (Required)
+ * execution_status: String(none/scheduled/running/paused/completed/failed/cancelled) (Required)
+ * retry_policy (Required): {
+ * type: String(fixed_interval) (Required)
+ * max_attempts: int (Required)
+ * }
+ * latest_successful_validation_id: String (Optional)
+ * active_validation_id: String (Optional)
+ * active_recipient_import_id: String (Optional)
+ * published_at: Long (Optional)
+ * call_job_counts (Required): {
+ * total: long (Required)
+ * pending: long (Required)
+ * in_progress: long (Required)
+ * completed: long (Required)
+ * failed: long (Required)
+ * blocked: long (Required)
+ * cancelled: long (Required)
+ * expired: long (Required)
+ * }
+ * created_at: long (Required)
+ * updated_at: long (Required)
+ * }
+ * }
+ *
+ *
+ * Response Headers
+ *
+ * Response Headers
+ * | Name | Type | Description |
+ * | Location | String | The Location response header. |
+ *
+ *
+ * @param agentName The agentName parameter.
+ * @param body The body parameter.
+ * @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 durable outbound campaign owned by a voice agent along with {@link Response}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response createTelephonyCampaignWithResponse(String agentName, BinaryData body,
+ RequestOptions requestOptions) {
+ return this.serviceClient.createTelephonyCampaignWithResponse(agentName, body, requestOptions);
+ }
+
+ /**
+ * Get an outbound telephony campaign
+ *
+ * Retrieves an outbound campaign, including configuration, execution state, and aggregate call-job counts.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * display_name: String (Required)
+ * connection_name: String (Required)
+ * source: String (Required)
+ * purpose: String (Optional)
+ * schedule (Optional): {
+ * type: String(immediate/scheduled) (Required)
+ * start_at: Long (Optional)
+ * }
+ * id: String (Required)
+ * object: String (Required)
+ * agent_name: String (Required)
+ * configuration_status: String(draft/importing/validating/publishing/published/publish_failed) (Required)
+ * execution_status: String(none/scheduled/running/paused/completed/failed/cancelled) (Required)
+ * retry_policy (Required): {
+ * type: String(fixed_interval) (Required)
+ * max_attempts: int (Required)
+ * }
+ * latest_successful_validation_id: String (Optional)
+ * active_validation_id: String (Optional)
+ * active_recipient_import_id: String (Optional)
+ * published_at: Long (Optional)
+ * call_job_counts (Required): {
+ * total: long (Required)
+ * pending: long (Required)
+ * in_progress: long (Required)
+ * completed: long (Required)
+ * failed: long (Required)
+ * blocked: long (Required)
+ * cancelled: long (Required)
+ * expired: long (Required)
+ * }
+ * created_at: long (Required)
+ * updated_at: long (Required)
+ * }
+ * }
+ *
+ *
+ * @param agentName The agentName parameter.
+ * @param campaignId The campaignId parameter.
+ * @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 an outbound telephony campaign
+ *
+ * Retrieves an outbound campaign, including configuration, execution state, and aggregate call-job counts along
+ * with {@link Response}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response getTelephonyCampaignWithResponse(String agentName, String campaignId,
+ RequestOptions requestOptions) {
+ return this.serviceClient.getTelephonyCampaignWithResponse(agentName, campaignId, requestOptions);
+ }
+
+ /**
+ * Import outbound telephony campaign recipients
+ *
+ * Starts an asynchronous import of campaign recipients from a Dataset CSV, JSON array, or JSONL file.
+ * Request Body Schema
+ *
+ *
+ * {@code
+ * {
+ * source (Required): {
+ * type: String (Required)
+ * dataset_name: String (Required)
+ * dataset_version: String (Required)
+ * file_name: String (Required)
+ * format: String(csv/json/jsonl) (Required)
+ * }
+ * mapping (Optional): {
+ * destination: String (Optional)
+ * recipient_key: String (Optional)
+ * recipient_item_key: String (Optional)
+ * not_before: String (Optional)
+ * expires_at: String (Optional)
+ * }
+ * duplicate_handling: String(reject/keep_each/merge) (Optional)
+ * }
+ * }
+ *
+ *
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * id: String (Required)
+ * object: String (Required)
+ * kind: String(recipient_import/validation/publish) (Required)
+ * status: String(not_started/running/succeeded/failed/cancelled/unknown) (Required)
+ * campaign_id: String (Required)
+ * recipient_import_id: String (Optional)
+ * created_at: Long (Optional)
+ * }
+ * }
+ *
+ *
+ * @param agentName The agentName parameter.
+ * @param campaignId The campaignId parameter.
+ * @param idempotencyKey The idempotencyKey parameter.
+ * @param body The body parameter.
+ * @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 the {@link SyncPoller} for polling of an accepted outbound campaign operation.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller beginImportTelephonyCampaignRecipients(String agentName,
+ String campaignId, String idempotencyKey, BinaryData body, RequestOptions requestOptions) {
+ return this.serviceClient.beginImportTelephonyCampaignRecipients(agentName, campaignId, idempotencyKey, body,
+ requestOptions);
+ }
+
+ /**
+ * Get an outbound telephony campaign recipient import
+ *
+ * Retrieves the durable status and counters for a campaign recipient import.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * id: String (Required)
+ * object: String (Required)
+ * campaign_id: String (Required)
+ * status: String(running/succeeded/failed) (Required)
+ * source (Required): {
+ * type: String (Required)
+ * dataset_name: String (Required)
+ * dataset_version: String (Required)
+ * file_name: String (Required)
+ * format: String(csv/json/jsonl) (Required)
+ * }
+ * mapping (Optional): {
+ * destination: String (Required)
+ * recipient_key: String (Required)
+ * recipient_item_key: String (Optional)
+ * not_before: String (Optional)
+ * expires_at: String (Optional)
+ * }
+ * duplicate_handling: String(reject/keep_each/merge) (Required)
+ * rows_processed: long (Required)
+ * eligible_recipient_count: long (Required)
+ * invalid_recipient_count: long (Required)
+ * error_code: String (Optional)
+ * error_message: String (Optional)
+ * created_at: long (Required)
+ * updated_at: long (Required)
+ * }
+ * }
+ *
+ *
+ * @param agentName The agentName parameter.
+ * @param campaignId The campaignId parameter.
+ * @param importId The importId parameter.
+ * @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 an outbound telephony campaign recipient import
+ *
+ * Retrieves the durable status and counters for a campaign recipient import along with {@link Response}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response getTelephonyCampaignRecipientImportWithResponse(String agentName, String campaignId,
+ String importId, RequestOptions requestOptions) {
+ return this.serviceClient.getTelephonyCampaignRecipientImportWithResponse(agentName, campaignId, importId,
+ requestOptions);
+ }
+
+ /**
+ * Validate an outbound telephony campaign
+ *
+ * Starts asynchronous validation of the current campaign draft and imported recipient snapshot.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * id: String (Required)
+ * object: String (Required)
+ * kind: String(recipient_import/validation/publish) (Required)
+ * status: String(not_started/running/succeeded/failed/cancelled/unknown) (Required)
+ * campaign_id: String (Required)
+ * recipient_import_id: String (Optional)
+ * created_at: Long (Optional)
+ * }
+ * }
+ *
+ *
+ * @param agentName The agentName parameter.
+ * @param campaignId The campaignId parameter.
+ * @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 the {@link SyncPoller} for polling of an accepted outbound campaign operation.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller beginValidateTelephonyCampaign(String agentName, String campaignId,
+ RequestOptions requestOptions) {
+ return this.serviceClient.beginValidateTelephonyCampaign(agentName, campaignId, requestOptions);
+ }
+
+ /**
+ * Publish an outbound telephony campaign
+ *
+ * Permanently locks the validated campaign draft and starts asynchronous call-job materialization.
+ * Request Body Schema
+ *
+ *
+ * {@code
+ * {
+ * validation_id: String (Required)
+ * }
+ * }
+ *
+ *
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * id: String (Required)
+ * object: String (Required)
+ * kind: String(recipient_import/validation/publish) (Required)
+ * status: String(not_started/running/succeeded/failed/cancelled/unknown) (Required)
+ * campaign_id: String (Required)
+ * recipient_import_id: String (Optional)
+ * created_at: Long (Optional)
+ * }
+ * }
+ *
+ *
+ * @param agentName The agentName parameter.
+ * @param campaignId The campaignId parameter.
+ * @param body The body parameter.
+ * @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 the {@link SyncPoller} for polling of an accepted outbound campaign operation.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller beginPublishTelephonyCampaign(String agentName, String campaignId,
+ BinaryData body, RequestOptions requestOptions) {
+ return this.serviceClient.beginPublishTelephonyCampaign(agentName, campaignId, body, requestOptions);
+ }
+
+ /**
+ * Pause an outbound telephony campaign
+ *
+ * Pauses dispatch of call jobs owned by a published campaign.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * display_name: String (Required)
+ * connection_name: String (Required)
+ * source: String (Required)
+ * purpose: String (Optional)
+ * schedule (Optional): {
+ * type: String(immediate/scheduled) (Required)
+ * start_at: Long (Optional)
+ * }
+ * id: String (Required)
+ * object: String (Required)
+ * agent_name: String (Required)
+ * configuration_status: String(draft/importing/validating/publishing/published/publish_failed) (Required)
+ * execution_status: String(none/scheduled/running/paused/completed/failed/cancelled) (Required)
+ * retry_policy (Required): {
+ * type: String(fixed_interval) (Required)
+ * max_attempts: int (Required)
+ * }
+ * latest_successful_validation_id: String (Optional)
+ * active_validation_id: String (Optional)
+ * active_recipient_import_id: String (Optional)
+ * published_at: Long (Optional)
+ * call_job_counts (Required): {
+ * total: long (Required)
+ * pending: long (Required)
+ * in_progress: long (Required)
+ * completed: long (Required)
+ * failed: long (Required)
+ * blocked: long (Required)
+ * cancelled: long (Required)
+ * expired: long (Required)
+ * }
+ * created_at: long (Required)
+ * updated_at: long (Required)
+ * }
+ * }
+ *
+ *
+ * @param agentName The agentName parameter.
+ * @param campaignId The campaignId parameter.
+ * @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 durable outbound campaign owned by a voice agent along with {@link Response}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response pauseTelephonyCampaignWithResponse(String agentName, String campaignId,
+ RequestOptions requestOptions) {
+ return this.serviceClient.pauseTelephonyCampaignWithResponse(agentName, campaignId, requestOptions);
+ }
+
+ /**
+ * Resume an outbound telephony campaign
+ *
+ * Resumes dispatch of call jobs owned by a paused campaign.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * display_name: String (Required)
+ * connection_name: String (Required)
+ * source: String (Required)
+ * purpose: String (Optional)
+ * schedule (Optional): {
+ * type: String(immediate/scheduled) (Required)
+ * start_at: Long (Optional)
+ * }
+ * id: String (Required)
+ * object: String (Required)
+ * agent_name: String (Required)
+ * configuration_status: String(draft/importing/validating/publishing/published/publish_failed) (Required)
+ * execution_status: String(none/scheduled/running/paused/completed/failed/cancelled) (Required)
+ * retry_policy (Required): {
+ * type: String(fixed_interval) (Required)
+ * max_attempts: int (Required)
+ * }
+ * latest_successful_validation_id: String (Optional)
+ * active_validation_id: String (Optional)
+ * active_recipient_import_id: String (Optional)
+ * published_at: Long (Optional)
+ * call_job_counts (Required): {
+ * total: long (Required)
+ * pending: long (Required)
+ * in_progress: long (Required)
+ * completed: long (Required)
+ * failed: long (Required)
+ * blocked: long (Required)
+ * cancelled: long (Required)
+ * expired: long (Required)
+ * }
+ * created_at: long (Required)
+ * updated_at: long (Required)
+ * }
+ * }
+ *
+ *
+ * @param agentName The agentName parameter.
+ * @param campaignId The campaignId parameter.
+ * @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 durable outbound campaign owned by a voice agent along with {@link Response}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response resumeTelephonyCampaignWithResponse(String agentName, String campaignId,
+ RequestOptions requestOptions) {
+ return this.serviceClient.resumeTelephonyCampaignWithResponse(agentName, campaignId, requestOptions);
+ }
+
+ /**
+ * Cancel an outbound telephony campaign
+ *
+ * Cancels a campaign and prevents any further call-job dispatch.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * display_name: String (Required)
+ * connection_name: String (Required)
+ * source: String (Required)
+ * purpose: String (Optional)
+ * schedule (Optional): {
+ * type: String(immediate/scheduled) (Required)
+ * start_at: Long (Optional)
+ * }
+ * id: String (Required)
+ * object: String (Required)
+ * agent_name: String (Required)
+ * configuration_status: String(draft/importing/validating/publishing/published/publish_failed) (Required)
+ * execution_status: String(none/scheduled/running/paused/completed/failed/cancelled) (Required)
+ * retry_policy (Required): {
+ * type: String(fixed_interval) (Required)
+ * max_attempts: int (Required)
+ * }
+ * latest_successful_validation_id: String (Optional)
+ * active_validation_id: String (Optional)
+ * active_recipient_import_id: String (Optional)
+ * published_at: Long (Optional)
+ * call_job_counts (Required): {
+ * total: long (Required)
+ * pending: long (Required)
+ * in_progress: long (Required)
+ * completed: long (Required)
+ * failed: long (Required)
+ * blocked: long (Required)
+ * cancelled: long (Required)
+ * expired: long (Required)
+ * }
+ * created_at: long (Required)
+ * updated_at: long (Required)
+ * }
+ * }
+ *
+ *
+ * @param agentName The agentName parameter.
+ * @param campaignId The campaignId parameter.
+ * @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 durable outbound campaign owned by a voice agent along with {@link Response}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response cancelTelephonyCampaignWithResponse(String agentName, String campaignId,
+ RequestOptions requestOptions) {
+ return this.serviceClient.cancelTelephonyCampaignWithResponse(agentName, campaignId, requestOptions);
+ }
+
+ /**
+ * Get an outbound telephony operation
+ *
+ * Retrieves an asynchronous outbound campaign operation.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * id: String (Required)
+ * object: String (Required)
+ * status: String(not_started/running/succeeded/failed/cancelled/unknown) (Required)
+ * created_at: Long (Optional)
+ * error (Optional): {
+ * code: String (Required)
+ * message: String (Required)
+ * param: String (Optional)
+ * type: String (Optional)
+ * details (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * additionalInfo (Optional): {
+ * String: BinaryData (Required)
+ * }
+ * debugInfo (Optional): {
+ * String: BinaryData (Required)
+ * }
+ * }
+ * resource (Optional): {
+ * id: String (Required)
+ * type: String (Required)
+ * }
+ * }
+ * }
+ *
+ *
+ * @param agentName The agentName parameter.
+ * @param operationId The operationId parameter.
+ * @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 an outbound telephony operation
+ *
+ * Retrieves an asynchronous outbound campaign operation along with {@link Response}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response getTelephonyOperationWithResponse(String agentName, String operationId,
+ RequestOptions requestOptions) {
+ return this.serviceClient.getTelephonyOperationWithResponse(agentName, operationId, requestOptions);
+ }
+
+ /**
+ * Create an agent telephony binding
+ *
+ * Creates a telephony binding for the voice agent named in the path.
+ *
+ * @param agentName The name of the voice agent that owns the binding.
+ * @param telephonyBinding The provider-specific binding to create.
+ * @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 telephony binding owned by a voice agent.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public TelephonyBinding createTelephonyBinding(String agentName, CreateTelephonyBindingRequest telephonyBinding) {
+ // Generated convenience method for createTelephonyBindingWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ return createTelephonyBindingWithResponse(agentName, BinaryData.fromObject(telephonyBinding), requestOptions)
+ .getValue()
+ .toObject(TelephonyBinding.class);
+ }
+
+ /**
+ * List agent telephony bindings
+ *
+ * Returns the telephony bindings owned by the voice agent named in the path.
+ *
+ * @param agentName The name of the voice agent whose bindings are listed.
+ * @param provider Filters bindings by provider.
+ * @param status Filters bindings by lifecycle status.
+ * @param limit A limit on the number of objects to be returned. Limit can range between 1 and 100, and the
+ * default is 20.
+ * @param order Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`
+ * for descending order.
+ * @param after A cursor for use in pagination. `after` is an object ID that defines your place in the list.
+ * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your
+ * subsequent call can include after=obj_foo in order to fetch the next page of the list.
+ * @param before A cursor for use in pagination. `before` is an object ID that defines your place in the list.
+ * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your
+ * subsequent call can include before=obj_foo in order to fetch the previous page of the list.
+ * @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 the response data for a requested list of items as paginated response with {@link PagedIterable}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listTelephonyBindings(String agentName, TelephonyProvider provider,
+ TelephonyBindingStatus status, Integer limit, PageOrder order, String after, String before) {
+ // Generated convenience method for listTelephonyBindings
+ RequestOptions requestOptions = new RequestOptions();
+ if (provider != null) {
+ requestOptions.addQueryParam("provider", provider.toString(), false);
+ }
+ if (status != null) {
+ requestOptions.addQueryParam("status", status.toString(), false);
+ }
+ if (limit != null) {
+ requestOptions.addQueryParam("limit", String.valueOf(limit), false);
+ }
+ if (order != null) {
+ requestOptions.addQueryParam("order", order.toString(), false);
+ }
+ if (after != null) {
+ requestOptions.addQueryParam("after", after, false);
+ }
+ if (before != null) {
+ requestOptions.addQueryParam("before", before, false);
+ }
+ return serviceClient.listTelephonyBindings(agentName, requestOptions)
+ .mapPage(bodyItemValue -> bodyItemValue.toObject(TelephonyBindingListItem.class));
+ }
+
+ /**
+ * List agent telephony bindings
+ *
+ * Returns the telephony bindings owned by the voice agent named in the path.
+ *
+ * @param agentName The name of the voice agent whose bindings are listed.
+ * @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 the response data for a requested list of items as paginated response with {@link PagedIterable}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listTelephonyBindings(String agentName) {
+ // Generated convenience method for listTelephonyBindings
+ RequestOptions requestOptions = new RequestOptions();
+ return serviceClient.listTelephonyBindings(agentName, requestOptions)
+ .mapPage(bodyItemValue -> bodyItemValue.toObject(TelephonyBindingListItem.class));
+ }
+
+ /**
+ * Get an agent telephony binding
+ *
+ * Retrieves a telephony binding owned by the voice agent named in the path.
+ *
+ * @param agentName The name of the voice agent that owns the binding.
+ * @param bindingId The service-generated binding identifier.
+ * @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 an agent telephony binding
+ *
+ * Retrieves a telephony binding owned by the voice agent named in the path.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public TelephonyBinding getTelephonyBinding(String agentName, String bindingId) {
+ // Generated convenience method for getTelephonyBindingWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ return getTelephonyBindingWithResponse(agentName, bindingId, requestOptions).getValue()
+ .toObject(TelephonyBinding.class);
+ }
+
+ /**
+ * Update an agent telephony binding
+ *
+ * Updates a telephony binding owned by the voice agent named in the path.
+ *
+ * @param agentName The name of the voice agent that owns the binding.
+ * @param bindingId The service-generated binding identifier.
+ * @param ifMatch The entity tag returned by the latest read. The request fails if the resource changed since that
+ * read.
+ * @param body The binding properties to update.
+ * @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 telephony binding owned by a voice agent.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public TelephonyBinding updateTelephonyBinding(String agentName, String bindingId, String ifMatch,
+ UpdateTelephonyBindingRequest body) {
+ // Generated convenience method for updateTelephonyBindingWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ JsonMergePatchHelper.getUpdateTelephonyBindingRequestAccessor().prepareModelForJsonMergePatch(body, true);
+ BinaryData bodyInBinaryData = BinaryData.fromObject(body);
+ // BinaryData.fromObject() will not fire serialization, use getLength() to fire serialization.
+ bodyInBinaryData.getLength();
+ JsonMergePatchHelper.getUpdateTelephonyBindingRequestAccessor().prepareModelForJsonMergePatch(body, false);
+ return updateTelephonyBindingWithResponse(agentName, bindingId, ifMatch, bodyInBinaryData, requestOptions)
+ .getValue()
+ .toObject(TelephonyBinding.class);
+ }
+
+ /**
+ * Delete an agent telephony binding
+ *
+ * Deletes a telephony binding owned by the voice agent named in the path.
+ *
+ * @param agentName The name of the voice agent that owns the binding.
+ * @param bindingId The service-generated binding identifier.
+ * @param ifMatch The entity tag returned by the latest read. The request fails if the resource changed since that
+ * read.
+ * @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.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public void deleteTelephonyBinding(String agentName, String bindingId, String ifMatch) {
+ // Generated convenience method for deleteTelephonyBindingWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ deleteTelephonyBindingWithResponse(agentName, bindingId, ifMatch, requestOptions).getValue();
+ }
+
+ /**
+ * List agent telephony calls
+ *
+ * Returns the durable inbound call history for the voice agent named in the path.
+ *
+ * @param agentName The name of the voice agent whose calls are listed.
+ * @param provider Filters calls by provider.
+ * @param status Filters calls by lifecycle status.
+ * @param startedAfter Includes calls that started at or after this Unix timestamp in seconds.
+ * @param startedBefore Includes calls that started at or before this Unix timestamp in seconds.
+ * @param limit A limit on the number of objects to be returned. Limit can range between 1 and 100, and the
+ * default is 20.
+ * @param order Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`
+ * for descending order.
+ * @param after A cursor for use in pagination. `after` is an object ID that defines your place in the list.
+ * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your
+ * subsequent call can include after=obj_foo in order to fetch the next page of the list.
+ * @param before A cursor for use in pagination. `before` is an object ID that defines your place in the list.
+ * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your
+ * subsequent call can include before=obj_foo in order to fetch the previous page of the list.
+ * @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 the response data for a requested list of items as paginated response with {@link PagedIterable}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listTelephonyCalls(String agentName, TelephonyProvider provider,
+ TelephonyCallStatus status, OffsetDateTime startedAfter, OffsetDateTime startedBefore, Integer limit,
+ PageOrder order, String after, String before) {
+ // Generated convenience method for listTelephonyCalls
+ RequestOptions requestOptions = new RequestOptions();
+ if (provider != null) {
+ requestOptions.addQueryParam("provider", provider.toString(), false);
+ }
+ if (status != null) {
+ requestOptions.addQueryParam("status", status.toString(), false);
+ }
+ if (startedAfter != null) {
+ requestOptions.addQueryParam("started_after", String.valueOf(startedAfter.toEpochSecond()), false);
+ }
+ if (startedBefore != null) {
+ requestOptions.addQueryParam("started_before", String.valueOf(startedBefore.toEpochSecond()), false);
+ }
+ if (limit != null) {
+ requestOptions.addQueryParam("limit", String.valueOf(limit), false);
+ }
+ if (order != null) {
+ requestOptions.addQueryParam("order", order.toString(), false);
+ }
+ if (after != null) {
+ requestOptions.addQueryParam("after", after, false);
+ }
+ if (before != null) {
+ requestOptions.addQueryParam("before", before, false);
+ }
+ return serviceClient.listTelephonyCalls(agentName, requestOptions)
+ .mapPage(bodyItemValue -> bodyItemValue.toObject(TelephonyCallSummary.class));
+ }
+
+ /**
+ * List agent telephony calls
+ *
+ * Returns the durable inbound call history for the voice agent named in the path.
+ *
+ * @param agentName The name of the voice agent whose calls are listed.
+ * @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 the response data for a requested list of items as paginated response with {@link PagedIterable}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listTelephonyCalls(String agentName) {
+ // Generated convenience method for listTelephonyCalls
+ RequestOptions requestOptions = new RequestOptions();
+ return serviceClient.listTelephonyCalls(agentName, requestOptions)
+ .mapPage(bodyItemValue -> bodyItemValue.toObject(TelephonyCallSummary.class));
+ }
+
+ /**
+ * Get an agent telephony call
+ *
+ * Retrieves a durable inbound call record owned by the voice agent named in the path.
+ *
+ * @param agentName The name of the voice agent that owns the call record.
+ * @param callId The service-generated call identifier.
+ * @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 an agent telephony call
+ *
+ * Retrieves a durable inbound call record owned by the voice agent named in the path.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public TelephonyCallRecord getTelephonyCall(String agentName, String callId) {
+ // Generated convenience method for getTelephonyCallWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ return getTelephonyCallWithResponse(agentName, callId, requestOptions).getValue()
+ .toObject(TelephonyCallRecord.class);
+ }
+
+ /**
+ * Transfer an active agent telephony call
+ *
+ * Transfers an active inbound call to a configured target for the voice agent named in the path.
+ *
+ * @param agentName The name of the voice agent that owns the active call.
+ * @param callId The service-generated call identifier.
+ * @param target The name of a transfer target configured for the voice agent.
+ * @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 detailed diagnostics for a durable inbound call to a voice agent.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public TelephonyCallRecord transferTelephonyCall(String agentName, String callId, String target) {
+ // Generated convenience method for transferTelephonyCallWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ TransferTelephonyCallRequest transferTelephonyCallRequestObj = new TransferTelephonyCallRequest(target);
+ BinaryData transferTelephonyCallRequest = BinaryData.fromObject(transferTelephonyCallRequestObj);
+ return transferTelephonyCallWithResponse(agentName, callId, transferTelephonyCallRequest, requestOptions)
+ .getValue()
+ .toObject(TelephonyCallRecord.class);
+ }
+
+ /**
+ * End an active agent telephony call
+ *
+ * Ends an active inbound call owned by the voice agent named in the path.
+ *
+ * @param agentName The name of the voice agent that owns the active call.
+ * @param callId The service-generated call identifier.
+ * @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 detailed diagnostics for a durable inbound call to a voice agent.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public TelephonyCallRecord endTelephonyCall(String agentName, String callId) {
+ // Generated convenience method for endTelephonyCallWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ return endTelephonyCallWithResponse(agentName, callId, requestOptions).getValue()
+ .toObject(TelephonyCallRecord.class);
+ }
+
+ /**
+ * Get agent telephony transfer targets
+ *
+ * Returns all transfer targets configured for the voice agent named in the path.
+ *
+ * @param agentName The name of the voice agent whose transfer targets are retrieved.
+ * @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 agent telephony transfer targets
+ *
+ * Returns all transfer targets configured for the voice agent named in the path.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public TelephonyTransferTargets getTelephonyTransferTargets(String agentName) {
+ // Generated convenience method for getTelephonyTransferTargetsWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ return getTelephonyTransferTargetsWithResponse(agentName, requestOptions).getValue()
+ .toObject(TelephonyTransferTargets.class);
+ }
+
+ /**
+ * Replace agent telephony transfer targets
+ *
+ * Replaces all transfer targets configured for the voice agent named in the path.
+ *
+ * @param agentName The name of the voice agent whose transfer targets are replaced.
+ * @param ifMatch The entity tag returned by the latest read. The request fails if the resource changed since that
+ * read.
+ * @param transferTargets The complete set of destinations to which the voice agent may transfer calls. An empty
+ * array clears all targets when replacing the configuration.
+ * @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 the telephony transfer targets configured for one voice agent.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public TelephonyTransferTargets replaceTelephonyTransferTargets(String agentName, String ifMatch,
+ List transferTargets) {
+ // Generated convenience method for replaceTelephonyTransferTargetsWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ ReplaceTelephonyTransferTargetsRequest replaceTelephonyTransferTargetsRequestObj
+ = new ReplaceTelephonyTransferTargetsRequest(transferTargets);
+ BinaryData replaceTelephonyTransferTargetsRequest
+ = BinaryData.fromObject(replaceTelephonyTransferTargetsRequestObj);
+ return replaceTelephonyTransferTargetsWithResponse(agentName, ifMatch, replaceTelephonyTransferTargetsRequest,
+ requestOptions).getValue().toObject(TelephonyTransferTargets.class);
+ }
+
+ /**
+ * Create an outbound telephony call job
+ *
+ * Creates one durable direct outbound call job. The latest agent definition is resolved when each attempt executes.
+ *
+ * @param agentName The name of the voice agent that executes the call.
+ * @param idempotencyKey A customer-generated idempotency key. Reusing it with an equivalent request returns the
+ * same call job.
+ * @param body The direct outbound call to create.
+ * @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 durable direct or campaign-created outbound call intent.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public TelephonyCallJob createTelephonyCallJob(String agentName, String idempotencyKey,
+ CreateTelephonyCallJobRequest body) {
+ // Generated convenience method for createTelephonyCallJobWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ return createTelephonyCallJobWithResponse(agentName, idempotencyKey, BinaryData.fromObject(body),
+ requestOptions).getValue().toObject(TelephonyCallJob.class);
+ }
+
+ /**
+ * Get an outbound telephony call job
+ *
+ * Retrieves a durable direct or campaign-created outbound call job.
+ *
+ * @param agentName The agentName parameter.
+ * @param callJobId The callJobId parameter.
+ * @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 an outbound telephony call job
+ *
+ * Retrieves a durable direct or campaign-created outbound call job.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public TelephonyCallJob getTelephonyCallJob(String agentName, String callJobId) {
+ // Generated convenience method for getTelephonyCallJobWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ return getTelephonyCallJobWithResponse(agentName, callJobId, requestOptions).getValue()
+ .toObject(TelephonyCallJob.class);
+ }
+
+ /**
+ * Cancel an outbound telephony call job
+ *
+ * Requests cancellation of a durable outbound call job. A connected call is allowed to finish.
+ *
+ * @param agentName The agentName parameter.
+ * @param callJobId The callJobId parameter.
+ * @param ifMatch The entity tag returned by the latest read. The request fails if the resource changed since that
+ * read.
+ * @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 durable direct or campaign-created outbound call intent.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public TelephonyCallJob cancelTelephonyCallJob(String agentName, String callJobId, String ifMatch) {
+ // Generated convenience method for cancelTelephonyCallJobWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ return cancelTelephonyCallJobWithResponse(agentName, callJobId, ifMatch, requestOptions).getValue()
+ .toObject(TelephonyCallJob.class);
+ }
+
+ /**
+ * Create an outbound telephony campaign
+ *
+ * Creates a draft outbound campaign. Recipients are imported and validated before the campaign can be published.
+ *
+ * @param agentName The agentName parameter.
+ * @param body The body parameter.
+ * @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 durable outbound campaign owned by a voice agent.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public TelephonyCampaign createTelephonyCampaign(String agentName, CreateTelephonyCampaignRequest body) {
+ // Generated convenience method for createTelephonyCampaignWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ return createTelephonyCampaignWithResponse(agentName, BinaryData.fromObject(body), requestOptions).getValue()
+ .toObject(TelephonyCampaign.class);
+ }
+
+ /**
+ * Get an outbound telephony campaign
+ *
+ * Retrieves an outbound campaign, including configuration, execution state, and aggregate call-job counts.
+ *
+ * @param agentName The agentName parameter.
+ * @param campaignId The campaignId parameter.
+ * @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 an outbound telephony campaign
+ *
+ * Retrieves an outbound campaign, including configuration, execution state, and aggregate call-job counts.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public TelephonyCampaign getTelephonyCampaign(String agentName, String campaignId) {
+ // Generated convenience method for getTelephonyCampaignWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ return getTelephonyCampaignWithResponse(agentName, campaignId, requestOptions).getValue()
+ .toObject(TelephonyCampaign.class);
+ }
+
+ /**
+ * Import outbound telephony campaign recipients
+ *
+ * Starts an asynchronous import of campaign recipients from a Dataset CSV, JSON array, or JSONL file.
+ *
+ * @param agentName The agentName parameter.
+ * @param campaignId The campaignId parameter.
+ * @param idempotencyKey The idempotencyKey parameter.
+ * @param body The body parameter.
+ * @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 the {@link SyncPoller} for polling of an accepted outbound campaign operation.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller beginImportTelephonyCampaignRecipients(
+ String agentName, String campaignId, String idempotencyKey, ImportTelephonyCampaignRecipientsRequest body) {
+ // Generated convenience method for beginImportTelephonyCampaignRecipientsWithModel
+ RequestOptions requestOptions = new RequestOptions();
+ return serviceClient.beginImportTelephonyCampaignRecipientsWithModel(agentName, campaignId, idempotencyKey,
+ BinaryData.fromObject(body), requestOptions);
+ }
+
+ /**
+ * Get an outbound telephony campaign recipient import
+ *
+ * Retrieves the durable status and counters for a campaign recipient import.
+ *
+ * @param agentName The agentName parameter.
+ * @param campaignId The campaignId parameter.
+ * @param importId The importId parameter.
+ * @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 an outbound telephony campaign recipient import
+ *
+ * Retrieves the durable status and counters for a campaign recipient import.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public TelephonyCampaignRecipientImport getTelephonyCampaignRecipientImport(String agentName, String campaignId,
+ String importId) {
+ // Generated convenience method for getTelephonyCampaignRecipientImportWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ return getTelephonyCampaignRecipientImportWithResponse(agentName, campaignId, importId, requestOptions)
+ .getValue()
+ .toObject(TelephonyCampaignRecipientImport.class);
+ }
+
+ /**
+ * Validate an outbound telephony campaign
+ *
+ * Starts asynchronous validation of the current campaign draft and imported recipient snapshot.
+ *
+ * @param agentName The agentName parameter.
+ * @param campaignId The campaignId parameter.
+ * @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 the {@link SyncPoller} for polling of an accepted outbound campaign operation.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller beginValidateTelephonyCampaign(String agentName,
+ String campaignId) {
+ // Generated convenience method for beginValidateTelephonyCampaignWithModel
+ RequestOptions requestOptions = new RequestOptions();
+ return serviceClient.beginValidateTelephonyCampaignWithModel(agentName, campaignId, requestOptions);
+ }
+
+ /**
+ * Publish an outbound telephony campaign
+ *
+ * Permanently locks the validated campaign draft and starts asynchronous call-job materialization.
+ *
+ * @param agentName The agentName parameter.
+ * @param campaignId The campaignId parameter.
+ * @param body The body parameter.
+ * @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 the {@link SyncPoller} for polling of an accepted outbound campaign operation.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller beginPublishTelephonyCampaign(String agentName,
+ String campaignId, PublishTelephonyCampaignRequest body) {
+ // Generated convenience method for beginPublishTelephonyCampaignWithModel
+ RequestOptions requestOptions = new RequestOptions();
+ return serviceClient.beginPublishTelephonyCampaignWithModel(agentName, campaignId, BinaryData.fromObject(body),
+ requestOptions);
+ }
+
+ /**
+ * Pause an outbound telephony campaign
+ *
+ * Pauses dispatch of call jobs owned by a published campaign.
+ *
+ * @param agentName The agentName parameter.
+ * @param campaignId The campaignId parameter.
+ * @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 durable outbound campaign owned by a voice agent.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public TelephonyCampaign pauseTelephonyCampaign(String agentName, String campaignId) {
+ // Generated convenience method for pauseTelephonyCampaignWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ return pauseTelephonyCampaignWithResponse(agentName, campaignId, requestOptions).getValue()
+ .toObject(TelephonyCampaign.class);
+ }
+
+ /**
+ * Resume an outbound telephony campaign
+ *
+ * Resumes dispatch of call jobs owned by a paused campaign.
+ *
+ * @param agentName The agentName parameter.
+ * @param campaignId The campaignId parameter.
+ * @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 durable outbound campaign owned by a voice agent.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public TelephonyCampaign resumeTelephonyCampaign(String agentName, String campaignId) {
+ // Generated convenience method for resumeTelephonyCampaignWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ return resumeTelephonyCampaignWithResponse(agentName, campaignId, requestOptions).getValue()
+ .toObject(TelephonyCampaign.class);
+ }
+
+ /**
+ * Cancel an outbound telephony campaign
+ *
+ * Cancels a campaign and prevents any further call-job dispatch.
+ *
+ * @param agentName The agentName parameter.
+ * @param campaignId The campaignId parameter.
+ * @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 durable outbound campaign owned by a voice agent.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public TelephonyCampaign cancelTelephonyCampaign(String agentName, String campaignId) {
+ // Generated convenience method for cancelTelephonyCampaignWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ return cancelTelephonyCampaignWithResponse(agentName, campaignId, requestOptions).getValue()
+ .toObject(TelephonyCampaign.class);
+ }
+
+ /**
+ * Get an outbound telephony operation
+ *
+ * Retrieves an asynchronous outbound campaign operation.
+ *
+ * @param agentName The agentName parameter.
+ * @param operationId The operationId parameter.
+ * @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 an outbound telephony operation
+ *
+ * Retrieves an asynchronous outbound campaign operation.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public TelephonyOperation getTelephonyOperation(String agentName, String operationId) {
+ // Generated convenience method for getTelephonyOperationWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ return getTelephonyOperationWithResponse(agentName, operationId, requestOptions).getValue()
+ .toObject(TelephonyOperation.class);
+ }
+}
diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/ToolboxesAsyncClient.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/ToolboxesAsyncClient.java
index 2dd988e4ebb70..2105c91054015 100644
--- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/ToolboxesAsyncClient.java
+++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/ToolboxesAsyncClient.java
@@ -86,6 +86,23 @@ public final class ToolboxesAsyncClient {
* policies (Optional): {
* rai_config (Optional): {
* rai_policy_name: String (Required)
+ * invocations_moderation (Optional): {
+ * input_content_type: String(json/text) (Optional)
+ * output_content_type: String(json/text) (Optional)
+ * response_mode: String(non_streaming/streaming/both) (Required)
+ * input_paths (Optional): [
+ * String (Optional)
+ * ]
+ * output_paths (Optional): [
+ * String (Optional)
+ * ]
+ * stream_selectors (Optional): [
+ * (Optional){
+ * event_type: String (Required)
+ * text_field: String (Optional)
+ * }
+ * ]
+ * }
* }
* }
* }
@@ -126,6 +143,23 @@ public final class ToolboxesAsyncClient {
* policies (Optional): {
* rai_config (Optional): {
* rai_policy_name: String (Required)
+ * invocations_moderation (Optional): {
+ * input_content_type: String(json/text) (Optional)
+ * output_content_type: String(json/text) (Optional)
+ * response_mode: String(non_streaming/streaming/both) (Required)
+ * input_paths (Optional): [
+ * String (Optional)
+ * ]
+ * output_paths (Optional): [
+ * String (Optional)
+ * ]
+ * stream_selectors (Optional): [
+ * (Optional){
+ * event_type: String (Required)
+ * text_field: String (Optional)
+ * }
+ * ]
+ * }
* }
* }
* }
@@ -160,6 +194,59 @@ public Mono> createToolboxVersionWithResponse(String name,
* {
* id: String (Required)
* name: String (Required)
+ * updated_at: long (Required)
+ * versions (Required): {
+ * latest (Required): {
+ * metadata (Required): {
+ * String: String (Required)
+ * }
+ * id: String (Required)
+ * name: String (Required)
+ * version: String (Required)
+ * description: String (Optional)
+ * created_at: long (Required)
+ * tools (Required): [
+ * (Required){
+ * type: String(code_interpreter/file_search/web_search/mcp/azure_ai_search/openapi/a2a_preview/browser_automation_preview/reminder_preview/work_iq_preview/fabric_iq_preview/toolbox_search/toolbox_search_preview/a2a/shell/web_iq_preview) (Required)
+ * name: String (Optional)
+ * description: String (Optional)
+ * tool_configs (Optional): {
+ * String (Required): {
+ * pin: Boolean (Optional)
+ * additional_search_text: String (Optional)
+ * }
+ * }
+ * }
+ * ]
+ * skills (Optional): [
+ * (Optional){
+ * type: String (Required)
+ * }
+ * ]
+ * policies (Optional): {
+ * rai_config (Optional): {
+ * rai_policy_name: String (Required)
+ * invocations_moderation (Optional): {
+ * input_content_type: String(json/text) (Optional)
+ * output_content_type: String(json/text) (Optional)
+ * response_mode: String(non_streaming/streaming/both) (Required)
+ * input_paths (Optional): [
+ * String (Optional)
+ * ]
+ * output_paths (Optional): [
+ * String (Optional)
+ * ]
+ * stream_selectors (Optional): [
+ * (Optional){
+ * event_type: String (Required)
+ * text_field: String (Optional)
+ * }
+ * ]
+ * }
+ * }
+ * }
+ * }
+ * }
* default_version: String (Required)
* }
* }
@@ -211,6 +298,59 @@ public Mono> getToolboxWithResponse(String name, RequestOpt
* {
* id: String (Required)
* name: String (Required)
+ * updated_at: long (Required)
+ * versions (Required): {
+ * latest (Required): {
+ * metadata (Required): {
+ * String: String (Required)
+ * }
+ * id: String (Required)
+ * name: String (Required)
+ * version: String (Required)
+ * description: String (Optional)
+ * created_at: long (Required)
+ * tools (Required): [
+ * (Required){
+ * type: String(code_interpreter/file_search/web_search/mcp/azure_ai_search/openapi/a2a_preview/browser_automation_preview/reminder_preview/work_iq_preview/fabric_iq_preview/toolbox_search/toolbox_search_preview/a2a/shell/web_iq_preview) (Required)
+ * name: String (Optional)
+ * description: String (Optional)
+ * tool_configs (Optional): {
+ * String (Required): {
+ * pin: Boolean (Optional)
+ * additional_search_text: String (Optional)
+ * }
+ * }
+ * }
+ * ]
+ * skills (Optional): [
+ * (Optional){
+ * type: String (Required)
+ * }
+ * ]
+ * policies (Optional): {
+ * rai_config (Optional): {
+ * rai_policy_name: String (Required)
+ * invocations_moderation (Optional): {
+ * input_content_type: String(json/text) (Optional)
+ * output_content_type: String(json/text) (Optional)
+ * response_mode: String(non_streaming/streaming/both) (Required)
+ * input_paths (Optional): [
+ * String (Optional)
+ * ]
+ * output_paths (Optional): [
+ * String (Optional)
+ * ]
+ * stream_selectors (Optional): [
+ * (Optional){
+ * event_type: String (Required)
+ * text_field: String (Optional)
+ * }
+ * ]
+ * }
+ * }
+ * }
+ * }
+ * }
* default_version: String (Required)
* }
* }
@@ -287,6 +427,23 @@ public PagedFlux listToolboxes(RequestOptions requestOptions) {
* policies (Optional): {
* rai_config (Optional): {
* rai_policy_name: String (Required)
+ * invocations_moderation (Optional): {
+ * input_content_type: String(json/text) (Optional)
+ * output_content_type: String(json/text) (Optional)
+ * response_mode: String(non_streaming/streaming/both) (Required)
+ * input_paths (Optional): [
+ * String (Optional)
+ * ]
+ * output_paths (Optional): [
+ * String (Optional)
+ * ]
+ * stream_selectors (Optional): [
+ * (Optional){
+ * event_type: String (Required)
+ * text_field: String (Optional)
+ * }
+ * ]
+ * }
* }
* }
* }
@@ -345,6 +502,23 @@ public PagedFlux listToolboxVersions(String name, RequestOptions req
* policies (Optional): {
* rai_config (Optional): {
* rai_policy_name: String (Required)
+ * invocations_moderation (Optional): {
+ * input_content_type: String(json/text) (Optional)
+ * output_content_type: String(json/text) (Optional)
+ * response_mode: String(non_streaming/streaming/both) (Required)
+ * input_paths (Optional): [
+ * String (Optional)
+ * ]
+ * output_paths (Optional): [
+ * String (Optional)
+ * ]
+ * stream_selectors (Optional): [
+ * (Optional){
+ * event_type: String (Required)
+ * text_field: String (Optional)
+ * }
+ * ]
+ * }
* }
* }
* }
@@ -388,6 +562,59 @@ public Mono> getToolboxVersionWithResponse(String name, Str
* {
* id: String (Required)
* name: String (Required)
+ * updated_at: long (Required)
+ * versions (Required): {
+ * latest (Required): {
+ * metadata (Required): {
+ * String: String (Required)
+ * }
+ * id: String (Required)
+ * name: String (Required)
+ * version: String (Required)
+ * description: String (Optional)
+ * created_at: long (Required)
+ * tools (Required): [
+ * (Required){
+ * type: String(code_interpreter/file_search/web_search/mcp/azure_ai_search/openapi/a2a_preview/browser_automation_preview/reminder_preview/work_iq_preview/fabric_iq_preview/toolbox_search/toolbox_search_preview/a2a/shell/web_iq_preview) (Required)
+ * name: String (Optional)
+ * description: String (Optional)
+ * tool_configs (Optional): {
+ * String (Required): {
+ * pin: Boolean (Optional)
+ * additional_search_text: String (Optional)
+ * }
+ * }
+ * }
+ * ]
+ * skills (Optional): [
+ * (Optional){
+ * type: String (Required)
+ * }
+ * ]
+ * policies (Optional): {
+ * rai_config (Optional): {
+ * rai_policy_name: String (Required)
+ * invocations_moderation (Optional): {
+ * input_content_type: String(json/text) (Optional)
+ * output_content_type: String(json/text) (Optional)
+ * response_mode: String(non_streaming/streaming/both) (Required)
+ * input_paths (Optional): [
+ * String (Optional)
+ * ]
+ * output_paths (Optional): [
+ * String (Optional)
+ * ]
+ * stream_selectors (Optional): [
+ * (Optional){
+ * event_type: String (Required)
+ * text_field: String (Optional)
+ * }
+ * ]
+ * }
+ * }
+ * }
+ * }
+ * }
* default_version: String (Required)
* }
* }
@@ -812,4 +1039,72 @@ public Mono deleteToolboxVersion(String name, String version) {
RequestOptions requestOptions = new RequestOptions();
return deleteToolboxVersionWithResponse(name, version, requestOptions).flatMap(FluxUtil::toMono);
}
+
+ /**
+ * Invoke the latest toolbox version through MCP
+ *
+ * Invokes the latest version of the specified toolbox through its MCP endpoint.
+ * Request Body Schema
+ *
+ *
+ * {@code
+ * BinaryData
+ * }
+ *
+ *
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * BinaryData
+ * }
+ *
+ *
+ * Response Headers
+ *
+ * Response Headers
+ * | Name | Type | Description |
+ * | content-type | String | The content type of the MCP response body. |
+ *
+ *
+ * @param name The name of the toolbox.
+ * @param contentType The content type of the MCP request body.
+ * @param request The MCP request body.
+ * @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 anything along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> invokeLatestToolboxMcpWithResponse(String name, String contentType,
+ BinaryData request, RequestOptions requestOptions) {
+ return this.serviceClient.invokeLatestToolboxMcpWithResponseAsync(name, contentType, request, requestOptions);
+ }
+
+ /**
+ * Invoke the latest toolbox version through MCP
+ *
+ * Invokes the latest version of the specified toolbox through its MCP endpoint.
+ *
+ * @param name The name of the toolbox.
+ * @param contentType The content type of the MCP request body.
+ * @param request The MCP request body.
+ * @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 anything on successful completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono invokeLatestToolboxMcp(String name, String contentType, BinaryData request) {
+ // Generated convenience method for invokeLatestToolboxMcpWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ return invokeLatestToolboxMcpWithResponse(name, contentType, request, requestOptions).flatMap(FluxUtil::toMono);
+ }
}
diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/ToolboxesClient.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/ToolboxesClient.java
index fba494acbcf7e..4cb3e0f9ff757 100644
--- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/ToolboxesClient.java
+++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/ToolboxesClient.java
@@ -80,6 +80,23 @@ public final class ToolboxesClient {
* policies (Optional): {
* rai_config (Optional): {
* rai_policy_name: String (Required)
+ * invocations_moderation (Optional): {
+ * input_content_type: String(json/text) (Optional)
+ * output_content_type: String(json/text) (Optional)
+ * response_mode: String(non_streaming/streaming/both) (Required)
+ * input_paths (Optional): [
+ * String (Optional)
+ * ]
+ * output_paths (Optional): [
+ * String (Optional)
+ * ]
+ * stream_selectors (Optional): [
+ * (Optional){
+ * event_type: String (Required)
+ * text_field: String (Optional)
+ * }
+ * ]
+ * }
* }
* }
* }
@@ -120,6 +137,23 @@ public final class ToolboxesClient {
* policies (Optional): {
* rai_config (Optional): {
* rai_policy_name: String (Required)
+ * invocations_moderation (Optional): {
+ * input_content_type: String(json/text) (Optional)
+ * output_content_type: String(json/text) (Optional)
+ * response_mode: String(non_streaming/streaming/both) (Required)
+ * input_paths (Optional): [
+ * String (Optional)
+ * ]
+ * output_paths (Optional): [
+ * String (Optional)
+ * ]
+ * stream_selectors (Optional): [
+ * (Optional){
+ * event_type: String (Required)
+ * text_field: String (Optional)
+ * }
+ * ]
+ * }
* }
* }
* }
@@ -153,6 +187,59 @@ public Response createToolboxVersionWithResponse(String name, Binary
* {
* id: String (Required)
* name: String (Required)
+ * updated_at: long (Required)
+ * versions (Required): {
+ * latest (Required): {
+ * metadata (Required): {
+ * String: String (Required)
+ * }
+ * id: String (Required)
+ * name: String (Required)
+ * version: String (Required)
+ * description: String (Optional)
+ * created_at: long (Required)
+ * tools (Required): [
+ * (Required){
+ * type: String(code_interpreter/file_search/web_search/mcp/azure_ai_search/openapi/a2a_preview/browser_automation_preview/reminder_preview/work_iq_preview/fabric_iq_preview/toolbox_search/toolbox_search_preview/a2a/shell/web_iq_preview) (Required)
+ * name: String (Optional)
+ * description: String (Optional)
+ * tool_configs (Optional): {
+ * String (Required): {
+ * pin: Boolean (Optional)
+ * additional_search_text: String (Optional)
+ * }
+ * }
+ * }
+ * ]
+ * skills (Optional): [
+ * (Optional){
+ * type: String (Required)
+ * }
+ * ]
+ * policies (Optional): {
+ * rai_config (Optional): {
+ * rai_policy_name: String (Required)
+ * invocations_moderation (Optional): {
+ * input_content_type: String(json/text) (Optional)
+ * output_content_type: String(json/text) (Optional)
+ * response_mode: String(non_streaming/streaming/both) (Required)
+ * input_paths (Optional): [
+ * String (Optional)
+ * ]
+ * output_paths (Optional): [
+ * String (Optional)
+ * ]
+ * stream_selectors (Optional): [
+ * (Optional){
+ * event_type: String (Required)
+ * text_field: String (Optional)
+ * }
+ * ]
+ * }
+ * }
+ * }
+ * }
+ * }
* default_version: String (Required)
* }
* }
@@ -203,6 +290,59 @@ public Response getToolboxWithResponse(String name, RequestOptions r
* {
* id: String (Required)
* name: String (Required)
+ * updated_at: long (Required)
+ * versions (Required): {
+ * latest (Required): {
+ * metadata (Required): {
+ * String: String (Required)
+ * }
+ * id: String (Required)
+ * name: String (Required)
+ * version: String (Required)
+ * description: String (Optional)
+ * created_at: long (Required)
+ * tools (Required): [
+ * (Required){
+ * type: String(code_interpreter/file_search/web_search/mcp/azure_ai_search/openapi/a2a_preview/browser_automation_preview/reminder_preview/work_iq_preview/fabric_iq_preview/toolbox_search/toolbox_search_preview/a2a/shell/web_iq_preview) (Required)
+ * name: String (Optional)
+ * description: String (Optional)
+ * tool_configs (Optional): {
+ * String (Required): {
+ * pin: Boolean (Optional)
+ * additional_search_text: String (Optional)
+ * }
+ * }
+ * }
+ * ]
+ * skills (Optional): [
+ * (Optional){
+ * type: String (Required)
+ * }
+ * ]
+ * policies (Optional): {
+ * rai_config (Optional): {
+ * rai_policy_name: String (Required)
+ * invocations_moderation (Optional): {
+ * input_content_type: String(json/text) (Optional)
+ * output_content_type: String(json/text) (Optional)
+ * response_mode: String(non_streaming/streaming/both) (Required)
+ * input_paths (Optional): [
+ * String (Optional)
+ * ]
+ * output_paths (Optional): [
+ * String (Optional)
+ * ]
+ * stream_selectors (Optional): [
+ * (Optional){
+ * event_type: String (Required)
+ * text_field: String (Optional)
+ * }
+ * ]
+ * }
+ * }
+ * }
+ * }
+ * }
* default_version: String (Required)
* }
* }
@@ -279,6 +419,23 @@ public PagedIterable listToolboxes(RequestOptions requestOptions) {
* policies (Optional): {
* rai_config (Optional): {
* rai_policy_name: String (Required)
+ * invocations_moderation (Optional): {
+ * input_content_type: String(json/text) (Optional)
+ * output_content_type: String(json/text) (Optional)
+ * response_mode: String(non_streaming/streaming/both) (Required)
+ * input_paths (Optional): [
+ * String (Optional)
+ * ]
+ * output_paths (Optional): [
+ * String (Optional)
+ * ]
+ * stream_selectors (Optional): [
+ * (Optional){
+ * event_type: String (Required)
+ * text_field: String (Optional)
+ * }
+ * ]
+ * }
* }
* }
* }
@@ -337,6 +494,23 @@ public PagedIterable listToolboxVersions(String name, RequestOptions
* policies (Optional): {
* rai_config (Optional): {
* rai_policy_name: String (Required)
+ * invocations_moderation (Optional): {
+ * input_content_type: String(json/text) (Optional)
+ * output_content_type: String(json/text) (Optional)
+ * response_mode: String(non_streaming/streaming/both) (Required)
+ * input_paths (Optional): [
+ * String (Optional)
+ * ]
+ * output_paths (Optional): [
+ * String (Optional)
+ * ]
+ * stream_selectors (Optional): [
+ * (Optional){
+ * event_type: String (Required)
+ * text_field: String (Optional)
+ * }
+ * ]
+ * }
* }
* }
* }
@@ -380,6 +554,59 @@ public Response getToolboxVersionWithResponse(String name, String ve
* {
* id: String (Required)
* name: String (Required)
+ * updated_at: long (Required)
+ * versions (Required): {
+ * latest (Required): {
+ * metadata (Required): {
+ * String: String (Required)
+ * }
+ * id: String (Required)
+ * name: String (Required)
+ * version: String (Required)
+ * description: String (Optional)
+ * created_at: long (Required)
+ * tools (Required): [
+ * (Required){
+ * type: String(code_interpreter/file_search/web_search/mcp/azure_ai_search/openapi/a2a_preview/browser_automation_preview/reminder_preview/work_iq_preview/fabric_iq_preview/toolbox_search/toolbox_search_preview/a2a/shell/web_iq_preview) (Required)
+ * name: String (Optional)
+ * description: String (Optional)
+ * tool_configs (Optional): {
+ * String (Required): {
+ * pin: Boolean (Optional)
+ * additional_search_text: String (Optional)
+ * }
+ * }
+ * }
+ * ]
+ * skills (Optional): [
+ * (Optional){
+ * type: String (Required)
+ * }
+ * ]
+ * policies (Optional): {
+ * rai_config (Optional): {
+ * rai_policy_name: String (Required)
+ * invocations_moderation (Optional): {
+ * input_content_type: String(json/text) (Optional)
+ * output_content_type: String(json/text) (Optional)
+ * response_mode: String(non_streaming/streaming/both) (Required)
+ * input_paths (Optional): [
+ * String (Optional)
+ * ]
+ * output_paths (Optional): [
+ * String (Optional)
+ * ]
+ * stream_selectors (Optional): [
+ * (Optional){
+ * event_type: String (Required)
+ * text_field: String (Optional)
+ * }
+ * ]
+ * }
+ * }
+ * }
+ * }
+ * }
* default_version: String (Required)
* }
* }
@@ -751,4 +978,72 @@ public void deleteToolboxVersion(String name, String version) {
RequestOptions requestOptions = new RequestOptions();
deleteToolboxVersionWithResponse(name, version, requestOptions).getValue();
}
+
+ /**
+ * Invoke the latest toolbox version through MCP
+ *
+ * Invokes the latest version of the specified toolbox through its MCP endpoint.
+ * Request Body Schema
+ *
+ *
+ * {@code
+ * BinaryData
+ * }
+ *
+ *
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * BinaryData
+ * }
+ *
+ *
+ * Response Headers
+ *
+ * Response Headers
+ * | Name | Type | Description |
+ * | content-type | String | The content type of the MCP response body. |
+ *
+ *
+ * @param name The name of the toolbox.
+ * @param contentType The content type of the MCP request body.
+ * @param request The MCP request body.
+ * @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 anything along with {@link Response}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response invokeLatestToolboxMcpWithResponse(String name, String contentType, BinaryData request,
+ RequestOptions requestOptions) {
+ return this.serviceClient.invokeLatestToolboxMcpWithResponse(name, contentType, request, requestOptions);
+ }
+
+ /**
+ * Invoke the latest toolbox version through MCP
+ *
+ * Invokes the latest version of the specified toolbox through its MCP endpoint.
+ *
+ * @param name The name of the toolbox.
+ * @param contentType The content type of the MCP request body.
+ * @param request The MCP request body.
+ * @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 anything.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public BinaryData invokeLatestToolboxMcp(String name, String contentType, BinaryData request) {
+ // Generated convenience method for invokeLatestToolboxMcpWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ return invokeLatestToolboxMcpWithResponse(name, contentType, request, requestOptions).getValue();
+ }
}
diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/AgentsClientImpl.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/AgentsClientImpl.java
index d5d107362708b..bc8ba850e5fe0 100644
--- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/AgentsClientImpl.java
+++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/AgentsClientImpl.java
@@ -80,6 +80,34 @@ public SerializerAdapter getSerializerAdapter() {
return this.serializerAdapter;
}
+ /**
+ * The BetaVoiceAgentsConversationsImpl object to access its operations.
+ */
+ private final BetaVoiceAgentsConversationsImpl betaVoiceAgentsConversations;
+
+ /**
+ * Gets the BetaVoiceAgentsConversationsImpl object to access its operations.
+ *
+ * @return the BetaVoiceAgentsConversationsImpl object.
+ */
+ public BetaVoiceAgentsConversationsImpl getBetaVoiceAgentsConversations() {
+ return this.betaVoiceAgentsConversations;
+ }
+
+ /**
+ * The BetaVoiceAgentsTelephoniesImpl object to access its operations.
+ */
+ private final BetaVoiceAgentsTelephoniesImpl betaVoiceAgentsTelephonies;
+
+ /**
+ * Gets the BetaVoiceAgentsTelephoniesImpl object to access its operations.
+ *
+ * @return the BetaVoiceAgentsTelephoniesImpl object.
+ */
+ public BetaVoiceAgentsTelephoniesImpl getBetaVoiceAgentsTelephonies() {
+ return this.betaVoiceAgentsTelephonies;
+ }
+
/**
* The BetaMemoryStoresImpl object to access its operations.
*/
@@ -184,6 +212,8 @@ public AgentsClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerA
this.serializerAdapter = serializerAdapter;
this.endpoint = endpoint;
this.serviceVersion = serviceVersion;
+ this.betaVoiceAgentsConversations = new BetaVoiceAgentsConversationsImpl(this);
+ this.betaVoiceAgentsTelephonies = new BetaVoiceAgentsTelephoniesImpl(this);
this.betaMemoryStores = new BetaMemoryStoresImpl(this);
this.betaAgents = new BetaAgentsImpl(this);
this.agents = new AgentsImpl(this);
diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/AgentsImpl.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/AgentsImpl.java
index 60d95512de9c3..2561da83482b8 100644
--- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/AgentsImpl.java
+++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/AgentsImpl.java
@@ -826,6 +826,7 @@ Response listAgentConversationsSync(@HostParam("endpoint") String en
* id: String (Required)
* name: String (Required)
* state: String(enabled/disabled) (Required)
+ * configuration_state: String(enabled/disabled) (Required)
* state_source: String(agent_instance_identity/agent_blueprint) (Optional)
* versions (Required): {
* latest (Required): {
@@ -839,9 +840,26 @@ Response listAgentConversationsSync(@HostParam("endpoint") String en
* description: String (Optional)
* created_at: long (Required)
* definition (Required): {
- * kind: String(prompt/hosted/workflow/external) (Required)
+ * kind: String(prompt/hosted/workflow/external/voice) (Required)
* rai_config (Optional): {
* rai_policy_name: String (Required)
+ * invocations_moderation (Optional): {
+ * input_content_type: String(json/text) (Optional)
+ * output_content_type: String(json/text) (Optional)
+ * response_mode: String(non_streaming/streaming/both) (Required)
+ * input_paths (Optional): [
+ * String (Optional)
+ * ]
+ * output_paths (Optional): [
+ * String (Optional)
+ * ]
+ * stream_selectors (Optional): [
+ * (Optional){
+ * event_type: String (Required)
+ * text_field: String (Optional)
+ * }
+ * ]
+ * }
* }
* }
* draft: Boolean (Optional)
@@ -948,6 +966,7 @@ public Mono> getAgentWithResponseAsync(String agentName, Re
* id: String (Required)
* name: String (Required)
* state: String(enabled/disabled) (Required)
+ * configuration_state: String(enabled/disabled) (Required)
* state_source: String(agent_instance_identity/agent_blueprint) (Optional)
* versions (Required): {
* latest (Required): {
@@ -961,9 +980,26 @@ public Mono> getAgentWithResponseAsync(String agentName, Re
* description: String (Optional)
* created_at: long (Required)
* definition (Required): {
- * kind: String(prompt/hosted/workflow/external) (Required)
+ * kind: String(prompt/hosted/workflow/external/voice) (Required)
* rai_config (Optional): {
* rai_policy_name: String (Required)
+ * invocations_moderation (Optional): {
+ * input_content_type: String(json/text) (Optional)
+ * output_content_type: String(json/text) (Optional)
+ * response_mode: String(non_streaming/streaming/both) (Required)
+ * input_paths (Optional): [
+ * String (Optional)
+ * ]
+ * output_paths (Optional): [
+ * String (Optional)
+ * ]
+ * stream_selectors (Optional): [
+ * (Optional){
+ * event_type: String (Required)
+ * text_field: String (Optional)
+ * }
+ * ]
+ * }
* }
* }
* draft: Boolean (Optional)
@@ -1072,9 +1108,26 @@ public Response getAgentWithResponse(String agentName, RequestOption
* }
* description: String (Optional)
* definition (Required): {
- * kind: String(prompt/hosted/workflow/external) (Required)
+ * kind: String(prompt/hosted/workflow/external/voice) (Required)
* rai_config (Optional): {
* rai_policy_name: String (Required)
+ * invocations_moderation (Optional): {
+ * input_content_type: String(json/text) (Optional)
+ * output_content_type: String(json/text) (Optional)
+ * response_mode: String(non_streaming/streaming/both) (Required)
+ * input_paths (Optional): [
+ * String (Optional)
+ * ]
+ * output_paths (Optional): [
+ * String (Optional)
+ * ]
+ * stream_selectors (Optional): [
+ * (Optional){
+ * event_type: String (Required)
+ * text_field: String (Optional)
+ * }
+ * ]
+ * }
* }
* }
* blueprint_reference (Optional): {
@@ -1146,6 +1199,7 @@ public Response getAgentWithResponse(String agentName, RequestOption
* id: String (Required)
* name: String (Required)
* state: String(enabled/disabled) (Required)
+ * configuration_state: String(enabled/disabled) (Required)
* state_source: String(agent_instance_identity/agent_blueprint) (Optional)
* versions (Required): {
* latest (Required): {
@@ -1159,9 +1213,26 @@ public Response getAgentWithResponse(String agentName, RequestOption
* description: String (Optional)
* created_at: long (Required)
* definition (Required): {
- * kind: String(prompt/hosted/workflow/external) (Required)
+ * kind: String(prompt/hosted/workflow/external/voice) (Required)
* rai_config (Optional): {
* rai_policy_name: String (Required)
+ * invocations_moderation (Optional): {
+ * input_content_type: String(json/text) (Optional)
+ * output_content_type: String(json/text) (Optional)
+ * response_mode: String(non_streaming/streaming/both) (Required)
+ * input_paths (Optional): [
+ * String (Optional)
+ * ]
+ * output_paths (Optional): [
+ * String (Optional)
+ * ]
+ * stream_selectors (Optional): [
+ * (Optional){
+ * event_type: String (Required)
+ * text_field: String (Optional)
+ * }
+ * ]
+ * }
* }
* }
* draft: Boolean (Optional)
@@ -1271,9 +1342,26 @@ public Mono> createAgentWithResponseAsync(BinaryData create
* }
* description: String (Optional)
* definition (Required): {
- * kind: String(prompt/hosted/workflow/external) (Required)
+ * kind: String(prompt/hosted/workflow/external/voice) (Required)
* rai_config (Optional): {
* rai_policy_name: String (Required)
+ * invocations_moderation (Optional): {
+ * input_content_type: String(json/text) (Optional)
+ * output_content_type: String(json/text) (Optional)
+ * response_mode: String(non_streaming/streaming/both) (Required)
+ * input_paths (Optional): [
+ * String (Optional)
+ * ]
+ * output_paths (Optional): [
+ * String (Optional)
+ * ]
+ * stream_selectors (Optional): [
+ * (Optional){
+ * event_type: String (Required)
+ * text_field: String (Optional)
+ * }
+ * ]
+ * }
* }
* }
* blueprint_reference (Optional): {
@@ -1345,6 +1433,7 @@ public Mono> createAgentWithResponseAsync(BinaryData create
* id: String (Required)
* name: String (Required)
* state: String(enabled/disabled) (Required)
+ * configuration_state: String(enabled/disabled) (Required)
* state_source: String(agent_instance_identity/agent_blueprint) (Optional)
* versions (Required): {
* latest (Required): {
@@ -1358,9 +1447,26 @@ public Mono> createAgentWithResponseAsync(BinaryData create
* description: String (Optional)
* created_at: long (Required)
* definition (Required): {
- * kind: String(prompt/hosted/workflow/external) (Required)
+ * kind: String(prompt/hosted/workflow/external/voice) (Required)
* rai_config (Optional): {
* rai_policy_name: String (Required)
+ * invocations_moderation (Optional): {
+ * input_content_type: String(json/text) (Optional)
+ * output_content_type: String(json/text) (Optional)
+ * response_mode: String(non_streaming/streaming/both) (Required)
+ * input_paths (Optional): [
+ * String (Optional)
+ * ]
+ * output_paths (Optional): [
+ * String (Optional)
+ * ]
+ * stream_selectors (Optional): [
+ * (Optional){
+ * event_type: String (Required)
+ * text_field: String (Optional)
+ * }
+ * ]
+ * }
* }
* }
* draft: Boolean (Optional)
@@ -1470,6 +1576,7 @@ public Response createAgentWithResponse(BinaryData createAgentReques
* id: String (Required)
* name: String (Required)
* state: String(enabled/disabled) (Required)
+ * configuration_state: String(enabled/disabled) (Required)
* state_source: String(agent_instance_identity/agent_blueprint) (Optional)
* versions (Required): {
* latest (Required): {
@@ -1483,9 +1590,26 @@ public Response createAgentWithResponse(BinaryData createAgentReques
* description: String (Optional)
* created_at: long (Required)
* definition (Required): {
- * kind: String(prompt/hosted/workflow/external) (Required)
+ * kind: String(prompt/hosted/workflow/external/voice) (Required)
* rai_config (Optional): {
* rai_policy_name: String (Required)
+ * invocations_moderation (Optional): {
+ * input_content_type: String(json/text) (Optional)
+ * output_content_type: String(json/text) (Optional)
+ * response_mode: String(non_streaming/streaming/both) (Required)
+ * input_paths (Optional): [
+ * String (Optional)
+ * ]
+ * output_paths (Optional): [
+ * String (Optional)
+ * ]
+ * stream_selectors (Optional): [
+ * (Optional){
+ * event_type: String (Required)
+ * text_field: String (Optional)
+ * }
+ * ]
+ * }
* }
* }
* draft: Boolean (Optional)
@@ -1601,6 +1725,7 @@ public Mono