diff --git a/sdk/ai/azure-ai-projects/api.md b/sdk/ai/azure-ai-projects/api.md index 17eaf94e2f1c..5f769a544c86 100644 --- a/sdk/ai/azure-ai-projects/api.md +++ b/sdk/ai/azure-ai-projects/api.md @@ -2364,83 +2364,6 @@ namespace azure.ai.projects.aio.operations **kwargs ) -> None: ... - @overload - async def begin_import_campaign_recipients( - self, - agent_name: str, - campaign_id: str, - body: ImportTelephonyCampaignRecipientsRequest, - *, - content_type: str = "application/json", - idempotency_key: str, - **kwargs: Any - ) -> AsyncLROPoller[TelephonyOperationResource]: ... - - @overload - async def begin_import_campaign_recipients( - self, - agent_name: str, - campaign_id: str, - body: JSON, - *, - content_type: str = "application/json", - idempotency_key: str, - **kwargs: Any - ) -> AsyncLROPoller[TelephonyOperationResource]: ... - - @overload - async def begin_import_campaign_recipients( - self, - agent_name: str, - campaign_id: str, - body: IO[bytes], - *, - content_type: str = "application/json", - idempotency_key: str, - **kwargs: Any - ) -> AsyncLROPoller[TelephonyOperationResource]: ... - - @overload - async def begin_publish_campaign( - self, - agent_name: str, - campaign_id: str, - body: PublishTelephonyCampaignRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[TelephonyOperationResource]: ... - - @overload - async def begin_publish_campaign( - self, - agent_name: str, - campaign_id: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[TelephonyOperationResource]: ... - - @overload - async def begin_publish_campaign( - self, - agent_name: str, - campaign_id: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[TelephonyOperationResource]: ... - - @distributed_trace_async - async def begin_validate_campaign( - self, - agent_name: str, - campaign_id: str, - **kwargs: Any - ) -> AsyncLROPoller[TelephonyOperationResource]: ... - @distributed_trace_async async def cancel_call_job( self, @@ -2451,14 +2374,6 @@ namespace azure.ai.projects.aio.operations **kwargs: Any ) -> TelephonyCallJob: ... - @distributed_trace_async - async def cancel_campaign( - self, - agent_name: str, - campaign_id: str, - **kwargs: Any - ) -> TelephonyCampaign: ... - @overload async def create_binding( self, @@ -2522,36 +2437,6 @@ namespace azure.ai.projects.aio.operations **kwargs: Any ) -> TelephonyCallJob: ... - @overload - async def create_campaign( - self, - agent_name: str, - body: CreateTelephonyCampaignRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> TelephonyCampaign: ... - - @overload - async def create_campaign( - self, - agent_name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> TelephonyCampaign: ... - - @overload - async def create_campaign( - self, - agent_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> TelephonyCampaign: ... - @distributed_trace_async async def delete_binding( self, @@ -2594,31 +2479,6 @@ namespace azure.ai.projects.aio.operations **kwargs: Any ) -> TelephonyCallJob: ... - @distributed_trace_async - async def get_campaign( - self, - agent_name: str, - campaign_id: str, - **kwargs: Any - ) -> TelephonyCampaign: ... - - @distributed_trace_async - async def get_campaign_recipient_import( - self, - agent_name: str, - campaign_id: str, - import_id: str, - **kwargs: Any - ) -> TelephonyCampaignRecipientImport: ... - - @distributed_trace_async - async def get_operation( - self, - agent_name: str, - operation_id: str, - **kwargs: Any - ) -> TelephonyOperation: ... - @distributed_trace_async async def get_transfer_targets( self, @@ -2654,14 +2514,6 @@ namespace azure.ai.projects.aio.operations **kwargs: Any ) -> AsyncItemPaged[TelephonyCallSummary]: ... - @distributed_trace_async - async def pause_campaign( - self, - agent_name: str, - campaign_id: str, - **kwargs: Any - ) -> TelephonyCampaign: ... - @overload async def replace_transfer_targets( self, @@ -2695,14 +2547,6 @@ namespace azure.ai.projects.aio.operations **kwargs: Any ) -> TelephonyTransferTargets: ... - @distributed_trace_async - async def resume_campaign( - self, - agent_name: str, - campaign_id: str, - **kwargs: Any - ) -> TelephonyCampaign: ... - @overload async def transfer_call( self, @@ -5802,30 +5646,6 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.CreateTelephonyCampaignRequest(_Model): - connection_name: str - display_name: str - purpose: Optional[str] - retry_policy: Optional[TelephonyOutboundRetryPolicy] - schedule: Optional[TelephonyCampaignSchedule] - source: str - - @overload - def __init__( - self, - *, - connection_name: str, - display_name: str, - purpose: Optional[str] = ..., - retry_policy: Optional[TelephonyOutboundRetryPolicy] = ..., - schedule: Optional[TelephonyCampaignSchedule] = ..., - source: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - class azure.ai.projects.models.CreateTranscriptionResponseJsonUsage(_Model): type: str @@ -7832,24 +7652,6 @@ namespace azure.ai.projects.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.ai.projects.models.ImportTelephonyCampaignRecipientsRequest(_Model): - duplicate_handling: Optional[Union[str, TelephonyCampaignDuplicateHandling]] - mapping: Optional[TelephonyCampaignRecipientMappingRequest] - source: TelephonyCampaignRecipientImportSource - - @overload - def __init__( - self, - *, - duplicate_handling: Optional[Union[str, TelephonyCampaignDuplicateHandling]] = ..., - mapping: Optional[TelephonyCampaignRecipientMappingRequest] = ..., - source: TelephonyCampaignRecipientImportSource - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - class azure.ai.projects.models.Index(_Model): description: Optional[str] id: Optional[str] @@ -9547,20 +9349,6 @@ namespace azure.ai.projects.models REJECTED = "rejected" - class azure.ai.projects.models.PublishTelephonyCampaignRequest(_Model): - validation_id: str - - @overload - def __init__( - self, - *, - validation_id: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - class azure.ai.projects.models.RaiConfig(_Model): invocations_moderation: Optional[RaiInvocationModeration] rai_policy_name: str @@ -13146,291 +12934,6 @@ namespace azure.ai.projects.models PENDING = "pending" - class azure.ai.projects.models.TelephonyCampaign(_Model): - active_recipient_import_id: Optional[str] - active_validation_id: Optional[str] - agent_name: str - call_job_counts: TelephonyCampaignCallJobCounts - configuration_status: Union[str, TelephonyCampaignConfigurationStatus] - connection_name: str - created_at: datetime - display_name: str - execution_status: Union[str, TelephonyCampaignExecutionStatus] - id: str - latest_successful_validation_id: Optional[str] - object: Literal["campaign"] - published_at: Optional[datetime] - purpose: Optional[str] - retry_policy: TelephonyOutboundRetryPolicy - schedule: Optional[TelephonyCampaignSchedule] - source: str - updated_at: datetime - - @overload - def __init__( - self, - *, - active_recipient_import_id: Optional[str] = ..., - active_validation_id: Optional[str] = ..., - agent_name: str, - call_job_counts: TelephonyCampaignCallJobCounts, - configuration_status: Union[str, TelephonyCampaignConfigurationStatus], - connection_name: str, - created_at: datetime, - display_name: str, - execution_status: Union[str, TelephonyCampaignExecutionStatus], - id: str, - latest_successful_validation_id: Optional[str] = ..., - published_at: Optional[datetime] = ..., - purpose: Optional[str] = ..., - retry_policy: TelephonyOutboundRetryPolicy, - schedule: Optional[TelephonyCampaignSchedule] = ..., - source: str, - updated_at: datetime - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.projects.models.TelephonyCampaignCallJobCounts(_Model): - blocked: int - cancelled: int - completed: int - expired: int - failed: int - in_progress: int - pending: int - total: int - - @overload - def __init__( - self, - *, - blocked: int, - cancelled: int, - completed: int, - expired: int, - failed: int, - in_progress: int, - pending: int, - total: int - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.projects.models.TelephonyCampaignConfigurationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - DRAFT = "draft" - IMPORTING = "importing" - PUBLISHED = "published" - PUBLISHING = "publishing" - PUBLISH_FAILED = "publish_failed" - VALIDATING = "validating" - - - class azure.ai.projects.models.TelephonyCampaignDuplicateHandling(str, Enum, metaclass=CaseInsensitiveEnumMeta): - KEEP_EACH = "keep_each" - MERGE = "merge" - REJECT = "reject" - - - class azure.ai.projects.models.TelephonyCampaignExecutionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CANCELLED = "cancelled" - COMPLETED = "completed" - FAILED = "failed" - NONE = "none" - PAUSED = "paused" - RUNNING = "running" - SCHEDULED = "scheduled" - - - class azure.ai.projects.models.TelephonyCampaignRecipientImport(_Model): - campaign_id: str - created_at: datetime - duplicate_handling: Union[str, TelephonyCampaignDuplicateHandling] - eligible_recipient_count: int - error_code: Optional[str] - error_message: Optional[str] - id: str - invalid_recipient_count: int - mapping: Optional[TelephonyCampaignRecipientMapping] - object: Literal["recipient_import"] - rows_processed: int - source: TelephonyCampaignRecipientImportSource - status: Union[str, TelephonyCampaignRecipientImportStatus] - updated_at: datetime - - @overload - def __init__( - self, - *, - campaign_id: str, - created_at: datetime, - duplicate_handling: Union[str, TelephonyCampaignDuplicateHandling], - eligible_recipient_count: int, - error_code: Optional[str] = ..., - error_message: Optional[str] = ..., - id: str, - invalid_recipient_count: int, - mapping: Optional[TelephonyCampaignRecipientMapping] = ..., - rows_processed: int, - source: TelephonyCampaignRecipientImportSource, - status: Union[str, TelephonyCampaignRecipientImportStatus], - updated_at: datetime - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.projects.models.TelephonyCampaignRecipientImportFormat(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CSV = "csv" - JSON = "json" - JSONL = "jsonl" - - - class azure.ai.projects.models.TelephonyCampaignRecipientImportSource(_Model): - dataset_name: str - dataset_version: str - file_name: str - format: Union[str, TelephonyCampaignRecipientImportFormat] - type: Literal["dataset"] - - @overload - def __init__( - self, - *, - dataset_name: str, - dataset_version: str, - file_name: str, - format: Union[str, TelephonyCampaignRecipientImportFormat] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.projects.models.TelephonyCampaignRecipientImportStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - FAILED = "failed" - RUNNING = "running" - SUCCEEDED = "succeeded" - - - class azure.ai.projects.models.TelephonyCampaignRecipientMapping(_Model): - destination: str - expires_at: Optional[str] - not_before: Optional[str] - recipient_item_key: Optional[str] - recipient_key: str - - @overload - def __init__( - self, - *, - destination: str, - expires_at: Optional[str] = ..., - not_before: Optional[str] = ..., - recipient_item_key: Optional[str] = ..., - recipient_key: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.projects.models.TelephonyCampaignRecipientMappingRequest(_Model): - destination: Optional[str] - expires_at: Optional[str] - not_before: Optional[str] - recipient_item_key: Optional[str] - recipient_key: Optional[str] - - @overload - def __init__( - self, - *, - destination: Optional[str] = ..., - expires_at: Optional[str] = ..., - not_before: Optional[str] = ..., - recipient_item_key: Optional[str] = ..., - recipient_key: Optional[str] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.projects.models.TelephonyCampaignSchedule(_Model): - start_at: Optional[datetime] - type: Union[str, TelephonyCampaignScheduleType] - - @overload - def __init__( - self, - *, - start_at: Optional[datetime] = ..., - type: Union[str, TelephonyCampaignScheduleType] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.projects.models.TelephonyCampaignScheduleType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - IMMEDIATE = "immediate" - SCHEDULED = "scheduled" - - - class azure.ai.projects.models.TelephonyOperation(_Model): - created_at: Optional[datetime] - error: Optional[ApiError] - id: str - object: Literal["operation"] - resource: Optional[TelephonyOperationResource] - status: Union[str, TelephonyOperationStatus] - - @overload - def __init__( - self, - *, - created_at: Optional[datetime] = ..., - error: Optional[ApiError] = ..., - id: str, - resource: Optional[TelephonyOperationResource] = ..., - status: Union[str, TelephonyOperationStatus] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.projects.models.TelephonyOperationResource(_Model): - id: str - type: str - - @overload - def __init__( - self, - *, - id: str, - type: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.ai.projects.models.TelephonyOperationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CANCELLED = "cancelled" - FAILED = "failed" - NOT_STARTED = "not_started" - RUNNING = "running" - SUCCEEDED = "succeeded" - UNKNOWN_STATUS = "unknown" - - class azure.ai.projects.models.TelephonyOutboundDestination(_Model): type: Union[str, TelephonyOutboundDestinationType] value: str @@ -19047,83 +18550,6 @@ namespace azure.ai.projects.operations **kwargs ) -> None: ... - @overload - def begin_import_campaign_recipients( - self, - agent_name: str, - campaign_id: str, - body: ImportTelephonyCampaignRecipientsRequest, - *, - content_type: str = "application/json", - idempotency_key: str, - **kwargs: Any - ) -> LROPoller[TelephonyOperationResource]: ... - - @overload - def begin_import_campaign_recipients( - self, - agent_name: str, - campaign_id: str, - body: JSON, - *, - content_type: str = "application/json", - idempotency_key: str, - **kwargs: Any - ) -> LROPoller[TelephonyOperationResource]: ... - - @overload - def begin_import_campaign_recipients( - self, - agent_name: str, - campaign_id: str, - body: IO[bytes], - *, - content_type: str = "application/json", - idempotency_key: str, - **kwargs: Any - ) -> LROPoller[TelephonyOperationResource]: ... - - @overload - def begin_publish_campaign( - self, - agent_name: str, - campaign_id: str, - body: PublishTelephonyCampaignRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[TelephonyOperationResource]: ... - - @overload - def begin_publish_campaign( - self, - agent_name: str, - campaign_id: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[TelephonyOperationResource]: ... - - @overload - def begin_publish_campaign( - self, - agent_name: str, - campaign_id: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[TelephonyOperationResource]: ... - - @distributed_trace - def begin_validate_campaign( - self, - agent_name: str, - campaign_id: str, - **kwargs: Any - ) -> LROPoller[TelephonyOperationResource]: ... - @distributed_trace def cancel_call_job( self, @@ -19134,14 +18560,6 @@ namespace azure.ai.projects.operations **kwargs: Any ) -> TelephonyCallJob: ... - @distributed_trace - def cancel_campaign( - self, - agent_name: str, - campaign_id: str, - **kwargs: Any - ) -> TelephonyCampaign: ... - @overload def create_binding( self, @@ -19205,36 +18623,6 @@ namespace azure.ai.projects.operations **kwargs: Any ) -> TelephonyCallJob: ... - @overload - def create_campaign( - self, - agent_name: str, - body: CreateTelephonyCampaignRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> TelephonyCampaign: ... - - @overload - def create_campaign( - self, - agent_name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> TelephonyCampaign: ... - - @overload - def create_campaign( - self, - agent_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> TelephonyCampaign: ... - @distributed_trace def delete_binding( self, @@ -19277,31 +18665,6 @@ namespace azure.ai.projects.operations **kwargs: Any ) -> TelephonyCallJob: ... - @distributed_trace - def get_campaign( - self, - agent_name: str, - campaign_id: str, - **kwargs: Any - ) -> TelephonyCampaign: ... - - @distributed_trace - def get_campaign_recipient_import( - self, - agent_name: str, - campaign_id: str, - import_id: str, - **kwargs: Any - ) -> TelephonyCampaignRecipientImport: ... - - @distributed_trace - def get_operation( - self, - agent_name: str, - operation_id: str, - **kwargs: Any - ) -> TelephonyOperation: ... - @distributed_trace def get_transfer_targets( self, @@ -19337,14 +18700,6 @@ namespace azure.ai.projects.operations **kwargs: Any ) -> ItemPaged[TelephonyCallSummary]: ... - @distributed_trace - def pause_campaign( - self, - agent_name: str, - campaign_id: str, - **kwargs: Any - ) -> TelephonyCampaign: ... - @overload def replace_transfer_targets( self, @@ -19378,14 +18733,6 @@ namespace azure.ai.projects.operations **kwargs: Any ) -> TelephonyTransferTargets: ... - @distributed_trace - def resume_campaign( - self, - agent_name: str, - campaign_id: str, - **kwargs: Any - ) -> TelephonyCampaign: ... - @overload def transfer_call( self, diff --git a/sdk/ai/azure-ai-projects/api.metadata.yml b/sdk/ai/azure-ai-projects/api.metadata.yml index e10f237a905f..aa38bcbde99c 100644 --- a/sdk/ai/azure-ai-projects/api.metadata.yml +++ b/sdk/ai/azure-ai-projects/api.metadata.yml @@ -1,4 +1,4 @@ -apiMdSha256: f3d613950827cce7099d3350a3b986a9d6603291b0f87e7a72b622f15f23af43 +apiMdSha256: 2e5606ea746c3ab9b1e08d2da1044f84c23862f71e37b151c313daf572e7ea69 packageVersion: 2.6.1 parserVersion: 0.3.31 pythonVersion: 3.12.10 diff --git a/sdk/ai/azure-ai-projects/apiview-properties.json b/sdk/ai/azure-ai-projects/apiview-properties.json index 35ba60f74917..280d0195489a 100644 --- a/sdk/ai/azure-ai-projects/apiview-properties.json +++ b/sdk/ai/azure-ai-projects/apiview-properties.json @@ -136,7 +136,6 @@ "azure.ai.projects.models.CreateTelephonyBindingRequest": "Azure.AI.Projects.CreateTelephonyBindingRequest", "azure.ai.projects.models.CreateTeamsPhoneExtensionTelephonyBindingRequest": "Azure.AI.Projects.CreateTeamsPhoneExtensionTelephonyBindingRequest", "azure.ai.projects.models.CreateTelephonyCallJobRequest": "Azure.AI.Projects.CreateTelephonyCallJobRequest", - "azure.ai.projects.models.CreateTelephonyCampaignRequest": "Azure.AI.Projects.CreateTelephonyCampaignRequest", "azure.ai.projects.models.CreateTranscriptionResponseJsonUsage": "OpenAI.CreateTranscriptionResponseJsonUsage", "azure.ai.projects.models.CreateTwilioTelephonyBindingRequest": "Azure.AI.Projects.CreateTwilioTelephonyBindingRequest", "azure.ai.projects.models.Trigger": "Azure.AI.Projects.Trigger", @@ -232,7 +231,6 @@ "azure.ai.projects.models.HybridSearchOptions": "OpenAI.HybridSearchOptions", "azure.ai.projects.models.ImageGenTool": "OpenAI.ImageGenTool", "azure.ai.projects.models.ImageGenToolInputImageMask": "OpenAI.ImageGenToolInputImageMask", - "azure.ai.projects.models.ImportTelephonyCampaignRecipientsRequest": "Azure.AI.Projects.ImportTelephonyCampaignRecipientsRequest", "azure.ai.projects.models.InlineSkillParam": "OpenAI.InlineSkillParam", "azure.ai.projects.models.InlineSkillSourceParam": "OpenAI.InlineSkillSourceParam", "azure.ai.projects.models.Insight": "Azure.AI.Projects.Insight", @@ -321,7 +319,6 @@ "azure.ai.projects.models.ProtocolVersionRecord": "Azure.AI.Projects.ProtocolVersionRecord", "azure.ai.projects.models.TelephonyTransferDestination": "Azure.AI.Projects.TelephonyTransferDestination", "azure.ai.projects.models.PSTNTelephonyTransferDestination": "Azure.AI.Projects.PSTNTelephonyTransferDestination", - "azure.ai.projects.models.PublishTelephonyCampaignRequest": "Azure.AI.Projects.PublishTelephonyCampaignRequest", "azure.ai.projects.models.RaiConfig": "Azure.AI.Projects.RaiConfig", "azure.ai.projects.models.RaiInvocationModeration": "Azure.AI.Projects.RaiInvocationModeration", "azure.ai.projects.models.RaiSseTextSelector": "Azure.AI.Projects.RaiSseTextSelector", @@ -469,15 +466,6 @@ "azure.ai.projects.models.TelephonyCallSummary": "Azure.AI.Projects.TelephonyCallSummary", "azure.ai.projects.models.TelephonyCallTiming": "Azure.AI.Projects.TelephonyCallTiming", "azure.ai.projects.models.TelephonyCallTrace": "Azure.AI.Projects.TelephonyCallTrace", - "azure.ai.projects.models.TelephonyCampaign": "Azure.AI.Projects.TelephonyCampaign", - "azure.ai.projects.models.TelephonyCampaignCallJobCounts": "Azure.AI.Projects.TelephonyCampaignCallJobCounts", - "azure.ai.projects.models.TelephonyCampaignRecipientImport": "Azure.AI.Projects.TelephonyCampaignRecipientImport", - "azure.ai.projects.models.TelephonyCampaignRecipientImportSource": "Azure.AI.Projects.TelephonyCampaignRecipientImportSource", - "azure.ai.projects.models.TelephonyCampaignRecipientMapping": "Azure.AI.Projects.TelephonyCampaignRecipientMapping", - "azure.ai.projects.models.TelephonyCampaignRecipientMappingRequest": "Azure.AI.Projects.TelephonyCampaignRecipientMappingRequest", - "azure.ai.projects.models.TelephonyCampaignSchedule": "Azure.AI.Projects.TelephonyCampaignSchedule", - "azure.ai.projects.models.TelephonyOperation": "Azure.AI.Projects.TelephonyOperation", - "azure.ai.projects.models.TelephonyOperationResource": "Azure.AI.Projects.TelephonyOperationResource", "azure.ai.projects.models.TelephonyOutboundDestination": "Azure.AI.Projects.TelephonyOutboundDestination", "azure.ai.projects.models.TelephonyOutboundRetryPolicy": "Azure.AI.Projects.TelephonyOutboundRetryPolicy", "azure.ai.projects.models.TelephonyOutboundFixedIntervalRetryPolicy": "Azure.AI.Projects.TelephonyOutboundFixedIntervalRetryPolicy", @@ -651,13 +639,6 @@ "azure.ai.projects.models.TelephonyCallJobStatus": "Azure.AI.Projects.TelephonyCallJobStatus", "azure.ai.projects.models.TelephonyOutboundRetryPolicyType": "Azure.AI.Projects.TelephonyOutboundRetryPolicyType", "azure.ai.projects.models.TelephonyCallJobTerminalReason": "Azure.AI.Projects.TelephonyCallJobTerminalReason", - "azure.ai.projects.models.TelephonyCampaignScheduleType": "Azure.AI.Projects.TelephonyCampaignScheduleType", - "azure.ai.projects.models.TelephonyCampaignConfigurationStatus": "Azure.AI.Projects.TelephonyCampaignConfigurationStatus", - "azure.ai.projects.models.TelephonyCampaignExecutionStatus": "Azure.AI.Projects.TelephonyCampaignExecutionStatus", - "azure.ai.projects.models.TelephonyCampaignRecipientImportFormat": "Azure.AI.Projects.TelephonyCampaignRecipientImportFormat", - "azure.ai.projects.models.TelephonyCampaignDuplicateHandling": "Azure.AI.Projects.TelephonyCampaignDuplicateHandling", - "azure.ai.projects.models.TelephonyCampaignRecipientImportStatus": "Azure.AI.Projects.TelephonyCampaignRecipientImportStatus", - "azure.ai.projects.models.TelephonyOperationStatus": "Azure.AI.Projects.TelephonyOperationStatus", "azure.ai.projects.models.AgentObjectType": "Azure.AI.Projects.AgentObjectType", "azure.ai.projects.models.AgentState": "Azure.AI.Projects.AgentState", "azure.ai.projects.models.AgentStateSource": "Azure.AI.Projects.AgentStateSource", @@ -897,5 +878,5 @@ "azure.ai.projects.operations.ToolboxesOperations.delete_version": "Azure.AI.Projects.Toolboxes.deleteToolboxVersion", "azure.ai.projects.aio.operations.ToolboxesOperations.delete_version": "Azure.AI.Projects.Toolboxes.deleteToolboxVersion" }, - "CrossLanguageVersion": "29ac512b249a" + "CrossLanguageVersion": "d8e42b303090" } \ No newline at end of file diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_operations.py b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_operations.py index 561e010fdd29..13049c48e842 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_operations.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/aio/operations/_operations.py @@ -173,29 +173,19 @@ build_beta_voice_agents_conversations_list_response_items_request, build_beta_voice_agents_conversations_list_responses_request, build_beta_voice_agents_telephony_cancel_call_job_request, - build_beta_voice_agents_telephony_cancel_campaign_request, build_beta_voice_agents_telephony_create_binding_request, build_beta_voice_agents_telephony_create_call_job_request, - build_beta_voice_agents_telephony_create_campaign_request, build_beta_voice_agents_telephony_delete_binding_request, build_beta_voice_agents_telephony_end_call_request, build_beta_voice_agents_telephony_get_binding_request, build_beta_voice_agents_telephony_get_call_job_request, build_beta_voice_agents_telephony_get_call_request, - build_beta_voice_agents_telephony_get_campaign_recipient_import_request, - build_beta_voice_agents_telephony_get_campaign_request, - build_beta_voice_agents_telephony_get_operation_request, build_beta_voice_agents_telephony_get_transfer_targets_request, - build_beta_voice_agents_telephony_import_campaign_recipients_request, build_beta_voice_agents_telephony_list_bindings_request, build_beta_voice_agents_telephony_list_calls_request, - build_beta_voice_agents_telephony_pause_campaign_request, - build_beta_voice_agents_telephony_publish_campaign_request, build_beta_voice_agents_telephony_replace_transfer_targets_request, - build_beta_voice_agents_telephony_resume_campaign_request, build_beta_voice_agents_telephony_transfer_call_request, build_beta_voice_agents_telephony_update_binding_request, - build_beta_voice_agents_telephony_validate_campaign_request, build_connections_get_request, build_connections_get_with_credentials_request, build_connections_list_request, @@ -18039,7 +18029,7 @@ async def download_audio(self, agent_name: str, conversation_id: str, **kwargs: return deserialized # type: ignore -class BetaVoiceAgentsTelephonyOperations: # pylint: disable=docstring-missing-param,too-many-public-methods +class BetaVoiceAgentsTelephonyOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -19653,1237 +19643,3 @@ async def cancel_call_job( return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore - - @overload - async def create_campaign( - self, - agent_name: str, - body: _models.CreateTelephonyCampaignRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.TelephonyCampaign: - """Create an outbound telephony campaign. - - Creates a draft outbound campaign. Recipients are imported and validated before the campaign - can be published. - - :param agent_name: Required. - :type agent_name: str - :param body: Required. - :type body: ~azure.ai.projects.models.CreateTelephonyCampaignRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: TelephonyCampaign. The TelephonyCampaign is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.TelephonyCampaign - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_campaign( - self, agent_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.TelephonyCampaign: - """Create an outbound telephony campaign. - - Creates a draft outbound campaign. Recipients are imported and validated before the campaign - can be published. - - :param agent_name: Required. - :type agent_name: str - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: TelephonyCampaign. The TelephonyCampaign is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.TelephonyCampaign - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_campaign( - self, agent_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.TelephonyCampaign: - """Create an outbound telephony campaign. - - Creates a draft outbound campaign. Recipients are imported and validated before the campaign - can be published. - - :param agent_name: Required. - :type agent_name: str - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: TelephonyCampaign. The TelephonyCampaign is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.TelephonyCampaign - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def create_campaign( - self, agent_name: str, body: Union[_models.CreateTelephonyCampaignRequest, JSON, IO[bytes]], **kwargs: Any - ) -> _models.TelephonyCampaign: - """Create an outbound telephony campaign. - - Creates a draft outbound campaign. Recipients are imported and validated before the campaign - can be published. - - :param agent_name: Required. - :type agent_name: str - :param body: Is one of the following types: CreateTelephonyCampaignRequest, JSON, IO[bytes] - Required. - :type body: ~azure.ai.projects.models.CreateTelephonyCampaignRequest or JSON or IO[bytes] - :return: TelephonyCampaign. The TelephonyCampaign is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.TelephonyCampaign - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.TelephonyCampaign] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_beta_voice_agents_telephony_create_campaign_request( - agent_name=agent_name, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [201]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ApiErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) - - response_headers = {} - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.TelephonyCampaign, response.json()) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def get_campaign(self, agent_name: str, campaign_id: str, **kwargs: Any) -> _models.TelephonyCampaign: - """Get an outbound telephony campaign. - - Retrieves an outbound campaign, including configuration, execution state, and aggregate - call-job counts. - - :param agent_name: Required. - :type agent_name: str - :param campaign_id: Required. - :type campaign_id: str - :return: TelephonyCampaign. The TelephonyCampaign is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.TelephonyCampaign - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.TelephonyCampaign] = kwargs.pop("cls", None) - - _request = build_beta_voice_agents_telephony_get_campaign_request( - agent_name=agent_name, - campaign_id=campaign_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ApiErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.TelephonyCampaign, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _import_campaign_recipients_initial( - self, - agent_name: str, - campaign_id: str, - body: Union[_models.ImportTelephonyCampaignRecipientsRequest, JSON, IO[bytes]], - *, - idempotency_key: str, - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_beta_voice_agents_telephony_import_campaign_recipients_request( - agent_name=agent_name, - campaign_id=campaign_id, - idempotency_key=idempotency_key, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ApiErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) - - response_headers = {} - response_headers["Operation-Location"] = self._deserialize("str", response.headers.get("Operation-Location")) - response_headers["Retry-After"] = self._deserialize("duration-seconds-int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_import_campaign_recipients( - self, - agent_name: str, - campaign_id: str, - body: _models.ImportTelephonyCampaignRecipientsRequest, - *, - idempotency_key: str, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.TelephonyOperationResource]: - """Import outbound telephony campaign recipients. - - Starts an asynchronous import of campaign recipients from a Dataset CSV, JSON array, or JSONL - file. - - :param agent_name: Required. - :type agent_name: str - :param campaign_id: Required. - :type campaign_id: str - :param body: Required. - :type body: ~azure.ai.projects.models.ImportTelephonyCampaignRecipientsRequest - :keyword idempotency_key: Required. - :paramtype idempotency_key: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns TelephonyOperationResource. The - TelephonyOperationResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.projects.models.TelephonyOperationResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_import_campaign_recipients( - self, - agent_name: str, - campaign_id: str, - body: JSON, - *, - idempotency_key: str, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.TelephonyOperationResource]: - """Import outbound telephony campaign recipients. - - Starts an asynchronous import of campaign recipients from a Dataset CSV, JSON array, or JSONL - file. - - :param agent_name: Required. - :type agent_name: str - :param campaign_id: Required. - :type campaign_id: str - :param body: Required. - :type body: JSON - :keyword idempotency_key: Required. - :paramtype idempotency_key: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns TelephonyOperationResource. The - TelephonyOperationResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.projects.models.TelephonyOperationResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_import_campaign_recipients( - self, - agent_name: str, - campaign_id: str, - body: IO[bytes], - *, - idempotency_key: str, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.TelephonyOperationResource]: - """Import outbound telephony campaign recipients. - - Starts an asynchronous import of campaign recipients from a Dataset CSV, JSON array, or JSONL - file. - - :param agent_name: Required. - :type agent_name: str - :param campaign_id: Required. - :type campaign_id: str - :param body: Required. - :type body: IO[bytes] - :keyword idempotency_key: Required. - :paramtype idempotency_key: str - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns TelephonyOperationResource. The - TelephonyOperationResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.projects.models.TelephonyOperationResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_import_campaign_recipients( - self, - agent_name: str, - campaign_id: str, - body: Union[_models.ImportTelephonyCampaignRecipientsRequest, JSON, IO[bytes]], - *, - idempotency_key: str, - **kwargs: Any - ) -> AsyncLROPoller[_models.TelephonyOperationResource]: - """Import outbound telephony campaign recipients. - - Starts an asynchronous import of campaign recipients from a Dataset CSV, JSON array, or JSONL - file. - - :param agent_name: Required. - :type agent_name: str - :param campaign_id: Required. - :type campaign_id: str - :param body: Is one of the following types: ImportTelephonyCampaignRecipientsRequest, JSON, - IO[bytes] Required. - :type body: ~azure.ai.projects.models.ImportTelephonyCampaignRecipientsRequest or JSON or - IO[bytes] - :keyword idempotency_key: Required. - :paramtype idempotency_key: str - :return: An instance of AsyncLROPoller that returns TelephonyOperationResource. The - TelephonyOperationResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.projects.models.TelephonyOperationResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.TelephonyOperationResource] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._import_campaign_recipients_initial( - agent_name=agent_name, - campaign_id=campaign_id, - body=body, - idempotency_key=idempotency_key, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response_headers = {} - response = pipeline_response.http_response - response_headers["Operation-Location"] = self._deserialize( - "str", response.headers.get("Operation-Location") - ) - response_headers["Retry-After"] = self._deserialize( - "duration-seconds-int", response.headers.get("Retry-After") - ) - - deserialized = _deserialize(_models.TelephonyOperationResource, response.json().get("resource", {})) - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, - AsyncLROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs), - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.TelephonyOperationResource].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.TelephonyOperationResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @distributed_trace_async - async def get_campaign_recipient_import( - self, agent_name: str, campaign_id: str, import_id: str, **kwargs: Any - ) -> _models.TelephonyCampaignRecipientImport: - """Get an outbound telephony campaign recipient import. - - Retrieves the durable status and counters for a campaign recipient import. - - :param agent_name: Required. - :type agent_name: str - :param campaign_id: Required. - :type campaign_id: str - :param import_id: Required. - :type import_id: str - :return: TelephonyCampaignRecipientImport. The TelephonyCampaignRecipientImport is compatible - with MutableMapping - :rtype: ~azure.ai.projects.models.TelephonyCampaignRecipientImport - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.TelephonyCampaignRecipientImport] = kwargs.pop("cls", None) - - _request = build_beta_voice_agents_telephony_get_campaign_recipient_import_request( - agent_name=agent_name, - campaign_id=campaign_id, - import_id=import_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ApiErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.TelephonyCampaignRecipientImport, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _validate_campaign_initial( - self, agent_name: str, campaign_id: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_beta_voice_agents_telephony_validate_campaign_request( - agent_name=agent_name, - campaign_id=campaign_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ApiErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) - - response_headers = {} - response_headers["Operation-Location"] = self._deserialize("str", response.headers.get("Operation-Location")) - response_headers["Retry-After"] = self._deserialize("duration-seconds-int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_validate_campaign( - self, agent_name: str, campaign_id: str, **kwargs: Any - ) -> AsyncLROPoller[_models.TelephonyOperationResource]: - """Validate an outbound telephony campaign. - - Starts asynchronous validation of the current campaign draft and imported recipient snapshot. - - :param agent_name: Required. - :type agent_name: str - :param campaign_id: Required. - :type campaign_id: str - :return: An instance of AsyncLROPoller that returns TelephonyOperationResource. The - TelephonyOperationResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.projects.models.TelephonyOperationResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.TelephonyOperationResource] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._validate_campaign_initial( - agent_name=agent_name, - campaign_id=campaign_id, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response_headers = {} - response = pipeline_response.http_response - response_headers["Operation-Location"] = self._deserialize( - "str", response.headers.get("Operation-Location") - ) - response_headers["Retry-After"] = self._deserialize( - "duration-seconds-int", response.headers.get("Retry-After") - ) - - deserialized = _deserialize(_models.TelephonyOperationResource, response.json().get("resource", {})) - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, - AsyncLROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs), - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.TelephonyOperationResource].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.TelephonyOperationResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _publish_campaign_initial( - self, - agent_name: str, - campaign_id: str, - body: Union[_models.PublishTelephonyCampaignRequest, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_beta_voice_agents_telephony_publish_campaign_request( - agent_name=agent_name, - campaign_id=campaign_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ApiErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) - - response_headers = {} - response_headers["Operation-Location"] = self._deserialize("str", response.headers.get("Operation-Location")) - response_headers["Retry-After"] = self._deserialize("duration-seconds-int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_publish_campaign( - self, - agent_name: str, - campaign_id: str, - body: _models.PublishTelephonyCampaignRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.TelephonyOperationResource]: - """Publish an outbound telephony campaign. - - Permanently locks the validated campaign draft and starts asynchronous call-job - materialization. - - :param agent_name: Required. - :type agent_name: str - :param campaign_id: Required. - :type campaign_id: str - :param body: Required. - :type body: ~azure.ai.projects.models.PublishTelephonyCampaignRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns TelephonyOperationResource. The - TelephonyOperationResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.projects.models.TelephonyOperationResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_publish_campaign( - self, agent_name: str, campaign_id: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.TelephonyOperationResource]: - """Publish an outbound telephony campaign. - - Permanently locks the validated campaign draft and starts asynchronous call-job - materialization. - - :param agent_name: Required. - :type agent_name: str - :param campaign_id: Required. - :type campaign_id: str - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns TelephonyOperationResource. The - TelephonyOperationResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.projects.models.TelephonyOperationResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_publish_campaign( - self, - agent_name: str, - campaign_id: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.TelephonyOperationResource]: - """Publish an outbound telephony campaign. - - Permanently locks the validated campaign draft and starts asynchronous call-job - materialization. - - :param agent_name: Required. - :type agent_name: str - :param campaign_id: Required. - :type campaign_id: str - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns TelephonyOperationResource. The - TelephonyOperationResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.projects.models.TelephonyOperationResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_publish_campaign( - self, - agent_name: str, - campaign_id: str, - body: Union[_models.PublishTelephonyCampaignRequest, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.TelephonyOperationResource]: - """Publish an outbound telephony campaign. - - Permanently locks the validated campaign draft and starts asynchronous call-job - materialization. - - :param agent_name: Required. - :type agent_name: str - :param campaign_id: Required. - :type campaign_id: str - :param body: Is one of the following types: PublishTelephonyCampaignRequest, JSON, IO[bytes] - Required. - :type body: ~azure.ai.projects.models.PublishTelephonyCampaignRequest or JSON or IO[bytes] - :return: An instance of AsyncLROPoller that returns TelephonyOperationResource. The - TelephonyOperationResource is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.projects.models.TelephonyOperationResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.TelephonyOperationResource] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._publish_campaign_initial( - agent_name=agent_name, - campaign_id=campaign_id, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response_headers = {} - response = pipeline_response.http_response - response_headers["Operation-Location"] = self._deserialize( - "str", response.headers.get("Operation-Location") - ) - response_headers["Retry-After"] = self._deserialize( - "duration-seconds-int", response.headers.get("Retry-After") - ) - - deserialized = _deserialize(_models.TelephonyOperationResource, response.json().get("resource", {})) - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, - AsyncLROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs), - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.TelephonyOperationResource].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.TelephonyOperationResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @distributed_trace_async - async def pause_campaign(self, agent_name: str, campaign_id: str, **kwargs: Any) -> _models.TelephonyCampaign: - """Pause an outbound telephony campaign. - - Pauses dispatch of call jobs owned by a published campaign. - - :param agent_name: Required. - :type agent_name: str - :param campaign_id: Required. - :type campaign_id: str - :return: TelephonyCampaign. The TelephonyCampaign is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.TelephonyCampaign - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.TelephonyCampaign] = kwargs.pop("cls", None) - - _request = build_beta_voice_agents_telephony_pause_campaign_request( - agent_name=agent_name, - campaign_id=campaign_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ApiErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.TelephonyCampaign, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def resume_campaign(self, agent_name: str, campaign_id: str, **kwargs: Any) -> _models.TelephonyCampaign: - """Resume an outbound telephony campaign. - - Resumes dispatch of call jobs owned by a paused campaign. - - :param agent_name: Required. - :type agent_name: str - :param campaign_id: Required. - :type campaign_id: str - :return: TelephonyCampaign. The TelephonyCampaign is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.TelephonyCampaign - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.TelephonyCampaign] = kwargs.pop("cls", None) - - _request = build_beta_voice_agents_telephony_resume_campaign_request( - agent_name=agent_name, - campaign_id=campaign_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ApiErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.TelephonyCampaign, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def cancel_campaign(self, agent_name: str, campaign_id: str, **kwargs: Any) -> _models.TelephonyCampaign: - """Cancel an outbound telephony campaign. - - Cancels a campaign and prevents any further call-job dispatch. - - :param agent_name: Required. - :type agent_name: str - :param campaign_id: Required. - :type campaign_id: str - :return: TelephonyCampaign. The TelephonyCampaign is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.TelephonyCampaign - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.TelephonyCampaign] = kwargs.pop("cls", None) - - _request = build_beta_voice_agents_telephony_cancel_campaign_request( - agent_name=agent_name, - campaign_id=campaign_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ApiErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.TelephonyCampaign, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def get_operation(self, agent_name: str, operation_id: str, **kwargs: Any) -> _models.TelephonyOperation: - """Get an outbound telephony operation. - - Retrieves an asynchronous outbound campaign operation. - - :param agent_name: Required. - :type agent_name: str - :param operation_id: Required. - :type operation_id: str - :return: TelephonyOperation. The TelephonyOperation is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.TelephonyOperation - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.TelephonyOperation] = kwargs.pop("cls", None) - - _request = build_beta_voice_agents_telephony_get_operation_request( - agent_name=agent_name, - operation_id=operation_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ApiErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.TelephonyOperation, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/models/__init__.py b/sdk/ai/azure-ai-projects/azure/ai/projects/models/__init__.py index d647b8cf3fb1..ff1fcd74ac3f 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/models/__init__.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/models/__init__.py @@ -136,7 +136,6 @@ CreateTeamsPhoneExtensionTelephonyBindingRequest, CreateTelephonyBindingRequest, CreateTelephonyCallJobRequest, - CreateTelephonyCampaignRequest, CreateTranscriptionResponseJsonUsage, CreateTwilioTelephonyBindingRequest, CronTrigger, @@ -232,7 +231,6 @@ HybridSearchOptions, ImageGenTool, ImageGenToolInputImageMask, - ImportTelephonyCampaignRecipientsRequest, Index, InlineSkillParam, InlineSkillSourceParam, @@ -322,7 +320,6 @@ PromptEvaluatorGenerationJobSource, ProtocolConfiguration, ProtocolVersionRecord, - PublishTelephonyCampaignRequest, RaiConfig, RaiInvocationModeration, RaiSseTextSelector, @@ -477,15 +474,6 @@ TelephonyCallSummary, TelephonyCallTiming, TelephonyCallTrace, - TelephonyCampaign, - TelephonyCampaignCallJobCounts, - TelephonyCampaignRecipientImport, - TelephonyCampaignRecipientImportSource, - TelephonyCampaignRecipientMapping, - TelephonyCampaignRecipientMappingRequest, - TelephonyCampaignSchedule, - TelephonyOperation, - TelephonyOperationResource, TelephonyOutboundDestination, TelephonyOutboundFixedIntervalRetryPolicy, TelephonyOutboundRetryPolicy, @@ -764,13 +752,6 @@ TelephonyCallTimestampSource, TelephonyCallTraceMode, TelephonyCallTraceStatus, - TelephonyCampaignConfigurationStatus, - TelephonyCampaignDuplicateHandling, - TelephonyCampaignExecutionStatus, - TelephonyCampaignRecipientImportFormat, - TelephonyCampaignRecipientImportStatus, - TelephonyCampaignScheduleType, - TelephonyOperationStatus, TelephonyOutboundDestinationType, TelephonyOutboundRetryPolicyType, TelephonyProvider, @@ -934,7 +915,6 @@ "CreateTeamsPhoneExtensionTelephonyBindingRequest", "CreateTelephonyBindingRequest", "CreateTelephonyCallJobRequest", - "CreateTelephonyCampaignRequest", "CreateTranscriptionResponseJsonUsage", "CreateTwilioTelephonyBindingRequest", "CronTrigger", @@ -1030,7 +1010,6 @@ "HybridSearchOptions", "ImageGenTool", "ImageGenToolInputImageMask", - "ImportTelephonyCampaignRecipientsRequest", "Index", "InlineSkillParam", "InlineSkillSourceParam", @@ -1120,7 +1099,6 @@ "PromptEvaluatorGenerationJobSource", "ProtocolConfiguration", "ProtocolVersionRecord", - "PublishTelephonyCampaignRequest", "RaiConfig", "RaiInvocationModeration", "RaiSseTextSelector", @@ -1275,15 +1253,6 @@ "TelephonyCallSummary", "TelephonyCallTiming", "TelephonyCallTrace", - "TelephonyCampaign", - "TelephonyCampaignCallJobCounts", - "TelephonyCampaignRecipientImport", - "TelephonyCampaignRecipientImportSource", - "TelephonyCampaignRecipientMapping", - "TelephonyCampaignRecipientMappingRequest", - "TelephonyCampaignSchedule", - "TelephonyOperation", - "TelephonyOperationResource", "TelephonyOutboundDestination", "TelephonyOutboundFixedIntervalRetryPolicy", "TelephonyOutboundRetryPolicy", @@ -1559,13 +1528,6 @@ "TelephonyCallTimestampSource", "TelephonyCallTraceMode", "TelephonyCallTraceStatus", - "TelephonyCampaignConfigurationStatus", - "TelephonyCampaignDuplicateHandling", - "TelephonyCampaignExecutionStatus", - "TelephonyCampaignRecipientImportFormat", - "TelephonyCampaignRecipientImportStatus", - "TelephonyCampaignScheduleType", - "TelephonyOperationStatus", "TelephonyOutboundDestinationType", "TelephonyOutboundRetryPolicyType", "TelephonyProvider", diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/models/_enums.py b/sdk/ai/azure-ai-projects/azure/ai/projects/models/_enums.py index 6408335cfc1c..5b3a8963e41d 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/models/_enums.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/models/_enums.py @@ -1976,101 +1976,6 @@ class TelephonyCallTraceStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Trace creation failed.""" -class TelephonyCampaignConfigurationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The immutable-configuration lifecycle status of an outbound campaign.""" - - DRAFT = "draft" - """DRAFT.""" - IMPORTING = "importing" - """IMPORTING.""" - VALIDATING = "validating" - """VALIDATING.""" - PUBLISHING = "publishing" - """PUBLISHING.""" - PUBLISHED = "published" - """PUBLISHED.""" - PUBLISH_FAILED = "publish_failed" - """PUBLISH_FAILED.""" - - -class TelephonyCampaignDuplicateHandling(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """How duplicate recipient keys in an import are handled.""" - - REJECT = "reject" - """Reject duplicate recipient keys.""" - KEEP_EACH = "keep_each" - """Keep each recipient entry, distinguishing duplicates by recipient item key.""" - MERGE = "merge" - """Merge entries with the same recipient key.""" - - -class TelephonyCampaignExecutionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The execution lifecycle status of a published outbound campaign.""" - - NONE = "none" - """NONE.""" - SCHEDULED = "scheduled" - """SCHEDULED.""" - RUNNING = "running" - """RUNNING.""" - PAUSED = "paused" - """PAUSED.""" - COMPLETED = "completed" - """COMPLETED.""" - FAILED = "failed" - """FAILED.""" - CANCELLED = "cancelled" - """CANCELLED.""" - - -class TelephonyCampaignRecipientImportFormat(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """A supported Dataset recipient file format.""" - - CSV = "csv" - """A comma-separated values file.""" - JSON = "json" - """A JSON file containing an array of recipient objects.""" - JSONL = "jsonl" - """A JSON Lines file containing one recipient object per line.""" - - -class TelephonyCampaignRecipientImportStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The lifecycle status of a campaign recipient import.""" - - RUNNING = "running" - """RUNNING.""" - SUCCEEDED = "succeeded" - """SUCCEEDED.""" - FAILED = "failed" - """FAILED.""" - - -class TelephonyCampaignScheduleType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """When a published outbound campaign becomes eligible to dispatch calls.""" - - IMMEDIATE = "immediate" - """Calls are eligible immediately after publication.""" - SCHEDULED = "scheduled" - """Calls are eligible at the scheduled start instant.""" - - -class TelephonyOperationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The lifecycle status of an outbound telephony operation.""" - - NOT_STARTED = "not_started" - """NOT_STARTED.""" - RUNNING = "running" - """RUNNING.""" - SUCCEEDED = "succeeded" - """SUCCEEDED.""" - FAILED = "failed" - """FAILED.""" - CANCELLED = "cancelled" - """CANCELLED.""" - UNKNOWN_STATUS = "unknown" - """UNKNOWN_STATUS.""" - - class TelephonyOutboundDestinationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The type of destination for an outbound call.""" diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/models/_models.py b/sdk/ai/azure-ai-projects/azure/ai/projects/models/_models.py index b2c745ca2660..3ca198e821b9 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/models/_models.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/models/_models.py @@ -6342,73 +6342,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class CreateTelephonyCampaignRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A request to create a draft outbound campaign. - - :ivar display_name: A customer-visible name for the campaign. Required. - :vartype display_name: str - :ivar connection_name: The Foundry connection name in the current project used to originate - campaign calls. Its category selects Twilio or Azure Communication Services / Teams Phone - Extension. No inbound telephony binding is required. Required. - :vartype connection_name: str - :ivar source: The caller identity used to originate campaign calls. For a Twilio connection, - provide an authorized E.164 phone number. For an Azure Communication Services / Teams Phone - Extension connection, provide the Teams Resource Account object ID. The identity type is - inferred from the connection category; originating does not change inbound routing. Required. - :vartype source: str - :ivar purpose: An optional customer-declared purpose for campaign calls. - :vartype purpose: str - :ivar schedule: When the published campaign becomes eligible to dispatch calls. - :vartype schedule: ~azure.ai.projects.models.TelephonyCampaignSchedule - :ivar retry_policy: The provider-attempt retry policy inherited by every materialized call job. - :vartype retry_policy: ~azure.ai.projects.models.TelephonyOutboundRetryPolicy - """ - - display_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A customer-visible name for the campaign. Required.""" - connection_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The Foundry connection name in the current project used to originate campaign calls. Its - category selects Twilio or Azure Communication Services / Teams Phone Extension. No inbound - telephony binding is required. Required.""" - source: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The caller identity used to originate campaign calls. For a Twilio connection, provide an - authorized E.164 phone number. For an Azure Communication Services / Teams Phone Extension - connection, provide the Teams Resource Account object ID. The identity type is inferred from - the connection category; originating does not change inbound routing. Required.""" - purpose: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """An optional customer-declared purpose for campaign calls.""" - schedule: Optional["_models.TelephonyCampaignSchedule"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """When the published campaign becomes eligible to dispatch calls.""" - retry_policy: Optional["_models.TelephonyOutboundRetryPolicy"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The provider-attempt retry policy inherited by every materialized call job.""" - - @overload - def __init__( - self, - *, - display_name: str, - connection_name: str, - source: str, - purpose: Optional[str] = None, - schedule: Optional["_models.TelephonyCampaignSchedule"] = None, - retry_policy: Optional["_models.TelephonyOutboundRetryPolicy"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - class CreateTranscriptionResponseJsonUsage(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Token usage statistics for the request. @@ -10895,59 +10828,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ImportTelephonyCampaignRecipientsRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A request to import campaign recipients from a Dataset CSV, JSON array, or JSONL file. Imported - Agent-declared structured inputs follow the Agent definition's schema, required, and - default-value semantics. - - :ivar source: Required. - :vartype source: ~azure.ai.projects.models.TelephonyCampaignRecipientImportSource - :ivar mapping: Mappings from recipient properties to source fields or columns. Omit this - property or an individual entry to use same-named source fields. Destination and recipient-key - source fields are required. Optional source fields may be absent, except the recipient item key - when ``duplicate_handling`` is ``keep_each``. - :vartype mapping: ~azure.ai.projects.models.TelephonyCampaignRecipientMappingRequest - :ivar duplicate_handling: Known values are: "reject", "keep_each", and "merge". - :vartype duplicate_handling: str or - ~azure.ai.projects.models.TelephonyCampaignDuplicateHandling - """ - - source: "_models.TelephonyCampaignRecipientImportSource" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Required.""" - mapping: Optional["_models.TelephonyCampaignRecipientMappingRequest"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Mappings from recipient properties to source fields or columns. Omit this property or an - individual entry to use same-named source fields. Destination and recipient-key source fields - are required. Optional source fields may be absent, except the recipient item key when - ``duplicate_handling`` is ``keep_each``.""" - duplicate_handling: Optional[Union[str, "_models.TelephonyCampaignDuplicateHandling"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Known values are: \"reject\", \"keep_each\", and \"merge\".""" - - @overload - def __init__( - self, - *, - source: "_models.TelephonyCampaignRecipientImportSource", - mapping: Optional["_models.TelephonyCampaignRecipientMappingRequest"] = None, - duplicate_handling: Optional[Union[str, "_models.TelephonyCampaignDuplicateHandling"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - class InlineSkillParam( ContainerSkill, discriminator="inline" ): # pylint: disable=docstring-keyword-should-match-keyword-only @@ -14894,34 +14774,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.kind = TelephonyTransferDestinationKind.PSTN # type: ignore -class PublishTelephonyCampaignRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A request to publish a validated outbound campaign draft. - - :ivar validation_id: Required. - :vartype validation_id: str - """ - - validation_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - - @overload - def __init__( - self, - *, - validation_id: str, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - class RaiConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Configuration for Responsible AI (RAI) content filtering and safety features. @@ -22819,625 +22671,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class TelephonyCampaign(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A durable outbound campaign owned by a voice agent. - - :ivar display_name: A customer-visible name for the campaign. Required. - :vartype display_name: str - :ivar connection_name: The Foundry connection name in the current project used to originate - campaign calls. Its category selects Twilio or Azure Communication Services / Teams Phone - Extension. No inbound telephony binding is required. Required. - :vartype connection_name: str - :ivar source: The caller identity used to originate campaign calls. For a Twilio connection, - provide an authorized E.164 phone number. For an Azure Communication Services / Teams Phone - Extension connection, provide the Teams Resource Account object ID. The identity type is - inferred from the connection category; originating does not change inbound routing. Required. - :vartype source: str - :ivar purpose: An optional customer-declared purpose for campaign calls. - :vartype purpose: str - :ivar schedule: When the published campaign becomes eligible to dispatch calls. - :vartype schedule: ~azure.ai.projects.models.TelephonyCampaignSchedule - :ivar id: Required. - :vartype id: str - :ivar object: Required. Default value is "telephony.campaign". - :vartype object: str - :ivar agent_name: Required. - :vartype agent_name: str - :ivar configuration_status: Required. Known values are: "draft", "importing", "validating", - "publishing", "published", and "publish_failed". - :vartype configuration_status: str or - ~azure.ai.projects.models.TelephonyCampaignConfigurationStatus - :ivar execution_status: Required. Known values are: "none", "scheduled", "running", "paused", - "completed", "failed", and "cancelled". - :vartype execution_status: str or ~azure.ai.projects.models.TelephonyCampaignExecutionStatus - :ivar retry_policy: Required. - :vartype retry_policy: ~azure.ai.projects.models.TelephonyOutboundRetryPolicy - :ivar latest_successful_validation_id: - :vartype latest_successful_validation_id: str - :ivar active_validation_id: - :vartype active_validation_id: str - :ivar active_recipient_import_id: - :vartype active_recipient_import_id: str - :ivar published_at: - :vartype published_at: ~datetime.datetime - :ivar call_job_counts: Required. - :vartype call_job_counts: ~azure.ai.projects.models.TelephonyCampaignCallJobCounts - :ivar created_at: Required. - :vartype created_at: ~datetime.datetime - :ivar updated_at: Required. - :vartype updated_at: ~datetime.datetime - """ - - display_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A customer-visible name for the campaign. Required.""" - connection_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The Foundry connection name in the current project used to originate campaign calls. Its - category selects Twilio or Azure Communication Services / Teams Phone Extension. No inbound - telephony binding is required. Required.""" - source: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The caller identity used to originate campaign calls. For a Twilio connection, provide an - authorized E.164 phone number. For an Azure Communication Services / Teams Phone Extension - connection, provide the Teams Resource Account object ID. The identity type is inferred from - the connection category; originating does not change inbound routing. Required.""" - purpose: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """An optional customer-declared purpose for campaign calls.""" - schedule: Optional["_models.TelephonyCampaignSchedule"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """When the published campaign becomes eligible to dispatch calls.""" - id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - object: Literal["telephony.campaign"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required. Default value is \"telephony.campaign\".""" - agent_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - configuration_status: Union[str, "_models.TelephonyCampaignConfigurationStatus"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Required. Known values are: \"draft\", \"importing\", \"validating\", \"publishing\", - \"published\", and \"publish_failed\".""" - execution_status: Union[str, "_models.TelephonyCampaignExecutionStatus"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Required. Known values are: \"none\", \"scheduled\", \"running\", \"paused\", \"completed\", - \"failed\", and \"cancelled\".""" - retry_policy: "_models.TelephonyOutboundRetryPolicy" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Required.""" - latest_successful_validation_id: Optional[str] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - active_validation_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - active_recipient_import_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - published_at: Optional[datetime.datetime] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - call_job_counts: "_models.TelephonyCampaignCallJobCounts" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Required.""" - created_at: datetime.datetime = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """Required.""" - updated_at: datetime.datetime = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """Required.""" - - @overload - def __init__( - self, - *, - display_name: str, - connection_name: str, - source: str, - id: str, # pylint: disable=redefined-builtin - agent_name: str, - configuration_status: Union[str, "_models.TelephonyCampaignConfigurationStatus"], - execution_status: Union[str, "_models.TelephonyCampaignExecutionStatus"], - retry_policy: "_models.TelephonyOutboundRetryPolicy", - call_job_counts: "_models.TelephonyCampaignCallJobCounts", - created_at: datetime.datetime, - updated_at: datetime.datetime, - purpose: Optional[str] = None, - schedule: Optional["_models.TelephonyCampaignSchedule"] = None, - latest_successful_validation_id: Optional[str] = None, - active_validation_id: Optional[str] = None, - active_recipient_import_id: Optional[str] = None, - published_at: Optional[datetime.datetime] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.object: Literal["telephony.campaign"] = "telephony.campaign" - - -class TelephonyCampaignCallJobCounts(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Aggregate call-job counts for an outbound campaign. - - :ivar total: Required. - :vartype total: int - :ivar pending: Required. - :vartype pending: int - :ivar in_progress: Required. - :vartype in_progress: int - :ivar completed: Required. - :vartype completed: int - :ivar failed: Required. - :vartype failed: int - :ivar blocked: Required. - :vartype blocked: int - :ivar cancelled: Required. - :vartype cancelled: int - :ivar expired: Required. - :vartype expired: int - """ - - total: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - pending: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - in_progress: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - completed: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - failed: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - blocked: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - cancelled: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - expired: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - - @overload - def __init__( - self, - *, - total: int, - pending: int, - in_progress: int, - completed: int, - failed: int, - blocked: int, - cancelled: int, - expired: int, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class TelephonyCampaignRecipientImport(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A durable campaign recipient-import record. - - :ivar id: Required. - :vartype id: str - :ivar object: Required. Default value is "telephony.campaign.recipient_import". - :vartype object: str - :ivar campaign_id: Required. - :vartype campaign_id: str - :ivar status: Required. Known values are: "running", "succeeded", and "failed". - :vartype status: str or ~azure.ai.projects.models.TelephonyCampaignRecipientImportStatus - :ivar source: Required. - :vartype source: ~azure.ai.projects.models.TelephonyCampaignRecipientImportSource - :ivar mapping: - :vartype mapping: ~azure.ai.projects.models.TelephonyCampaignRecipientMapping - :ivar duplicate_handling: Required. Known values are: "reject", "keep_each", and "merge". - :vartype duplicate_handling: str or - ~azure.ai.projects.models.TelephonyCampaignDuplicateHandling - :ivar rows_processed: Required. - :vartype rows_processed: int - :ivar eligible_recipient_count: Required. - :vartype eligible_recipient_count: int - :ivar invalid_recipient_count: Required. - :vartype invalid_recipient_count: int - :ivar error_code: - :vartype error_code: str - :ivar error_message: - :vartype error_message: str - :ivar created_at: Required. - :vartype created_at: ~datetime.datetime - :ivar updated_at: Required. - :vartype updated_at: ~datetime.datetime - """ - - id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - object: Literal["telephony.campaign.recipient_import"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Required. Default value is \"telephony.campaign.recipient_import\".""" - campaign_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - status: Union[str, "_models.TelephonyCampaignRecipientImportStatus"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Required. Known values are: \"running\", \"succeeded\", and \"failed\".""" - source: "_models.TelephonyCampaignRecipientImportSource" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Required.""" - mapping: Optional["_models.TelephonyCampaignRecipientMapping"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - duplicate_handling: Union[str, "_models.TelephonyCampaignDuplicateHandling"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Required. Known values are: \"reject\", \"keep_each\", and \"merge\".""" - rows_processed: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - eligible_recipient_count: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - invalid_recipient_count: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - error_code: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - error_message: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - created_at: datetime.datetime = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """Required.""" - updated_at: datetime.datetime = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """Required.""" - - @overload - def __init__( - self, - *, - id: str, # pylint: disable=redefined-builtin - campaign_id: str, - status: Union[str, "_models.TelephonyCampaignRecipientImportStatus"], - source: "_models.TelephonyCampaignRecipientImportSource", - duplicate_handling: Union[str, "_models.TelephonyCampaignDuplicateHandling"], - rows_processed: int, - eligible_recipient_count: int, - invalid_recipient_count: int, - created_at: datetime.datetime, - updated_at: datetime.datetime, - mapping: Optional["_models.TelephonyCampaignRecipientMapping"] = None, - error_code: Optional[str] = None, - error_message: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.object: Literal["telephony.campaign.recipient_import"] = "telephony.campaign.recipient_import" - - -class TelephonyCampaignRecipientImportSource(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A Dataset source for campaign recipient import. - - :ivar type: Required. Default value is "dataset". - :vartype type: str - :ivar dataset_name: Required. - :vartype dataset_name: str - :ivar dataset_version: Required. - :vartype dataset_version: str - :ivar file_name: A relative path to a CSV, JSON array, or JSONL file in the Dataset version. - Required. - :vartype file_name: str - :ivar format: Required. Known values are: "csv", "json", and "jsonl". - :vartype format: str or ~azure.ai.projects.models.TelephonyCampaignRecipientImportFormat - """ - - type: Literal["dataset"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required. Default value is \"dataset\".""" - dataset_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - dataset_version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - file_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A relative path to a CSV, JSON array, or JSONL file in the Dataset version. Required.""" - format: Union[str, "_models.TelephonyCampaignRecipientImportFormat"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Required. Known values are: \"csv\", \"json\", and \"jsonl\".""" - - @overload - def __init__( - self, - *, - dataset_name: str, - dataset_version: str, - file_name: str, - format: Union[str, "_models.TelephonyCampaignRecipientImportFormat"], - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.type: Literal["dataset"] = "dataset" - - -class TelephonyCampaignRecipientMapping(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Source fields or CSV columns mapped into each campaign recipient. Every unmapped CSV column or - JSON/JSONL top-level property becomes a same-named structured input. CSV cells are preserved as - strings until Agent-declared inputs are parsed according to their schemas; additional inputs - remain strings. - - :ivar destination: The source field containing the destination E.164 phone number. Defaults to - ``destination``. The source field is required for each recipient. Required. - :vartype destination: str - :ivar recipient_key: The source field containing the recipient key. Defaults to - ``recipient_key``. The source field is required for each recipient. Required. - :vartype recipient_key: str - :ivar recipient_item_key: The source field containing the recipient item key. Defaults to - ``recipient_item_key``. The source field is required when ``duplicate_handling`` is - ``keep_each``; otherwise it may be absent. - :vartype recipient_item_key: str - :ivar not_before: The source field containing the earliest dispatch time as a Unix timestamp in - seconds. Defaults to ``not_before``. If the source field is absent, no per-recipient start - bound is applied. - :vartype not_before: str - :ivar expires_at: The source field containing the expiry time as a Unix timestamp in seconds. - Defaults to ``expires_at``. If the source field is absent, no per-recipient expiry bound is - applied. - :vartype expires_at: str - """ - - destination: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The source field containing the destination E.164 phone number. Defaults to ``destination``. - The source field is required for each recipient. Required.""" - recipient_key: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The source field containing the recipient key. Defaults to ``recipient_key``. The source field - is required for each recipient. Required.""" - recipient_item_key: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The source field containing the recipient item key. Defaults to ``recipient_item_key``. The - source field is required when ``duplicate_handling`` is ``keep_each``; otherwise it may be - absent.""" - not_before: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The source field containing the earliest dispatch time as a Unix timestamp in seconds. Defaults - to ``not_before``. If the source field is absent, no per-recipient start bound is applied.""" - expires_at: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The source field containing the expiry time as a Unix timestamp in seconds. Defaults to - ``expires_at``. If the source field is absent, no per-recipient expiry bound is applied.""" - - @overload - def __init__( - self, - *, - destination: str, - recipient_key: str, - recipient_item_key: Optional[str] = None, - not_before: Optional[str] = None, - expires_at: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class TelephonyCampaignRecipientMappingRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Optional source-field mappings for a recipient import. Each omitted entry uses its same-named - source field. - - :ivar destination: The source field containing the destination E.164 phone number. Defaults to - ``destination``. The source field is required for each recipient. - :vartype destination: str - :ivar recipient_key: The source field containing the recipient key. Defaults to - ``recipient_key``. The source field is required for each recipient. - :vartype recipient_key: str - :ivar recipient_item_key: The source field containing the recipient item key. Defaults to - ``recipient_item_key``. The source field is required when ``duplicate_handling`` is - ``keep_each``; otherwise it may be absent. - :vartype recipient_item_key: str - :ivar not_before: The source field containing the earliest dispatch time as a Unix timestamp in - seconds. Defaults to ``not_before``. If the source field is absent, no per-recipient start - bound is applied. - :vartype not_before: str - :ivar expires_at: The source field containing the expiry time as a Unix timestamp in seconds. - Defaults to ``expires_at``. If the source field is absent, no per-recipient expiry bound is - applied. - :vartype expires_at: str - """ - - destination: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The source field containing the destination E.164 phone number. Defaults to ``destination``. - The source field is required for each recipient.""" - recipient_key: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The source field containing the recipient key. Defaults to ``recipient_key``. The source field - is required for each recipient.""" - recipient_item_key: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The source field containing the recipient item key. Defaults to ``recipient_item_key``. The - source field is required when ``duplicate_handling`` is ``keep_each``; otherwise it may be - absent.""" - not_before: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The source field containing the earliest dispatch time as a Unix timestamp in seconds. Defaults - to ``not_before``. If the source field is absent, no per-recipient start bound is applied.""" - expires_at: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The source field containing the expiry time as a Unix timestamp in seconds. Defaults to - ``expires_at``. If the source field is absent, no per-recipient expiry bound is applied.""" - - @overload - def __init__( - self, - *, - destination: Optional[str] = None, - recipient_key: Optional[str] = None, - recipient_item_key: Optional[str] = None, - not_before: Optional[str] = None, - expires_at: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class TelephonyCampaignSchedule(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The schedule for an outbound campaign. - - :ivar type: Whether calls are eligible immediately after publication or at a future instant. - Required. Known values are: "immediate" and "scheduled". - :vartype type: str or ~azure.ai.projects.models.TelephonyCampaignScheduleType - :ivar start_at: The scheduled start instant. Required only when ``type`` is ``scheduled``. - :vartype start_at: ~datetime.datetime - """ - - type: Union[str, "_models.TelephonyCampaignScheduleType"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Whether calls are eligible immediately after publication or at a future instant. Required. - Known values are: \"immediate\" and \"scheduled\".""" - start_at: Optional[datetime.datetime] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """The scheduled start instant. Required only when ``type`` is ``scheduled``.""" - - @overload - def __init__( - self, - *, - type: Union[str, "_models.TelephonyCampaignScheduleType"], - start_at: Optional[datetime.datetime] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class TelephonyOperation(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """An asynchronous outbound telephony operation. - - :ivar id: Required. - :vartype id: str - :ivar object: Required. Default value is "telephony.operation". - :vartype object: str - :ivar status: Required. Known values are: "not_started", "running", "succeeded", "failed", - "cancelled", and "unknown". - :vartype status: str or ~azure.ai.projects.models.TelephonyOperationStatus - :ivar created_at: - :vartype created_at: ~datetime.datetime - :ivar error: - :vartype error: ~azure.ai.projects.models.ApiError - :ivar resource: - :vartype resource: ~azure.ai.projects.models.TelephonyOperationResource - """ - - id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - object: Literal["telephony.operation"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required. Default value is \"telephony.operation\".""" - status: Union[str, "_models.TelephonyOperationStatus"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Required. Known values are: \"not_started\", \"running\", \"succeeded\", \"failed\", - \"cancelled\", and \"unknown\".""" - created_at: Optional[datetime.datetime] = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - error: Optional["_models.ApiError"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - resource: Optional["_models.TelephonyOperationResource"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - - @overload - def __init__( - self, - *, - id: str, # pylint: disable=redefined-builtin - status: Union[str, "_models.TelephonyOperationStatus"], - created_at: Optional[datetime.datetime] = None, - error: Optional["_models.ApiError"] = None, - resource: Optional["_models.TelephonyOperationResource"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.object: Literal["telephony.operation"] = "telephony.operation" - - -class TelephonyOperationResource(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A resource produced by a successful outbound telephony operation. - - :ivar id: Required. - :vartype id: str - :ivar type: Required. - :vartype type: str - """ - - id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - type: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - - @overload - def __init__( - self, - *, - id: str, # pylint: disable=redefined-builtin - type: str, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - class TelephonyOutboundDestination(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The destination of an outbound call. diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_operations.py b/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_operations.py index 705d8978726e..ee00315ca06d 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_operations.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/operations/_operations.py @@ -5022,286 +5022,6 @@ def build_beta_voice_agents_telephony_cancel_call_job_request( # pylint: disabl return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_beta_voice_agents_telephony_create_campaign_request( # pylint: disable=name-too-long - agent_name: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/agents/{agent_name}/telephony/campaigns" - path_format_arguments = { - "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_beta_voice_agents_telephony_get_campaign_request( # pylint: disable=name-too-long - agent_name: str, campaign_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/agents/{agent_name}/telephony/campaigns/{campaign_id}" - path_format_arguments = { - "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), - "campaign_id": _SERIALIZER.url("campaign_id", campaign_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_beta_voice_agents_telephony_import_campaign_recipients_request( # pylint: disable=name-too-long - agent_name: str, campaign_id: str, *, idempotency_key: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/agents/{agent_name}/telephony/campaigns/{campaign_id}/recipients:import" - path_format_arguments = { - "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), - "campaign_id": _SERIALIZER.url("campaign_id", campaign_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Idempotency-Key"] = _SERIALIZER.header("idempotency_key", idempotency_key, "str") - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_beta_voice_agents_telephony_get_campaign_recipient_import_request( # pylint: disable=name-too-long - agent_name: str, campaign_id: str, import_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/agents/{agent_name}/telephony/campaigns/{campaign_id}/recipient_imports/{import_id}" - path_format_arguments = { - "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), - "campaign_id": _SERIALIZER.url("campaign_id", campaign_id, "str"), - "import_id": _SERIALIZER.url("import_id", import_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_beta_voice_agents_telephony_validate_campaign_request( # pylint: disable=name-too-long - agent_name: str, campaign_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/agents/{agent_name}/telephony/campaigns/{campaign_id}:validate" - path_format_arguments = { - "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), - "campaign_id": _SERIALIZER.url("campaign_id", campaign_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_beta_voice_agents_telephony_publish_campaign_request( # pylint: disable=name-too-long - agent_name: str, campaign_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/agents/{agent_name}/telephony/campaigns/{campaign_id}:publish" - path_format_arguments = { - "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), - "campaign_id": _SERIALIZER.url("campaign_id", campaign_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_beta_voice_agents_telephony_pause_campaign_request( # pylint: disable=name-too-long - agent_name: str, campaign_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/agents/{agent_name}/telephony/campaigns/{campaign_id}:pause" - path_format_arguments = { - "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), - "campaign_id": _SERIALIZER.url("campaign_id", campaign_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_beta_voice_agents_telephony_resume_campaign_request( # pylint: disable=name-too-long - agent_name: str, campaign_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/agents/{agent_name}/telephony/campaigns/{campaign_id}:resume" - path_format_arguments = { - "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), - "campaign_id": _SERIALIZER.url("campaign_id", campaign_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_beta_voice_agents_telephony_cancel_campaign_request( # pylint: disable=name-too-long - agent_name: str, campaign_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/agents/{agent_name}/telephony/campaigns/{campaign_id}:cancel" - path_format_arguments = { - "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), - "campaign_id": _SERIALIZER.url("campaign_id", campaign_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_beta_voice_agents_telephony_get_operation_request( # pylint: disable=name-too-long - agent_name: str, operation_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/agents/{agent_name}/telephony/operations/{operation_id}" - path_format_arguments = { - "agent_name": _SERIALIZER.url("agent_name", agent_name, "str"), - "operation_id": _SERIALIZER.url("operation_id", operation_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - class BetaOperations: # pylint: disable=docstring-missing-param,too-many-instance-attributes """ .. warning:: @@ -23090,7 +22810,7 @@ def download_audio(self, agent_name: str, conversation_id: str, **kwargs: Any) - return deserialized # type: ignore -class BetaVoiceAgentsTelephonyOperations: # pylint: disable=docstring-missing-param,too-many-public-methods +class BetaVoiceAgentsTelephonyOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -24705,1223 +24425,3 @@ def cancel_call_job( return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore - - @overload - def create_campaign( - self, - agent_name: str, - body: _models.CreateTelephonyCampaignRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.TelephonyCampaign: - """Create an outbound telephony campaign. - - Creates a draft outbound campaign. Recipients are imported and validated before the campaign - can be published. - - :param agent_name: Required. - :type agent_name: str - :param body: Required. - :type body: ~azure.ai.projects.models.CreateTelephonyCampaignRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: TelephonyCampaign. The TelephonyCampaign is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.TelephonyCampaign - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_campaign( - self, agent_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.TelephonyCampaign: - """Create an outbound telephony campaign. - - Creates a draft outbound campaign. Recipients are imported and validated before the campaign - can be published. - - :param agent_name: Required. - :type agent_name: str - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: TelephonyCampaign. The TelephonyCampaign is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.TelephonyCampaign - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_campaign( - self, agent_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.TelephonyCampaign: - """Create an outbound telephony campaign. - - Creates a draft outbound campaign. Recipients are imported and validated before the campaign - can be published. - - :param agent_name: Required. - :type agent_name: str - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: TelephonyCampaign. The TelephonyCampaign is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.TelephonyCampaign - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create_campaign( - self, agent_name: str, body: Union[_models.CreateTelephonyCampaignRequest, JSON, IO[bytes]], **kwargs: Any - ) -> _models.TelephonyCampaign: - """Create an outbound telephony campaign. - - Creates a draft outbound campaign. Recipients are imported and validated before the campaign - can be published. - - :param agent_name: Required. - :type agent_name: str - :param body: Is one of the following types: CreateTelephonyCampaignRequest, JSON, IO[bytes] - Required. - :type body: ~azure.ai.projects.models.CreateTelephonyCampaignRequest or JSON or IO[bytes] - :return: TelephonyCampaign. The TelephonyCampaign is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.TelephonyCampaign - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.TelephonyCampaign] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_beta_voice_agents_telephony_create_campaign_request( - agent_name=agent_name, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [201]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ApiErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) - - response_headers = {} - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.TelephonyCampaign, response.json()) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def get_campaign(self, agent_name: str, campaign_id: str, **kwargs: Any) -> _models.TelephonyCampaign: - """Get an outbound telephony campaign. - - Retrieves an outbound campaign, including configuration, execution state, and aggregate - call-job counts. - - :param agent_name: Required. - :type agent_name: str - :param campaign_id: Required. - :type campaign_id: str - :return: TelephonyCampaign. The TelephonyCampaign is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.TelephonyCampaign - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.TelephonyCampaign] = kwargs.pop("cls", None) - - _request = build_beta_voice_agents_telephony_get_campaign_request( - agent_name=agent_name, - campaign_id=campaign_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ApiErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.TelephonyCampaign, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _import_campaign_recipients_initial( - self, - agent_name: str, - campaign_id: str, - body: Union[_models.ImportTelephonyCampaignRecipientsRequest, JSON, IO[bytes]], - *, - idempotency_key: str, - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_beta_voice_agents_telephony_import_campaign_recipients_request( - agent_name=agent_name, - campaign_id=campaign_id, - idempotency_key=idempotency_key, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ApiErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) - - response_headers = {} - response_headers["Operation-Location"] = self._deserialize("str", response.headers.get("Operation-Location")) - response_headers["Retry-After"] = self._deserialize("duration-seconds-int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_import_campaign_recipients( - self, - agent_name: str, - campaign_id: str, - body: _models.ImportTelephonyCampaignRecipientsRequest, - *, - idempotency_key: str, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.TelephonyOperationResource]: - """Import outbound telephony campaign recipients. - - Starts an asynchronous import of campaign recipients from a Dataset CSV, JSON array, or JSONL - file. - - :param agent_name: Required. - :type agent_name: str - :param campaign_id: Required. - :type campaign_id: str - :param body: Required. - :type body: ~azure.ai.projects.models.ImportTelephonyCampaignRecipientsRequest - :keyword idempotency_key: Required. - :paramtype idempotency_key: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns TelephonyOperationResource. The - TelephonyOperationResource is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.ai.projects.models.TelephonyOperationResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_import_campaign_recipients( - self, - agent_name: str, - campaign_id: str, - body: JSON, - *, - idempotency_key: str, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.TelephonyOperationResource]: - """Import outbound telephony campaign recipients. - - Starts an asynchronous import of campaign recipients from a Dataset CSV, JSON array, or JSONL - file. - - :param agent_name: Required. - :type agent_name: str - :param campaign_id: Required. - :type campaign_id: str - :param body: Required. - :type body: JSON - :keyword idempotency_key: Required. - :paramtype idempotency_key: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns TelephonyOperationResource. The - TelephonyOperationResource is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.ai.projects.models.TelephonyOperationResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_import_campaign_recipients( - self, - agent_name: str, - campaign_id: str, - body: IO[bytes], - *, - idempotency_key: str, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.TelephonyOperationResource]: - """Import outbound telephony campaign recipients. - - Starts an asynchronous import of campaign recipients from a Dataset CSV, JSON array, or JSONL - file. - - :param agent_name: Required. - :type agent_name: str - :param campaign_id: Required. - :type campaign_id: str - :param body: Required. - :type body: IO[bytes] - :keyword idempotency_key: Required. - :paramtype idempotency_key: str - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns TelephonyOperationResource. The - TelephonyOperationResource is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.ai.projects.models.TelephonyOperationResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_import_campaign_recipients( - self, - agent_name: str, - campaign_id: str, - body: Union[_models.ImportTelephonyCampaignRecipientsRequest, JSON, IO[bytes]], - *, - idempotency_key: str, - **kwargs: Any - ) -> LROPoller[_models.TelephonyOperationResource]: - """Import outbound telephony campaign recipients. - - Starts an asynchronous import of campaign recipients from a Dataset CSV, JSON array, or JSONL - file. - - :param agent_name: Required. - :type agent_name: str - :param campaign_id: Required. - :type campaign_id: str - :param body: Is one of the following types: ImportTelephonyCampaignRecipientsRequest, JSON, - IO[bytes] Required. - :type body: ~azure.ai.projects.models.ImportTelephonyCampaignRecipientsRequest or JSON or - IO[bytes] - :keyword idempotency_key: Required. - :paramtype idempotency_key: str - :return: An instance of LROPoller that returns TelephonyOperationResource. The - TelephonyOperationResource is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.ai.projects.models.TelephonyOperationResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.TelephonyOperationResource] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._import_campaign_recipients_initial( - agent_name=agent_name, - campaign_id=campaign_id, - body=body, - idempotency_key=idempotency_key, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response_headers = {} - response = pipeline_response.http_response - response_headers["Operation-Location"] = self._deserialize( - "str", response.headers.get("Operation-Location") - ) - response_headers["Retry-After"] = self._deserialize( - "duration-seconds-int", response.headers.get("Retry-After") - ) - - deserialized = _deserialize(_models.TelephonyOperationResource, response.json().get("resource", {})) - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, LROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.TelephonyOperationResource].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.TelephonyOperationResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @distributed_trace - def get_campaign_recipient_import( - self, agent_name: str, campaign_id: str, import_id: str, **kwargs: Any - ) -> _models.TelephonyCampaignRecipientImport: - """Get an outbound telephony campaign recipient import. - - Retrieves the durable status and counters for a campaign recipient import. - - :param agent_name: Required. - :type agent_name: str - :param campaign_id: Required. - :type campaign_id: str - :param import_id: Required. - :type import_id: str - :return: TelephonyCampaignRecipientImport. The TelephonyCampaignRecipientImport is compatible - with MutableMapping - :rtype: ~azure.ai.projects.models.TelephonyCampaignRecipientImport - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.TelephonyCampaignRecipientImport] = kwargs.pop("cls", None) - - _request = build_beta_voice_agents_telephony_get_campaign_recipient_import_request( - agent_name=agent_name, - campaign_id=campaign_id, - import_id=import_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ApiErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.TelephonyCampaignRecipientImport, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _validate_campaign_initial(self, agent_name: str, campaign_id: str, **kwargs: Any) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_beta_voice_agents_telephony_validate_campaign_request( - agent_name=agent_name, - campaign_id=campaign_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ApiErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) - - response_headers = {} - response_headers["Operation-Location"] = self._deserialize("str", response.headers.get("Operation-Location")) - response_headers["Retry-After"] = self._deserialize("duration-seconds-int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_validate_campaign( - self, agent_name: str, campaign_id: str, **kwargs: Any - ) -> LROPoller[_models.TelephonyOperationResource]: - """Validate an outbound telephony campaign. - - Starts asynchronous validation of the current campaign draft and imported recipient snapshot. - - :param agent_name: Required. - :type agent_name: str - :param campaign_id: Required. - :type campaign_id: str - :return: An instance of LROPoller that returns TelephonyOperationResource. The - TelephonyOperationResource is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.ai.projects.models.TelephonyOperationResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.TelephonyOperationResource] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._validate_campaign_initial( - agent_name=agent_name, - campaign_id=campaign_id, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response_headers = {} - response = pipeline_response.http_response - response_headers["Operation-Location"] = self._deserialize( - "str", response.headers.get("Operation-Location") - ) - response_headers["Retry-After"] = self._deserialize( - "duration-seconds-int", response.headers.get("Retry-After") - ) - - deserialized = _deserialize(_models.TelephonyOperationResource, response.json().get("resource", {})) - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, LROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.TelephonyOperationResource].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.TelephonyOperationResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _publish_campaign_initial( - self, - agent_name: str, - campaign_id: str, - body: Union[_models.PublishTelephonyCampaignRequest, JSON, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_beta_voice_agents_telephony_publish_campaign_request( - agent_name=agent_name, - campaign_id=campaign_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ApiErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) - - response_headers = {} - response_headers["Operation-Location"] = self._deserialize("str", response.headers.get("Operation-Location")) - response_headers["Retry-After"] = self._deserialize("duration-seconds-int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_publish_campaign( - self, - agent_name: str, - campaign_id: str, - body: _models.PublishTelephonyCampaignRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.TelephonyOperationResource]: - """Publish an outbound telephony campaign. - - Permanently locks the validated campaign draft and starts asynchronous call-job - materialization. - - :param agent_name: Required. - :type agent_name: str - :param campaign_id: Required. - :type campaign_id: str - :param body: Required. - :type body: ~azure.ai.projects.models.PublishTelephonyCampaignRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns TelephonyOperationResource. The - TelephonyOperationResource is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.ai.projects.models.TelephonyOperationResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_publish_campaign( - self, agent_name: str, campaign_id: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.TelephonyOperationResource]: - """Publish an outbound telephony campaign. - - Permanently locks the validated campaign draft and starts asynchronous call-job - materialization. - - :param agent_name: Required. - :type agent_name: str - :param campaign_id: Required. - :type campaign_id: str - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns TelephonyOperationResource. The - TelephonyOperationResource is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.ai.projects.models.TelephonyOperationResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_publish_campaign( - self, - agent_name: str, - campaign_id: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.TelephonyOperationResource]: - """Publish an outbound telephony campaign. - - Permanently locks the validated campaign draft and starts asynchronous call-job - materialization. - - :param agent_name: Required. - :type agent_name: str - :param campaign_id: Required. - :type campaign_id: str - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns TelephonyOperationResource. The - TelephonyOperationResource is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.ai.projects.models.TelephonyOperationResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_publish_campaign( - self, - agent_name: str, - campaign_id: str, - body: Union[_models.PublishTelephonyCampaignRequest, JSON, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.TelephonyOperationResource]: - """Publish an outbound telephony campaign. - - Permanently locks the validated campaign draft and starts asynchronous call-job - materialization. - - :param agent_name: Required. - :type agent_name: str - :param campaign_id: Required. - :type campaign_id: str - :param body: Is one of the following types: PublishTelephonyCampaignRequest, JSON, IO[bytes] - Required. - :type body: ~azure.ai.projects.models.PublishTelephonyCampaignRequest or JSON or IO[bytes] - :return: An instance of LROPoller that returns TelephonyOperationResource. The - TelephonyOperationResource is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.ai.projects.models.TelephonyOperationResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.TelephonyOperationResource] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._publish_campaign_initial( - agent_name=agent_name, - campaign_id=campaign_id, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response_headers = {} - response = pipeline_response.http_response - response_headers["Operation-Location"] = self._deserialize( - "str", response.headers.get("Operation-Location") - ) - response_headers["Retry-After"] = self._deserialize( - "duration-seconds-int", response.headers.get("Retry-After") - ) - - deserialized = _deserialize(_models.TelephonyOperationResource, response.json().get("resource", {})) - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, LROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.TelephonyOperationResource].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.TelephonyOperationResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @distributed_trace - def pause_campaign(self, agent_name: str, campaign_id: str, **kwargs: Any) -> _models.TelephonyCampaign: - """Pause an outbound telephony campaign. - - Pauses dispatch of call jobs owned by a published campaign. - - :param agent_name: Required. - :type agent_name: str - :param campaign_id: Required. - :type campaign_id: str - :return: TelephonyCampaign. The TelephonyCampaign is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.TelephonyCampaign - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.TelephonyCampaign] = kwargs.pop("cls", None) - - _request = build_beta_voice_agents_telephony_pause_campaign_request( - agent_name=agent_name, - campaign_id=campaign_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ApiErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.TelephonyCampaign, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def resume_campaign(self, agent_name: str, campaign_id: str, **kwargs: Any) -> _models.TelephonyCampaign: - """Resume an outbound telephony campaign. - - Resumes dispatch of call jobs owned by a paused campaign. - - :param agent_name: Required. - :type agent_name: str - :param campaign_id: Required. - :type campaign_id: str - :return: TelephonyCampaign. The TelephonyCampaign is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.TelephonyCampaign - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.TelephonyCampaign] = kwargs.pop("cls", None) - - _request = build_beta_voice_agents_telephony_resume_campaign_request( - agent_name=agent_name, - campaign_id=campaign_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ApiErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.TelephonyCampaign, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def cancel_campaign(self, agent_name: str, campaign_id: str, **kwargs: Any) -> _models.TelephonyCampaign: - """Cancel an outbound telephony campaign. - - Cancels a campaign and prevents any further call-job dispatch. - - :param agent_name: Required. - :type agent_name: str - :param campaign_id: Required. - :type campaign_id: str - :return: TelephonyCampaign. The TelephonyCampaign is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.TelephonyCampaign - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.TelephonyCampaign] = kwargs.pop("cls", None) - - _request = build_beta_voice_agents_telephony_cancel_campaign_request( - agent_name=agent_name, - campaign_id=campaign_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ApiErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.TelephonyCampaign, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def get_operation(self, agent_name: str, operation_id: str, **kwargs: Any) -> _models.TelephonyOperation: - """Get an outbound telephony operation. - - Retrieves an asynchronous outbound campaign operation. - - :param agent_name: Required. - :type agent_name: str - :param operation_id: Required. - :type operation_id: str - :return: TelephonyOperation. The TelephonyOperation is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.TelephonyOperation - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.TelephonyOperation] = kwargs.pop("cls", None) - - _request = build_beta_voice_agents_telephony_get_operation_request( - agent_name=agent_name, - operation_id=operation_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ApiErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.TelephonyOperation, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/ai/azure-ai-projects/docs/public-methods.md b/sdk/ai/azure-ai-projects/docs/public-methods.md index 065892d7cf8f..8db553e305e0 100644 --- a/sdk/ai/azure-ai-projects/docs/public-methods.md +++ b/sdk/ai/azure-ai-projects/docs/public-methods.md @@ -6,11 +6,11 @@ This document lists all public methods available on `AIProjectClient` and its su ## Summary -There are a total of 197 unique public methods: +There are a total of 187 unique public methods: - 5 stable methods on the client - 59 stable methods on top-level sub-clients -- 133 beta methods on nested beta sub-clients +- 123 beta methods on nested beta sub-clients ### Top-level sub-clients (stable operations) @@ -42,7 +42,7 @@ There are a total of 197 unique public methods: | `beta.schedules` | BetaSchedulesOperations | 6 | | `beta.skills` | BetaSkillsOperations | 11 | | `beta.voice_agents.conversations` | BetaVoiceAgentsConversationsOperations | 14 | -| `beta.voice_agents.telephony` | BetaVoiceAgentsTelephonyOperations | 24 | +| `beta.voice_agents.telephony` | BetaVoiceAgentsTelephonyOperations | 14 | ## Stable methods on the client @@ -256,28 +256,18 @@ Alphabetically sorted. An asterisk at the end of the method name means it is a h .beta.voice_agents.conversations.list_response_items .beta.voice_agents.conversations.list_responses -.beta.voice_agents.telephony.begin_import_campaign_recipients -.beta.voice_agents.telephony.begin_publish_campaign -.beta.voice_agents.telephony.begin_validate_campaign .beta.voice_agents.telephony.cancel_call_job -.beta.voice_agents.telephony.cancel_campaign .beta.voice_agents.telephony.create_binding .beta.voice_agents.telephony.create_call_job -.beta.voice_agents.telephony.create_campaign .beta.voice_agents.telephony.delete_binding .beta.voice_agents.telephony.end_call .beta.voice_agents.telephony.get_binding .beta.voice_agents.telephony.get_call .beta.voice_agents.telephony.get_call_job -.beta.voice_agents.telephony.get_campaign -.beta.voice_agents.telephony.get_campaign_recipient_import -.beta.voice_agents.telephony.get_operation .beta.voice_agents.telephony.get_transfer_targets .beta.voice_agents.telephony.list_bindings .beta.voice_agents.telephony.list_calls -.beta.voice_agents.telephony.pause_campaign .beta.voice_agents.telephony.replace_transfer_targets -.beta.voice_agents.telephony.resume_campaign .beta.voice_agents.telephony.transfer_call .beta.voice_agents.telephony.update_binding ``` diff --git a/sdk/ai/azure-ai-projects/tsp-location.yaml b/sdk/ai/azure-ai-projects/tsp-location.yaml index 6d2ea2e431af..0e813f5aa931 100644 --- a/sdk/ai/azure-ai-projects/tsp-location.yaml +++ b/sdk/ai/azure-ai-projects/tsp-location.yaml @@ -1,5 +1,5 @@ directory: specification/ai-foundry/data-plane/Foundry/src/sdk-python-js-azure-ai-projects -commit: 87bb77a181959f4d38ff6c5944d68e7e1e768b35 +commit: ca6532606645a9f69005bf52b1e53f37aad0c09b repo: Azure/azure-rest-api-specs additionalDirectories: - specification/ai-foundry/data-plane/Foundry/src/agents